Question

(1 point) Write an assembly program for the 8051 to transfer the letter Z serially at 2400 baud, continuously.

Please explain!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

8051 Assembly Program:

MOV TMOD,#20H ;timer 1, mode 2

MOV TH1, #-12 ;2400 baud rate

MOV SCON,#50H ;8-bit, 1 stop, REN enabled

SETB TR1 ;start timer 1

AGAIN : MOV SBUF,#"Z" ;letter "Z" to be transferred

HERE : JNB TI, HERE ;wait for last bit

CLR TI ;clear TI for next char

SJMP AGAIN ;Keep sending Z (Continously)

-------------------------------------------------------------------------------------------------------------------------------

Explanation:

Baud Rates in the 8051:

• Timer 1, mode 2 (8-bit, auto-reload)
• Define TH1 to set the baud rate.
XTAL = 11.0592 MHz
The system frequency = 11.0592 MHz / 12 = 921.6 kHz
Timer 1 has 921.6 kHz/ 32 = 28,800 Hz as source.
TH1=FDH means that UART sends a bit every 12 timer source.
Baud rate = 28,800/12= 2,400Hz where -12 (or F4 in HEX) is loaded into TH1.

Registers used in Serial Transfer Circuit:

SUBF (Serial data buffer)
SCON (Serial control register)

---------------------------------------------------------------------------------------------------------------------------------------
Please upvote if you are happy with the answer

Add a comment
Know the answer?
Add Answer to:
Please explain! (1 point) Write an assembly program for the 8051 to transfer the letter 'Z'...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT