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.

Can I use a Timer which sets the baud rate in UART again ?

Status
Not open for further replies.

timerc

Newbie level 6
Joined
Nov 22, 2008
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
When I set the uart,I use one Timer to set baud rate.
If I can use that Timer again in later codes?
thanks very much!
 

8051 timer

you can do the serial communication with bit-bang routines if you need to free up the timer.
 

8051 timers

In bit-bang routines,how can I set the baud rate?
 

8051 timer

in 8951 there are two timers you can use one for baud rate generation and the other for your purpose. If you require one more timer then u can use 8952 which has three timers.
for transmitting/receiving lot of data i wouldn't recommend bit banging as it much of the processors time, check this link on bit banging
https://www.dnatechindia.com/index.php/Tutorials/8051-Tutorial/Bit-Banging.html
 

8051 timer

Hi,
I feel if the UART function and the other function requiring the timer can be time multiplexed, I feel you can use the same timer for both by calling the Timer init for each case before calling the respective function.

Regards,
Laktronics
 

8051 timer problem

Although unlikely, in some very rare applications it might be viable to use the timer serving as a baudrate generator also as a timer, simply enabling its interrupt (and reducing most of the interrupts to a mere djnz SlowDownCounter,xxx; xxx: reti); although if baudrate is anything faster than say 2400 Bauds, the performance penalty associated with doing this would be detrimental.

Also, some applications might accomodate UART in mode 2, where baudrate is generated without timer, directly from oscillator. A relatively slow crystal is needed for this, and a counterpart able to communicate in 9-bit format (e.g. 8-bit and parity, or 8 bit and 2 stopbits).

The most viable option is, as said above, using a '52 with T2; or, if more timers needed, a derivative (such as some member of the 'RD2 sub-family) with the PCA unit.

JW
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top