Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture # 13.

Similar presentations


Presentation on theme: "Lecture # 13."— Presentation transcript:

1 Lecture # 13

2 C:\>debug -o 378 0A -i 379 D0 -o 378 19 -i 379 48
Sending byte 9A C:\>debug -i 379 D7 -o 378 0A -i 379 4F -o C:\>debug -o 378 0A -i 379 D0 -o i

3 0A= , Data line 4=0 (sent) D7= , BUSY=1 (recieved) >> 3 = & = = 0A , Data line 4 =0 (send for verification) D0 = , BUSY=1 (received & verified)

4 09= , Data line 4 =0 Set Data line 4 to | = = 19 ,(Sent to 378H) (Sent) 4FH= , BUSY=0 (Received) << 1 =

5 Joining both nibbles Low Nibble & = Hi Nibble & = Whole byte | = = 9A

6 int i= 0; char Buf[1024]; while (1) { ch = Buf [i]; if ((inport((*lpt) + 1)& 0x80) == 0) ch = ch & 0xEF; while((inport((*lpt) + 1) &0x80) == 0); } else ch = ch >> 4; ch = ch | 0x10; outport (*lpt, ch); i++; while((inport((*lpt) + 1) &0x80) == 80);

7 int i; while (1) { if ((inport(*lpt + 1)& 0x80) == 0x80) { x = inport ((*lpt) + 1); x = x >> 3; x = x & 0x0F; outport((*lpt), x); while((inport(*lpt + 1) &0x80) == 0x80); } else { y = inport ((*lpt) + 1); y = y << 1; temp = y; y = y | x;

8 temp = temp >> 4; \\ Move to Low Nibble
temp = temp | 0x10;\\ Set D4 bit i++; outport (*lpt, temp);\\ Send for verification Buf [i] = y; while((inport((*lpt) + 1) &0x80) == 0); }

9 Serial Communication Advantages Disadvantages

10 Types Of Serial Communication
Synchronous Asynchronous

11 Synchronous Communication
Timing signal is used to identify start and end of a bit. LSB MSB

12 Synchronous Communication
Sampling may be edge triggered. Special line may be required for timing signal (requires another line). Or the timing signal may be encoded within the original signal (requires double the bandwidth).

13 Asynchronous Communication
Does not use make use of timing signal. Each byte (word) needs to encapsulated in start and end bit.

14 Serial Communication using a UART
Parity bit Start bit of next byte 1 5 – 8 bit 1, 1.5, 2 Stop bit Start bit 1.5 Stop bit

15 Sampling Rate Bit rate = 9600 A bit is sampled after = 1/9600 -- But start and end bits of a particular Byte cannot be recognized. -- So 1.5 stop bit (high) is used to encapsulate a byte. A start bit (low) at the start of Byte is used to identify the start of a Byte.

16 Sampling Rate -- Bit rate and other settings should be the same at both ends i.e. Data bits per Byte. (5 – 8 ) Parity check Parity Even/Odd No. of stop bits.

17 Sampling Rate A = 41H = 0100 0001 B Parity = Odd Data = 8 Stop bit =1
1/1300 sec Data bits Stop bit Start bit Odd parity A = 41H = B Parity = Odd Data = 8 Stop bit =1 Data rate = 300 bits/sec

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

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

20 DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION )
RI CD DTE DCE DTR PC MODEM DSR RTS CTS RxD TxD DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION ) CTS (CAN BE USED FOR FLOW CONTROL )


Download ppt "Lecture # 13."

Similar presentations


Ads by Google