Chapter 4 UART Serial Port Programming 1. Serial vs. Parallel Data Transfer 2.

Slides:



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

Serial Communications Interface (SCI) Michael LennardZachary PetersBao Nguyen.
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
Serial Communications (Chapter 10)
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
SCI: Serial Communications Interface Presented by: Sean Kline Chad Smith Jamie Cruce.
Serial I/O - Programmable Communication Interface
Eng. Husam Alzaq The Islamic Uni. Of Gaza
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.
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
1 SCI Serial Communication Interface Gerrit Becker James McClearen Charlie Hagadorn October 21, 2004.
University of Tehran 1 Interface Design Serial Communications Omid Fatemi.
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),
Digilent System Board Capabilities Serial Port (RS-232) Parallel Port 1 Pushbutton Hint: Good for a reset button Connected to a clock input. See Digilent.
Lecture Set 9 MCS-51 Serial Port.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
“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)
Microprocessors 2 lesson Subjects lesson 7 Planning Interrupts Serial communication /USART Questions.
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire conductors)
Serial Communications
Scott Baker Will Cross Belinda Frieri March 9 th, 2005 Serial Communication Overview ME4447/6405.
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
 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.
Extended Uart The High Speed Digital Systems Laboratory, Electrical Engineering Faculty, Technion By: Marganit Fina Supervisor: Rivkin Ina Winter 2007/8.
8051SERIAL PORT PROGRAMMING
Example 1 Program the divisor Latch for 300 baud. Assume Xin=1.8432MHz The Base Address: 0x3F8 0RX_TX / Divisor.low 1IER: Interrupt Enable Reg. / Divisor.high.
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:
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 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.
Chapter 6 Serial Communications
Serial mode of data transfer
UART Serial Port Programming
RS-232 Communications.
I2C Protocol and RTC Interfacing
Homework Reading Continue mp1 Labs Tokheim, Section 13-6 Questions?
CS-401 Computer Architecture & Assembly Language Programming
SERIAL PORT PROGRAMMING
RS-232 Communications.
SPI Protocol and DAC Interfacing
Serial Communication: RS-232 (IEEE Standard)
Programming Microcontroller
UART Serial Port Programming
UART Serial Port Programming
Serial Communication Interface: Using 8251
8251A UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER
Serial Communication Interface
UART Protocol Chapter 11 Sepehr Naimi
Преглед Начин функционисања Имплементације
NS Training Hardware.
Lecture 8 USCI Module SPI & I2C Modes
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.
Chapter 6 Transmission of Digital Data Interfaces and Modems
EUSART Serial Communication.
Source: Serial Port Source:
PIC Serial Port Interfacing
8051SERIAL PORT PROGRAMMING
Figure Serial versus Parallel Data Transfer
PIC Serial Port Interfacing
AVR UART The UART, or Universal Asynchronous Receiver Transmitter, provides hardware support for a serial port on AVR processors Signaling is compatible.
Presentation transcript:

Chapter 4 UART Serial Port Programming 1

Serial vs. Parallel Data Transfer 2

Parallel In Serial Out 3

Serial In Parallel Out 4

Simplex, Half-, and Full-Duplex Transfers 5

Framing ASCII "A" (0x41) 6

MAX232 7

MAX233 8

RS232 Pins 9 PinDescription 1Data carrier detect (DCD) 2Received data (RxD) 3Transmitted data (TxD) 4Data terminal ready (DTR) 5Signal ground (GND) 6Data set ready (DSR) 7Request to send (RTS) 8Clear to send (CTS) 9Ring indicator (RI)

9-Pin Male Connector 10

DTE-DCE and DTE-DTE Connections 11

MSP432 LaunchPad board 12

XDS110-ET emulator USB Port 13

Partial list of UART0 Registers and their addresses 14 Register NameRegister FunctionRegister Address UCA0CTLW0Control Word 04000_1000 UCA0BRWBaud Rate Control Word4000_1006 UCA0STATWStatus4000_100A UCA0RXBUFReceive Buffer4000_100C UCA0TXBUFTransfer Buffer4000_100E UCA0IFGInterrupt Flag4000_101C

A Simplified Block Diagram of UART 15

UART ControlWord0 (UCAxCTLW0) register 16

