1 / 19

System Programming

NFC-IET-2011. System Programming. Lecture-14 Serial Communication Dated: May 17, 2011 By Somia Razzaq Note: Some slides and images of following lecture are taken from VU. RS – 232C Standard. Standard for physical dimensions of the connectors. RS – 232C Cable. PC (DTE). (DCE). Modem.

calida
Download Presentation

System Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NFC-IET-2011 System Programming Lecture-14 Serial Communication Dated: May 17, 2011 By Somia Razzaq Note: Some slides and images of following lecture are taken from VU

  2. RS – 232C Standard • Standard for physical dimensions of the connectors. RS – 232C Cable PC (DTE) (DCE) Modem Connected via serial port

  3. RS – 232C Connectors and SignalsDB25 (25 pin connector) 13 25 12 24 11 23 10 RI 22 9 21 CD 8 DTR 20 GND 7 19 6 DSR 18 5 CTS 17 4 RTS 16 3 RD 15 2 T X D 14 1 25 pin connector on PC

  4. RI(Ring Indicator) CD(Carrier Detect) DTE DCE DTR(Data Terminal Ready) MODEM PC DSR(Data Set Ready) RTS(Request to Send) CTS(Clear to Send) RxD TxD DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION ) CTS (CAN BE USED FOR FLOW CONTROL )

  5. DB9 Connector 1 CD 6 2 DSR R x D 7 3 RTS T x D 8 CTS 4 9 D T R RI 5 G N D

  6. UART Internals R x D Receiver Shift Register Receiver Buffer Register Interrupt Enable Register Interrupt to Parity LOGIC Line Status Register Interrupt ID Register Divisor Latch Register Line Control Register 2.DTR 1.RT Modem Control Register 1.CTS 2.DSR 3.CD Modem Status Register 4.RI T x D Transmit Shift Register Transmitter Holding Register

  7. Base +

  8. Served Ports in Standard PC BIOS supports 4 UARTS as COM Ports COM1, COM2, COM3, COM4

  9. Text Dump -d 40:00040:0000 F8 03 F8 02 E8 03 E8 02-BC 03 78 03 78 02 C0 9F ..........x.x...0040:0010 23 C8 20 80 02 85 00 20-00 00 34 00 34 00 71 10 #. .... ..4.4.q.0040:0020 0D 1C 71 10 0D 1C 64 20-20 39 34 05 30 0B 3A 27 ..q...d 94.0.:'0040:0030 30 0B 0D 1C 00 00 00 00-00 00 00 00 00 00 00 00 0...............0040:0040 D8 00 C3 00 00 00 00 00-00 03 50 00 00 10 00 00 ..........P.....0040:0050 00 0A 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................0040:0060 0F 0C 00 D4 03 29 30 00-00 00 00 00 02 C9 0B 00 .....)0.........0040:0070 00 00 00 00 00 00 08 00-14 14 14 14 01 01 01 01 ................-q

  10. Setting the Baud Rate 1.8432 MHZ=frequency generating by UARTS internally Baud rate =1.8432 MHZ / (16*Divisor) Divisor value loaded in DLL ( Base +0 ) and DLM ( Base +1 ) Divisor = 1, Baud Rate = 115200 Divisor = 0CH, Baud Rate = 9600 Divisor = 180H, Baud Rate = 300

  11. Line Control Register Word Length 00 = 5 BITS 01 = 6 BITS 10 = 7 BITS 11 = 8 BITS 0 Load THR 1Load Divisor Value Stop Communication =1 Resume Communication =0 Length of Stop BITS 0 = one BIT 1 =1-5 for 5 bit Word Constant Parity 0 =NO constant Parity 1 =Constant Parity 0 if bit 4 =1 1 if bit 4 =0 Parity Check and generation on Parity 0 = odd 1 = Even.

  12. Line Status Register Data Ready =1 Over Run Error = 1 TSR is Empty=1 TSR Contain a Byte=0 Parity Error =1 THR empty =1 THR contains a BYTE =0 Transfer Error (Framing Error) Stop Communication Signal from Other end =1

  13. Interrupt Enable Register Trigger Interrupt On Data Ready =1 Trigger Interrupt As soon as THR is empty =1 Trigger Interrupt On change in Modem Status =1 Trigger Interrupt On line status change =1

  14. Interrupt ID Register Trigger Triggered Modem/Line 00 =Change in Modem Status 01 = THR is Empty 10 = Data is Ready 11 =Error in Data

  15. Modem Controller Register DTR 1 =Self Test 0 =Normal RTS 0 = Polling Operator 1 = Interrupts Enabled

  16. Modem Status Register Change in CTS CD Change in DSR RI Change in RI DSR Change in CD CTS

  17. UART (16550) FIFO QUEUE FIFO buffer on=1 Number of Characters Received To Trigger an Interrupt 00 =After Every Character 01 =After 4 Character 10 =After 8 Character 11 =After 14 Character Clear Receiver Buffer =1 Clear send Buffer =1

  18. Interrupt ID Register (Revisited) Interrupt Triggered =1 1= Interrupt Triggered Because Buffer is not full But other side has stop sending data. (Time OUT) Reasons of Interrupt 00=Change in Modem Line Status 01=THR is Empty 10=Data is ready 11=Error in Data Transmit Any one of these BEING Set Indicates FIFO is ON.

More Related