Universal Asynchronous Receiver/Transmitter (UART)

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

INPUT-OUTPUT ORGANIZATION
Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
Serial I/O - Programmable Communication Interface
1 Fall 2005 Local Serial Asynchronous Communication Qutaibah Malluhi Computer Science and Engineering Qatar University.
Eng. Husam Alzaq The Islamic Uni. Of Gaza
USART and Asynchrono us Communica tion The USART is used for synchronous and asynchronous serial communication. USART = Universal Synchronous/Asynchronous.
CSCI 4550/8556 Computer Networks Comer, Chapter 5: Local Asynchronous Communication (RS-232)
COMP3221: Microprocessors and Embedded Systems
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
Local Asynchronous Communication
Computer communication. Introduction Mechanisms applied in communicating between a computer and another computer or with other devices. Mainly serial.
ECE 353 Introduction to Microprocessor Systems Michael G. Morrow, P.E. Week 13.
EEE305 Microcontroller Systems Lecture 7: Embedded C using PIC microcontrollers Serial i/o with the XC8 Teaching resources are at
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
INPUT-OUTPUT ORGANIZATION
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
Computers in Surveying SVY2301 / E4006 Automated Surveying.
The 8051 Microcontroller and Embedded Systems
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
SC200x Peripherals Broadband Entertainment Division DTV Source Applications July 2001.
UART and UART Driver B. Ramamurthy.
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
“Describe the overview of hardware interfacing and the serial communication interface. Describe the PIC18 connections to RS232. Explain the serial port.
Universal Asynchronous Receiver/Transmitter (UART)
ECE 353 Introduction to Microprocessor Systems Michael Schulte Week 13.
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
Industrial Reference Design Platform RS-232 Interface Developed by the TSC Americas Release 1.0.
Serial Communications
Advanced Embedded Systems Design Lecture 8 Serial I/O BAE Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma.
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
Chapter 5: Local Asynchronous Communication 1. Bit-wise data transmission 2. Asynchronous communication 3. Sending bits with electric current 4. Standard.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
Example. SBUF Register SCON Register(1) SCON Register(2)
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
NS Training Hardware. Serial Controller - UART.
Interfaces and Synchronization Martin Weiss. EIA 232D Interface Standard u Synonymous with ITU V.24 u Asynchronous interface u Up to 19.2kbps u 50 foot.
Serial Communications Interface Module Slide #1 of 19 MC68HC908GP20 Training PURPOSE -To explain how to configure and use the Serial Communications Interface.
© 2009, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the serial communication.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
8251 USART.
BASICS OF SERIAL COMMUNICATIONS BIRLA VISHWKARMA MAHAVIDYALAYA ELECTRONICS & TELECOMMUNICATION DEPARTMENT PRESENTING BY: ABHISHEK SINGH AMANDEEP.
Tiva C TM4C123GH6PM UART Embedded Systems ECE 4437 Fall 2015 Team 2:
TM Freescale Confidential Proprietary Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names.
Lecture 15. Modem Controller Register 4310 DTR 0 = Polling Operator 1 = Interrupts Enabled RTS 1 =Self Test 0 =Normal.
Lecture # 14. RS – 232C Standard Standard for physical dimensions of the connectors. PC (DTE) Modem RS – 232C Cable Connected via serial port (DCE)
 The LPC2xxx devices currently have two on- chip UARTS.  Except UART1 has additional modem support.
Serial Communications
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Serial mode of data transfer
RS-232 Communications.
CS-401 Computer Architecture & Assembly Language Programming
SERIAL PORT PROGRAMMING
Computer Organization and Design
UART Serial Port Programming
Asynchronous Serial Communications
Serial Communication Interface: Using 8251
Serial Communication Interface
Преглед Начин функционисања Имплементације
UART PC16550 (Universal Asynchronous Receiver/Transmitter) By Derwyn Hollobaugh
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
EUSART Serial Communication.
PIC Serial Port Interfacing
PIC Serial Port Interfacing
Serial Communications
AVR UART The UART, or Universal Asynchronous Receiver Transmitter, provides hardware support for a serial port on AVR processors Signaling is compatible.
Presentation transcript:

Universal Asynchronous Receiver/Transmitter (UART)

