Shop OBEX P1 Docs P2 Docs Learn Events
Baud Rate Questions — Parallax Forums

Baud Rate Questions

Andy_ouhscAndy_ouhsc Posts: 17
edited 2011-06-28 09:21 in Propeller 1
Hello!
I have seen most of the SPIN programs were using 115200 and 9600 Baud Rates.
I was wondering how this works and have a few questions if anyone can help me:

1. "The higher the Baud Rate, the faster the program." Is this correct?
2. How do you calculate the speed (of the program or calculations), given:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

and baud rate is 9600

3. What is the optimized Baud Rate? Pros and Cons of using very large and very small values for Baud Rates? What are the recommendations?
4. Any other additional information I should know about setting the Baud Rates?

Very easy questions, Thanks for your time!

-Andy

Comments

  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-06-27 15:45
    Baud rate just states the bit rate of any data being transmitted, even if it is a burst of just one byte in a century. So 9600 might not slow a program down as long as the rate is faster than required and no flow control kicks in. 115200 is great for high speed transmission over short distances whereas the slower rates an cope with longer lines and hostile conditions.

    Fortunately with the Prop's multiple Cogs having a slower TX rate is even less likely to get in the way of other processes, than a single cored (with interupts) solution.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-06-27 15:52
    These days, most serial ports on PCs will easily handle 115KBaud or faster, but a lot of microcontrollers don't go that fast. 56KBaud may be the limit. Also, if the timing is a little bit off or the system clock is slower than the Prop's 80MHz, 115KBaud may not work reliably.
  • DaveJensonDaveJenson Posts: 375
    edited 2011-06-27 16:06
    Andy_ouhsc wrote: »
    Hello!
    I have seen most of the SPIN programs were using 115200 and 9600 Baud Rates.
    I was wondering how this works and have a few questions if anyone can help me:

    1. "The higher the Baud Rate, the faster the program." Is this correct?
    2. How do you calculate the speed (of the program or calculations), given:
    CON
    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000

    and baud rate is 9600

    3. What is the optimized Baud Rate? Pros and Cons of using very large and very small values for Baud Rates? What are the recommendations?
    4. Any other additional information I should know about setting the Baud Rates?

    Very easy questions, Thanks for your time!

    -Andy

    Baud rate refers to the speed at which characters are transmitted from one device to another, not the program speed of the transmitter.

    A1. Not necessarily. Baud Rate and program speed are not directly linked this way. Change that statement to "The higher the baud rate, the less time the program has to service other items."

    A2. (See 1) The baud rate has no influence on the speed of the program.

    A3. In my opinion faster is better. The higher baud rates transmit data faster but have special problems transmitting at a distance. The slower baud rates take longer to transmit data but are more reliable at distance. Recommendations? Find a baud rate that both receiver and transmitter are comfortable with (for me the faster the better).

    A4. Google search for "baud rate".... :D
  • Andy_ouhscAndy_ouhsc Posts: 17
    edited 2011-06-28 07:42
    Thanks All :-)
    Solved!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-06-28 09:21
    Another consideration is the number of serial ports you are using with the Propeller. If you use the four post serial object you can only use 57600 (closest common baud) or less and still use four ports at once (@80MHz).
Sign In or Register to comment.