EE357Unit10_SystemsProgramming

EE357Unit10_SystemsProgramming - RS-232 Serial Operation EE...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1 © Mark Redekopp, Al rights reserved EE 357 Unit 10b I/O Peripherals © Mark Redekopp, Al rights reserved RS-232 Serial Operation RS-232 Serial Ports communicate data 1-bit at a time at a certain baud rate (bits per second) Control bits (start/stop/parity) are usually included in data stream Full-duplex transmission – Transmit and Receive at the same time – 2 I/O pins: Tx and Rx Half-duplex: Only 1 transmitter at a time Example: transmission of 11000011 Start 1 1 0 0 0 0 1 1 Stop Baud Period Tx Rx Serial Port Connector © Mark Redekopp, Al rights reserved Establishing Serial Connections Serial settings controlled by configuration registers RS-232 Serial Both devices must be configured for the same settings to be able to communicate data correctly In our case, we will be communicating with a PC running a serial terminal program that allows us to configure our settings We will normally use a baud rate of 19200, 8 data bits, no parity bits, 1 stop bit, and no flow control © Mark Redekopp, Al rights reserved Error Checking & Flow Control Error-checking ensures that the data the receiver thinks it got is what the transmitter thinks it sent A bit may get flipped or synchronization may be lost and bits are misinterpreted Adding a parity bit allows us to detect an error (but not correct it) and ask the transmitter to re-send the data Parity idea: Always have an even number of 1’s in the transmission. The parity bit is whatever value is needed for an even # of 1’s Flow control ensures that the receiver can keep up with the transmission rate of the transmitter A receiver may have to execute other critical code and won’t be able to drain the received data Hardware method RTS – Request to Send CTS – Clear to Send
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 © Mark Redekopp, Al rights reserved Serial Control Data registers – UTB – Transmit Buffer – URB – Receive Buffer Control Registers – UCR – UART Command Register TC/RC: Enable (01) / Disable (10) Tx or Rx MISC: Reset TX, RX, Mode Register Pointer – UMR1/2 – UART Mode Reg. 2 reg.’s (1/2) share the same address 1 st write = UMR1, 2 nd write = UMR2 To get back to UMR1, must issue command via UCR PM & PT = Parity bit configuration B/C = Bits per character = Data bits SB = Number of stop bits CM = Echo/Loopback (Should be disabled) UTB = Data to be transmitted 7 6 5 4 3 2 1 0 URB = Data received 7 6 5 4 3 2 1 0 MISC TC 7 6 5 4 3 2 1 0 RC UCR = Command Reg. 7
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/03/2011 for the course EE 357 taught by Professor Mayeda during the Spring '08 term at USC.

Page1 / 5

EE357Unit10_SystemsProgramming - RS-232 Serial Operation EE...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online