Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] serial transmission in 8051

Status
Not open for further replies.

jayanthyk192

Full Member level 3
Joined
Sep 17, 2010
Messages
179
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
2,580
Hi,
I'm learning serial transmission using 8051.i'm using timer 1 in mode2,(commonly used).the timer reloads to (-3) every time it goes to 0 from ffh.the data sent to sbuf is transmitted readily.but when does each bit get transffered?is it when the TF1 is set each time?

in timers,in any mode,if the timer rolls from ffffh to 0,the TF is set,if the tr is not reset will the timer continue to run from 0 again?

in timer mode2 will the TF be set after the first cycle till the timer is off?
 

this may help you:
**broken link removed**
 

Thank you,that was helpful.but it did'nt clear my doubt.
what i want to know is:how does the SBUF know when to transmit a bit?will it be when the timer 1 rolls from ffh to reload value?

please tell if I'm right:when the baud is 9600,when the start bit is sent,the timer in the computer is also started along with the MC timer,and this is how the sync is brought about.

please help.

thank you.
 

The moment a byte is written into SBUF, it is framed with the start and stop bits and transferred serially via the TxD line...
When the bits are received serially via RxD, the 8051 deframes it by eliminating the stop and start bits, making a byte out of the data received, and then placing it in SBUF...
As for as 8051 is concerned, The machine cycle frequency will be = 11.0592 / 12 = 921.6 kHz,
and 921.6 kHz / 32 = 28,800 Hz is frequency by UART to timer 1 to set baud rate...

(a) 28,800 / 3 = 9600 where -3 = FD (hex) is loaded into TH1
(b) 28,800 / 12 = 2400 where -12 = F4 (hex) is loaded into TH1
(c) 28,800 / 24 = 1200 where -24 = E8 (hex) is loaded into TH1

Notice that dividing 1/12 of the crystal frequency by 32 is the default
value upon activation of the 8051 RESET pin.

And you are correct too whenever there is overflow of Timer 1 [MODE-2 {8-bit auto reload mode}], it will transmit a bit of data..
28,800 Hz is frequency by UART to timer 1 to set baud rate...
 

i differ from kandhu in this answer...

The moment a byte is written into SBUF, it is framed with the start and stop bits and transferred serially via the TxD line...

SBUF is 8 bit register, so how and where is the data framed and where is it stored? and from where is framed data transmitted.....

kandhu perhaps did not know how the state machine of 8051 is designed....
 

Thank you all for the help.my doubt is cleared.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top