Lecture 13
This presentation is the property of its rightful owner.
Sponsored Links
1 / 20

Lecture # 13 PowerPoint PPT Presentation


  • 75 Views
  • Uploaded on
  • Presentation posted in: General

Lecture # 13. 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 378 19.

Download Presentation

Lecture # 13

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Lecture 13

Lecture # 13


C debug o 378 0a i 379 d0 o 378 19 i 379 48

C:\>debug-o 378 0A-i 379D0-o 378 19-i 37948

Sending byte 9A

C:\>debug-i 379D7-o 378 0A-i 3794F-o 378 19


Lecture 13

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


Lecture 13

09=00001001 , Data line 4 =0Set Data line 4 to 100001001 | 00010000 = 00011001 = 19 ,(Sent to 378H) (Sent)4FH=01001111 , BUSY=0 (Received)01001111 << 1 = 1001111


Lecture 13

Joining both nibblesLow Nibble00011010 & 00001111 = 00001010Hi Nibble10011111 & 11110000 = 10010000Whole byte00001010 | 10010000 = 10011010 = 9A


Lecture 13

int i= 0; char Buf[1024];

while (1)

{ch = Buf [i];

if ((inport((*lpt) + 1)& 0x80) == 0)

{ch = Buf [i];

ch = ch & 0xEF;

while((inport((*lpt) + 1) &0x80) == 0);

}

else

{ch = Buf [i];

ch = ch >> 4;

ch = ch | 0x10;

outport (*lpt, ch);

i++;

while((inport((*lpt) + 1) &0x80) == 80);

}

}


Lecture 13

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;


Lecture 13

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);

}

}


Serial communication

Serial Communication

  • Advantages

  • Disadvantages


Lecture 13

Types Of Serial Communication

  • Synchronous

  • Asynchronous


Lecture 13

LSB

MSB

1 1 0 1 0 1 1 0

Synchronous Communication

  • Timing signal is used to identify start and end of a bit.

0 1 1 0 1 0 1 1


Lecture 13

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).


Lecture 13

Asynchronous Communication

  • Does not use make use of timing signal.

  • Each byte (word) needs to encapsulated in start and end bit.


Lecture 13

Serial Communication using a UART

Parity bit

Start bit of next byte

0 1 2 3 4 5 6 7 8

1

0

5 – 8 bit

1, 1.5, 2 Stop bit

Start bit

  • 1.5 Stop bit


Lecture 13

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.


Lecture 13

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.


Lecture 13

Sampling Rate

1/1300 sec

Data bits

Stop bit

Start bit

Odd parity

A = 41H = 0100 0001 B

Parity = Odd

Data = 8

Stop bit =1

Data rate = 300 bits/sec


Lecture 13

RS – 232C Standard

  • Standard for physical dimensions of the connectors.

RS – 232C Cable

PC

(DTE)

(DCE)

Modem

Connected via serial port


Lecture 13

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

18

3

RD

19

2

T X D

20

1

25 pin connector on PC


Lecture 13

RI

CD

DTE

DCE

DTR

MODEM

PC

DSR

RTS

CTS

RxD

TxD

DTR (SHOULD REMAIN HIGH THROUGH OUT THE SESSION )

CTS (CAN BE USED FOR FLOW CONTROL )


  • Login