Download - ECE 371- Unit 10-Part 1
![Page 1: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/1.jpg)
ECE 371- Unit 10-Part 1
Introduction to Serial I/O
![Page 2: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/2.jpg)
TWO MAJOR CLASSES OF SERIAL DATA INTERFACES
• ASYNCHRONOUS SERIAL I/O
- USES “FRAMING BITS”
(START BIT AND STOP BIT(S))
WITH EACH CHARACTER
![Page 3: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/3.jpg)
idle
Start bit lsb msb
Parity bit
Stop bit(s)
Data value transmitted is 0 0 1 1 1 0 1 1
Parity bit shown represents even parity option
Asynchronous Serial Data Format
![Page 4: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/4.jpg)
• SYNCHRONOUS SERIAL I/O- USES SINGLE “SYNCH” CHARACTER AT BEGINNNG OF
DATA STREAM
OR
- USES SPECIAL CLOCK SIGNAL TO DEFINE BEGINNING OF EACH NEW CHARACTER
![Page 5: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/5.jpg)
Synch char Data charHeader information
Data char Data charData char
etc
Synchronous Serial Data Transmission Format
OR
Data char Data charData char Data char Data charData char
![Page 6: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/6.jpg)
CLASSES OF SERIAL DATA APPLICATION
• COMPUTER TO PERIPHERAL DEVICE
• COMPUTER TO COMPUTER
![Page 7: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/7.jpg)
Computer System
PeripheralDevice
Serial data
Handshaking Signals
Ground
Half-duplex Serial Data Interface Between Computer and Peripheral Device
![Page 8: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/8.jpg)
Computer System
PeripheralDevice
Serial data
Handshaking Signals
Ground
Full-duplex Serial Data Interface Between Computer and Peripheral Device
![Page 9: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/9.jpg)
Computer(DTE)
ModemTelephone
SystemModem
Computer(DTE)
Serial Data CommunicationBetween Computers, Using Modems
RS-232StandardInterface
RS-232StandardInterface
DCEData Communication Equipment
DTE = Data Terminal Equipment
RS-232 is a Standard Interface between DTE and DCE
![Page 10: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/10.jpg)
Laptop COM1 Port
CPU AsynchronousSerial Interface
Modem Telephone Line
Inside PC
![Page 11: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/11.jpg)
RS-232 Standard Interface
• Defines a 25-bit Connector
• Defines the function of each pin
• Defines EIA RS-232 Logic Levels– Serial Data Physical Representation
• Logic “1”: -25 volts ≤ V1 ≤ -5 volts
• Logic “0”: +5 volts ≤ V0 ≤ +25 volts
![Page 12: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/12.jpg)
TXD
RXD
GND
RTS
CTS
DCD
DSR
DTR
RI
DCE
EIA RS-232 Signals of Interest
DTE
![Page 13: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/13.jpg)
Primary RS-232 Signals
• RxD -- Received Data• TxD --Transmitted Data• RTS – Request to Send• CTS – Clear to Send• DTR – Data Terminal Ready - DTE Ready• DSR – Data Set Ready – DCE Ready• RI – Ring Indicator• DCD – Data Carrier Detect• GND -- Ground
![Page 14: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/14.jpg)
EIA RS-232 Interface
![Page 15: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/15.jpg)
COM Connector on PC
![Page 16: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/16.jpg)
SERIAL COMMUNICATION INTERFACE (SCI) ON THE MC9S12DP256B MICROCONTROLLER
• ASYNCHRONOUS SERIAL I/O
• COMPATIBLE WITH RS232 STANDARD
![Page 17: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/17.jpg)
SCI Data FormatsSee p. 211, text, for def.
![Page 18: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/18.jpg)
Serial Data Format
• Idle (no data being transmitted) = “1”
• Start = “0”
• Stop =“1”
• Each data bit is T seconds in length
• Baud = 1/T
• Least Significant Bit Sent First
• Most Significant Bit Sent Last
![Page 19: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/19.jpg)
ASCII Code for Letter A = 0b01000001 = 0x41ASCII Code for Letter B = 0b01000010 = 0x42 ASCII Code for Digit 1 = 0b00110001 = 0x31
Idle Start LSB MSB Stop
A = 1 1 1 0 1 0 0 0 0 0 1 0 1 1B = 1 1 1 0 0 1 0 0 0 0 1 0 1 11 = 1 1 1 0 1 0 0 0 1 1 0 0 1 1
![Page 20: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/20.jpg)
ASCII Character Set
7-bit Characters
d6 d5 d4 d3 d2 d1 d0 0 0 x x x x x Control Characters 0 1 x x x x x Numbers and Punctuation 1 0 x x x x x Upper Case Characters 1 1 x x x x x Lower Case Characters
Ctrl J = Line FeedCtrl M = Carriage ReturnCtrl Q = XONCtrl S = XOFFCtrl Z = End of File
![Page 21: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/21.jpg)
2 Asynchronous Serial PortsSCI0 and SCI1
SCI0 – Uses Port S[1:0]SCI1 – Uses Port S[3:2]
![Page 22: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/22.jpg)
RS-232 TTL Level Converters
![Page 23: ECE 371- Unit 10-Part 1](https://reader035.vdocument.in/reader035/viewer/2022081513/56815841550346895dc599f8/html5/thumbnails/23.jpg)
TTL – RS-232 ConversionChannel 0RTS = CTSDCD = DTR = DSRRI – No Connection
Channel 1Data Lines Only
TTL – RS-232 ConversionDC to DC Power Supply