Tuesday, September 15, 2009

Transmit message using 8251

Statement: Write a assembly program to transmit a message from an 8085 to a CRT terminal for the following requirements and draw the interfacing diagram.
i) A message of 50 characters is stored as ASCII characters (without parity) in memory locations starting at 2200H.
ii) Baud rate x 16
iii) Stop bits 2

Solution Description:
CRT terminal uses normal RS 232C standard serial communication interface. Therefore, to transmit data to CRT it is necessary to have RS 232C interface at the sending end.
Fig. shows the interfacing of 8251 with RS 232C to 8085.
As shown in the Fig. three RS-232C signals (TxD, RxD are Ground) are used for serial communication between the CRT terminal and the 8085 system.
Line drivers and receivers are used to transfer logic levels from TTL logic to RS-232C logic.
For RS-232C the voltage level +3V to +15V is defined as logic 0 and voltage level from -3V to -15V is defined as logic 1.
The line driver, MC 1488, converts logic 1 of TIL to approximately -9V and logic a of TIL to approximately +9V. These levels at the receiving end are again converted by the line receiver, MC1489, into TTL compatible logic.

Source program:
LXI H, 2200H : Initialize memory pointer to pointer the message
MVI C, 32H : Initialize counter to send 50 characters
MVI A, 00H
OUT FFH : Dummy mode word
MVI A, 40H : Reset command word
OUT FFH : Reset 8251A
MVI A, CAH : Mode word initialization
MVI A, 11H : Command word initialization
ANI 0lH : Check TxRDY
JZ CHECK : Is TxRDY I? if not, check again
MOV A, M : Get the character in accumulator
OUT FEH : Send character to the transmitter
INX H : Increment memory pointer
DCR C : Decrement counter
JNZ CHECK : if not zero, send next character
HLT : Stop program execution

No comments:

Post a Comment