UART Control 0 Word (UCAxCTLW0) register 17 FieldBitDescription UCPEND15 0b = Parity disabled 1b = Parity enabled. Parity bit is generated (UCAxTXD) and expected (UCAxRXD). UCPARD14 0b = Odd parity 1b = Even parity UCMSBD13 0b = LSB first 1b = MSB first UC7BITD12 0b = 8-bit data 1b = 7-bit data UCSPBD11 0b = One stop bit 1b = Two stop bits UCMODEx D10: 9 00b = UART mode 01b = Idle-line multiprocessor mode 10b = Address-bit multiprocessor mode 11b = UART mode with automatic baud-rate detection UCSYNCD8 0b = Asynchronous mode 1b = Synchronous mode

UART Control 0 Word (UCAxCTLW0) register (Cont.) 18 FieldBitDescription UCSSELxD7:6 00b = UCLK 01b = ACLK 10b = SMCLK 11b = SMCLK UCRXEIED5 0b = Erroneous characters rejected and UCRXIFG is not set. 1b = Erroneous characters received set UCRXIFG. UCBRKIED4 0b = Received break characters do not set UCRXIFG. 1b = Received break characters set UCRXIFG. UCDORMD3 0b = Not dormant. All received characters set UCRXIFG. 1b = Dormant. Only characters that are preceded by an idle-line or with address bit set UCRXIFG. In UART mode with automatic baud-rate detection, only the combination of a break and synch field sets UCRXIFG. UCTXADDRD2 0b = Next frame transmitted is data. 1b = Next frame transmitted is an address. UCTXBRKD1 0b = Next frame transmitted is not a break. 1b = Next frame transmitted is a break or a break/synch. UCSWRSTD0 0b = Disabled. eUSCI_A reset released for operation. 1b = Enabled. eUSCI_A logic held in reset state.

UART Control Word 1(UCAxCTLW1) register 19

UART Control Word 1(UCAxCTLW1) register 20 FieldBitDescription ReservedD15:1Reserved UCGLITxD0 Deglitch time 00b = Approximately 2 ns 01b = Approximately 50 ns 10b = Approximately 100 ns 11b = Approximately 200 ns

Clock Circuit of UART0 21

UCAxMCTLW (UCOS16=0 for non- oversampling) 22

UCAxBRW 23

UART0 BRW Values for Some Standard Baud Rates using default OSCO16=0 and Clock of 3 MHz 24 Baud rateBRW (in decimal)BRW (in hex) 4, x271 9, x138 19, x9C 38,400780x4E 115,200260x1A

UART TX and RX Buffer registers 25

UART Status Register (UCAxSTATW) 26

UART Status Register (UCAxSTATW) 27 FieldBitDescription ReservedD15:8Reserved UCFED6Framing error flag. UCFE is cleared when UCAxRXBUF is read. 0b = No error 1b = Character received with low stop bit UCOED5Overrun error flag. This bit is set when a character is transferred into UCAxRXBUF before the previous character was read. UCOE is cleared automatically when UCxRXBUF is read. 0b = No error 1b = Overrun error occurred UCPED4Parity error flag. When UCPEN = 0, UCPE is read as 0. UCPE is cleared when UCAxRXBUF is read. 0b = No error 1b = Character received with parity error UCRXERRD2Receive error flag. This bit indicates a character was received with one or more errors. When UCRXERR = 1, on or more error flags, UCFE, UCPE, or UCOE is also set. UCRXERR is cleared when UCAxRXBUF is read. 0b = No receive errors detected 1b = Receive error detected UCBUSYD0eUSCI_A busy. This bit indicates if a transmit or receive operation is in progress. 0b = eUSCI_A inactive 1b = eUSCI_A transmitting or receiving

UART Interrupt Flag (UCAxIFG) and Interrupt Enable (UCAxIE) Registers 28

PxSEL1 and PxSEL0 Alternate Function Selection registers 29

Pins available for UARTs 30 I/O pinFunctionPxSEL1=0PxSEL0=1 P1.2UCA0RXDP1SEL1= P1SEL0= P1.3UCA0TXDP1SEL1= P1SEL0= FOR UART0: P1SEL1=0x00P1SEL0= =0x0C P2.2UCA1RXDP2SEL1= P2SEL0= P2.3UCA1TXDP2SEL1= P2SEL0= For UART1 P2SEL1=0x00P2SEL0= =0x0C P3.2UCA2RXDP3SEL1= P3SEL0= P3.3UCA2TXDP3SEL1= P3SEL0= For UART2 P3SEL1=0x00P3SEL0= =0x0C P9.6UCA3RXDP9SEL1= P9SEL0= P9.7UCA3TXDP9SEL1= P9SEL0= For UART3 P9SEL1=0x00P9SEL0= =0xC0

UART pins in MSP432 31