Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.

Similar presentations


Presentation on theme: "Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross."— Presentation transcript:

1 Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross

2 Overview Communications overview Overview: UART (RS-232) Brief overview: –I2C –SPI –1-Wire 2

3 Digital Communications Different types of communication: –Serial – data only transmitted one bit at a time on one lane (per direction) (differential pairs of signals are referred to as a lane) –Parallel – data transmitted typically words at a time (on different lines) with additional lines for parity and control (Typically doesn’t use lanes) Different types of signals: –Data – The message which is to be sent –Control – Signals used to ensure to control the flow of data, eg. Clock, start of frame, end of frame 3

4 Universal Asynchronous Receiver/Transmitter UART Common standard: RS-232 Three wires used: –Transmit –Receive –Ground Data encapsulated as 7 or 8 bit chunks Optional Parity – monitor data integrity Allow serial communication between devices 4

5 Asynchronous Signals are self clocking – no separate clock is transmitted with data Receiver must lock onto data and decode individual bits without using a specific receive clock 5

6 Operation UARTs have two sectors: –Receive (RX): read the incoming serial bit- stream, converts to parallel data (Serial to Parallel Conversion) –Transmit (TX): converts parallel data from the microprocessor registers into a serial bit- stream to transmit (Parallel to Serial Conversion) Receiver has to detect phase of incoming data and phase lock it’s local clock to the data pattern 6

7 Parity Bit Parity is a simple check to verify data integrity An extra bit is added to each byte (or a defined chunk of data) called a parity bit 4 different cases: –Even Parity: Even number of bits in total –Odd Parity: Odd number of bits in total –Mark Parity: Parity bit is always ‘1’ –Space Parity: Parity bit is always ‘0’ 7

8 Parity Bit For each byte the number of ‘1’s is summed In even parity this sum should be even (parity bit is set to make it even) In odd parity this sum should be odd (parity bit is set to make it odd) Example: –10010111 (5 ‘1’s present) If even parity: parity bit should be ‘1’ If odd parity: parity bit should be ‘0’ 8

9 Parity Bit Receiver performs same parity count – if it doesn’t match the receiver knows that the data wasn’t received correctly What is a problem with Parity? –Only detects odd numbers of bit errors effectively 9

10 UART interfacing Microprocessor UART device Examples: GPS Receiver Bluetooth Transceiver TX RX TX 10

11 UART RS-232 interfacing RS-232 is the serial standard used on PC serial ports The voltage levels are inverted and have a larger swing than most microprocessors provide Use a specialised IC to convert: eg. MAX232 Microprocessor PC TX RX TX MAX232 11

12 I2CI2C Inter-Integrated Circuit Developed by Philips Multi-master serial computer bus Two wires – configured as open drain lines, pulled up with resistors –SDA: Serial Data –SCL: Serial Clock 12

13 I2CI2C Master sends Start bit, followed by address of desired slave followed by read/write bit Slave sends acknowledgement Master continues in requested mode (read or write), slave continues in complementary mode (write or read) until stop bit is sent Communications are in Big Endian bit format – most significant bit first Start bit: high->low transition of SDA with SCL high Stop bit: low->high transition of SDA with SCL high 13

14 SPI Serial Peripheral Interface Bus Developed by Motorola 4 signals used: –SCLK: Serial Clock (from master) –MOSI: (Master Output, Slave Input) –MISO: (Master Input, Slave Output) –SS: (Slave Select) (one pin for each slave device) –http://en.wikipedia.org/wiki/Serial_Peripheral_I nterface_Bus 14

15 SPI Allows full duplex (bi-directional at the same time) communication Higher throughput than I 2 C No flow control Short distance communication Applications: –SD Memory cards –Sensors –Memory –IC communications 15

16 Summary Digital communications is the process where digital devices exchange data encoded in a bit format Communications can occur in two forms (with various adaptations of each) – serial or parallel UART, I 2 C and SPI are common methods used for serial communications 16


Download ppt "Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross."

Similar presentations


Ads by Google