8051 Baudrate

Aug 08, 2006 17 Replies

Hi



Is it just me or is the Baudrate setting of a 8051 core really so limited? I have a 8051 compatible controller with 13MHz Osc (unfortunately, this is a given situation and not chnageable). Is it true that 9600 is the fastest possible Baudrate that somehow fits to the standard baudrates of a PC? I was looking for something a bit faster, i.e. 57600. Can somebody confirm this or guide me toward the correct setting if I am wrong?



Thanks and best regards, Franz


You are right, the baudrate options of 8051 are really that limited. That is why crystals like 11.0592 MHz are popular.

Karl Olsen

It's a very old processor, early 80's, the early ones were also very slow so there wasn't much point in going any faster.

This depends on the 80C51 variant, and how old it is. If you go back a very long time, they have a minimum of /16 for the BAUD and another /12 for the clocks. So that limits your ratios. /12/16/N

Newer ones ( eg AT89C51RE2) have Baud Dividers, with higher ratio baud options, so can divide /16/N.

Some even have fractional dividers, which vary the /16 to sometimes be /15, so the average baud can be more accurately controled.

From your unusual 13Mhz, to 9600 is 1354.166', or to 57.6 is 225.6944, and that /16 is 14.1059, which is 0.75% off the usable 14. Note this is even, so you can divide by 7, and get 115.2K with 0.75% error, from 13.0MHz

The generic 89C52, can use timer2, as baud, and in that case, it divides by 2 then /16, then reload value. So, for your 57.6K in a generic 89C52, you divide by another 7.

-jg

It is a Syntek Controller and it seems to be 'exactly' 8051.

- Mode0: /12

- Mode1: use Timer1: TH1 / SMOD

- Mode2: /32 + /64

- Mode3: ->Mode0 With this Controller, 9600 seems to be the best that can be done.

Thanks, Franz

Can you give an example of your maths ?

-jg

It is not the controller, it is the choice of crystal. It will not divide into the standard PC baud rates. They did have 57600 in the 80's

- Mode0: /12 -> 1.08 MBaud

- Mode1: use Timer1: TH1 / SMOD -> TH1 = 249, SMOD = 1 -> 9673 Baud

- Mode2: /32 + /64 -> 406.25 kBaud + 203.13 kBaud

- Mode3: ->Mode0

I dont know where you take the /16 divider from ? It is a 8051 ('exactly', like I wrote) core with no additonal options to use Timer2 or whatsoever.

Franz

If there is no timer 2, and if this controller uses a vanilla /12 core, then you are correct, the ceiling from 13MHz is ~9600 Bd

-jg

Unfortunately, for this project, the Controller is 'given'. And this Syntek seems to be sort of 'dumb'. It has a Timer2, but it can not be used as baudrate source for the UART.

Thanks anyway. Have a nice day! Franz

Well, if you can't change the 13 MHz to give you a faster "standard PC baudrate" have you considered running a non-standard baudrate at the PC end?

If you can't do that either, how about putting a baud rate converter/buffer in between (many two UART development boards could be belted in to shape to do this in less than a day).

If both of these are too much trouble, too, you may not need a higher baud rate as much as you think you do.

Cheers, Alf

i worked on 8051 time back.but i think it can support greater baud rates.try with changing configuration of smod in pcon register. however why dont u try with newer versions of 8051 variant.

"abhay" schrieb im Newsbeitrag news: snipped-for-privacy@m79g2000cwm.googlegroups.com...

I know it can do higher baudrates, that's not the issue. And like I already wrote before: The Controller type and it clock frequency is 'given' and not changeable. Therefore, i will use 9600.

Best regards, Franz

And right there is your problem. You let things be "given" to you by people who don't know what they're doing.

Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.

That is a little unfair. You don't know why the clock frequency is fixed.

The Keil web site has a very good calculator for doing baud rates. It is useful because it shows you all the possible ones on a wide range to clock frequencies

\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ \/\/\/\/\ Chris Hills Staffs England /\/\/\/\/ /\/\/ chris@phaedsys.org www.phaedsys.org \/\/\ \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

"Chris Hills" schrieb im Newsbeitrag news: snipped-for-privacy@phaedsys.demon.co.uk...

Thanks ... you're right. Contrary to Hans-Bernhard I work 'in the real-world' where the customer with it's given hardware tells you what he wants. There are two choices: love it (and adapt to it) or leave it. However, always keep in mind that the customer is the one who pays the salary check at the end of every month.

Franz

hai it's possible to generate higher baudrate using 8051. the only thing you have to check is that whether the 8051 will work in higher frequency.i heard that silab is manufacturing 8051 which will wor at the speed of 100 mhz.using this speed you can generate highe baudrates.the equation is the same.when we are using the 11.0592mh crystal(the commenly used)we limit the baud rate up to 9600.

ml

limited?

is a

was

What? you can get 100 Baud to 115KBaud wiuth any 8051. Just pick the right xtal.. In fact.. I think 11.0592 will hit them all.. But there is not a

9600 limit nor do you need a 100Mhz MPU to do it.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required