7-2 UART (Universal Asynchronous Receiver/Transmitter) Most UARTS are full duplex – they have separate pins and electronic hardware for the transmitter and receiver that allows serial output and serial input to take place simultaneously. Based around shift registers and a clock signal. UART clock determines baud rate UART frames the data bits with  a start bit to provide synchronisation to the receiver  one or more (usually one) stop bits to signal end of data Most UARTs can also optionally generate parity bits on transmission and parity checking on reception to provide simple error detection. UARTs often have receive and transmit buffers(FIFO's) as well as the serial shift registers

7-3 UART - Transmitter Transmitter (Tx) - converts data from parallel to serial format  inserts start and stop bits  calculates and inserts parity bit if required  output bit rate is determined by the UART clock Serial output Parallel data UART Clock from baud rate generator Status information

7-4 Asynchronous serial transmission 1 0 Serial transmission is little endian (least significant bit first)

7-5 UART - The Receiver  synchronises with transmitter using the falling edge of the start bit.  samples the input data line at a clock rate that is normally a multiple of baud rate, typically 16 times the baud rate.  reads each bit in middle of bit period (many modern UARTs use a majority decision of the several samples to determine the bit value)  removes the start and stop bits, optional calculates and checks the parity bit. Presents the received data value in parallel form. Serial input Status information Parallel data UART Clock from baud rate generator

7-6 Asynchronous serial reception Idle waiting for start bit Start bit 1 First data bit etc. 0 Start detected

7-7 UARTs Usually used on simple systems Typically point to point communications Various different formats and protocols Normally 8-bit data format with one start and one stop bit Standards: E.g. RS232  defines connector type, pin assignments, voltage levels, max bit rate, cable length etc.  Min. 3 pins – TxD, RxD, Ground  Other pins for data flow control. Some common RS232 baud rates - 300,1200,9600,19200 Handshaking  None  Hardware - RTS, CTS, etc - simple logic levels  Software - Xon/Xoff protocol

The LPC23xx UARTs UART1 is identical to UART0/2/3, but with the addition of a modem interface. 16 byte Receive and Transmit FIFOs. Register locations conform to ‘550 industry standard. Receiver FIFO trigger points at 1, 4, 8, and 14 bytes. Built-in baud rate generator. Standard modem interface signals included (CTS, DCD, DTS, DTR, RI, RTS). Either software or hardware flow control can be implemented. 7-8

UART Registers Control registers Transmit Receive FIFO control Status Interrupt Interrupt enable Format control Baud rate control 7-9

Baud Rate generator 7-10

MCB2300 Board schematic 7-11 RS232 driver/receiver 9-pin D connectors LPC2368 microcontroller port pins

The MCB2300 and Keil C compiler The C standard I/O functions can be set up to use the UARTs Using the serial.c and retarget.c source files the standard output functions such as printf() can be directed to use UART 1 for output. Standard input is currently not set up but could be. To use the standard serial output  declare extern void init_serial (void);  call init_serial(); at the start of your program  all standard output will now go to UART 1 None standard input int getkey(); is also available  waits for single byte input and returns ASCII value 7-12

Serial configuration #define UART1 /* Use UART 0 for printf */ /* If UART 0 is used for printf */ #ifdef UART0 #define UxFDR U0FDR #define UxLCR U0LCR #define UxDLL U0DLL #define UxDLM U0DLM #define UxLSR U0LSR #define UxTHR U0THR #define UxRBR U0RBR /* If UART 1 is used for printf */ #elif defined(UART1) #define UxFDR U1FDR #define UxLCR U1LCR #define UxDLL U1DLL #define UxDLM U1DLM #define UxLSR U1LSR #define UxTHR U1THR #define UxRBR U1RBR #endif 7-13

UART initialisation 7-14 /* Initialize Serial Interface */ void init_serial (void) { #ifdef UART0 PINSEL0 |= 0x ; /* Enable TxD0 and RxD0 */ #elif defined (UART1) PINSEL0 |= 0x ; /* Enable TxD1 */ PINSEL1 |= 0x ; /* Enable RxD1 */ #endif UxFDR = 0; /* Fractional divider not used */ UxLCR = 0x83; /* 8 bits, no Parity, 1 Stop bit */ UxDLL = 78; /* 9600 Baud 12.0 MHZ PCLK */ UxDLM = 0; /* High divisor latch = 0 */ UxLCR = 0x03; /* DLAB = 0 */ }

Low level serial I/O /* Implementation of putchar (also used by printf function to output data) */ int sendchar (int ch) { /* Write character to Serial Port */ while (!(UxLSR & 0x20)); return (UxTHR = ch); } int getkey (void) { /* Read character from Serial Port */ while (!(UxLSR & 0x01)); return (UxRBR); } 7-15