EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

8051 baud rate

Started by lopamudra July 3, 2008
Hi all,

I am working on 8051 based Vehicle tracking system, which works on the
following principle:

1. GPS system transmit the current longitude/latitude/GMT to MC
2. MC transmit this position information via a SMS to a mobile phone
through a GSM device
3. Crystal freequency is 11.0592 MHz 

I want to set the transmission baudrate of MC to GSM device at 1152000 to
send the SMS massage.

The calculation for machine freequency = 11.0592 MHz/12/32 = 28800 Hz

28800/0.025 = 1152000, where 0.025 should be loaded in TH1, then what
should be the hex value & is this calculation correct?

4. should I chnage th crystal value to get the baud rate to 1152000. If
so, Please suggest the crystal value


On Thu, 03 Jul 2008 15:01:05 -0500, in comp.arch.embedded "lopamudra"
<lopa.banerjee2003@gmail.com> wrote:

>Hi all, > >I am working on 8051 based Vehicle tracking system, which works on the >following principle: > >1. GPS system transmit the current longitude/latitude/GMT to MC >2. MC transmit this position information via a SMS to a mobile phone >through a GSM device >3. Crystal freequency is 11.0592 MHz > >I want to set the transmission baudrate of MC to GSM device at 1152000 to >send the SMS massage. > >The calculation for machine freequency = 11.0592 MHz/12/32 = 28800 Hz > >28800/0.025 = 1152000, where 0.025 should be loaded in TH1, then what >should be the hex value & is this calculation correct? > >4. should I chnage th crystal value to get the baud rate to 1152000. If >so, Please suggest the crystal value >
http://www.keil.com/c51/baudrate.asp martin
>I am working on 8051 based Vehicle tracking system, which works on thefollowing principle:
>1. GPS system transmit the current longitude/latitude/GMT to MC >2. MC transmit this position information via a SMS to a mobile phonethrough a GSM device >3. Crystal freequency is 11.0592 MHz
>I want to set the transmission baudrate of MC to GSM device at 1152000 tosend the SMS massage.
Do you actually want 1152000 (*very* fast) or 115200 (standard PC uart frequency)...? If the former, you are quite out of luck with a standard 8051 - it just can't go that fast.
>The calculation for machine freequency = 11.0592 MHz/12/32 = 28800 Hz >28800/0.025 = 1152000, where 0.025 should be loaded in TH1, then whatshould be the hex value & is this calculation correct? >4. should I chnage th crystal value to get the baud rate to 1152000. Ifso, Please suggest the crystal value
if by chance you mean 115200: To calculate Timer-1 divisor: divisor = crystal/384/baudrate Note that only integer divisors in the range of 1-256 can be used. To calculate the baudrate from the divisor: baudrate = crystal/384/divisor So the fastest baudrate you can get with this calculation and 11059200 Mhz is: 11059200 / 384 / 1 = 28800 But ... you may not have noticed the SMOD bit (PCON.7) - this but means: "Double the serial baud rate when using modes 1, 2 or 3 and Timer-1" So: you can get: 28800*2 = 57600 1/2 way there, but not 115200. To get 115200 using Timer-1 you would need double the crystal speed, or 22.118400 Mhz - Assuming you have an 8051 derivative that will go that fast (see NOTE1) To get a baudrate of 1152000 you would need a crystal 10 times that frequency (221.184Mhz) - and I don't think you will find any 8051 derivative that can go that fast (wish ya could!) If by chance you really have an 8052, then you have the option of using timer-2 to generate the baudrate. The formula is: Baudrate = crystal/32/divisor So with an 11.059Mhz 8032 you can get 115200 with a divisor of 3 which is quite possible. To get 1152000 with a divisor of 1 (lowest), you would need 1152000x32 or 36.864 Mhz - I don't know if anyone makes an 8032 derivative that fast or not. NOTE1: If you are using a faster 805x derivative, check the clocking and baudrate calculations, as they often are not the same as the original Intel spec. NOTE2: When loading the divisor into the timer, you actually load (256-divisor) for Timer-1 and (65536-divisor) for Timer-2 - the timer counts up not down. Dave -- dave06a@ Low-cost firmware development tools: www.dunfield.com dunfield. Classic computer collection: www.classiccmp.org/dunfield com Some stuff I have for sale: www.dunfield.com/sale
> > 28800/0.025 = 1152000, where 0.025 should be loaded in TH1, then what > should be the hex value & is this calculation correct? >
Go to school!

The 2024 Embedded Online Conference