Go Down

Topic: Serial baud rate (Read 1 time) previous topic - next topic

casemod

Jul 27, 2014, 02:14 pm Last Edit: Jul 27, 2014, 02:16 pm by casemod Reason: 1
Hi all,

I would like to know what the maximun serial baud rate is for an arduino and or if someone has any experience working at higher baud rates than 115200bps.

Aditionally i was also wondering what are the clock requirements to do so.  Lets immagine I use the built in oscillator on the mega328, running at 8Mhz:


  • Would this be accurate enough to read a few analog sensors and send data reliably over a serial communication?

  • What would the maximun baud rate archievable be using the 8Mhz clock?


robtillaart

used it quite a lot,
you can set the baud rate to 500 000
but the Arduino Serial monitor cannot read at that pace (not supported)
use a terminal program like putty.exe or rterm.exe (or your favo terminal)

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

fungus


Aditionally i was also wondering what are the clock requirements to do so.  Lets immagine I use the built in oscillator on the mega328, running at 8Mhz:


.. in which case it's unlikely to work. Serial data needs very accurate timing.

Why do you need serial? There's lots of better, faster, more reliable ways to transmit data.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

john1993

at 8mhz 115k the internal oscillator is capable of providing more accurate timing than a crystal. uart divisors have too much error at exactly 8mhz but with slight adjustment of the internal clock can be right on for that baud rate. 1mhz is mentioned a lot lately but cable issues and operating system incompatibilities often prevent communication with a pc . imo 57k is the best choice for all hardware configurations including 8mhz xtl.

casemod



Aditionally i was also wondering what are the clock requirements to do so.  Lets immagine I use the built in oscillator on the mega328, running at 8Mhz:


.. in which case it's unlikely to work. Serial data needs very accurate timing.

Why do you need serial? There's lots of better, faster, more reliable ways to transmit data.



Well I have the SPI bus taken already, so a serial LCD seems to be the way if litle overhead is needed
According to atmel the factory RC can be trimmed to 1%. Has anyone did did on arduino?

Coding Badly


Description...
http://forum.arduino.cc/index.php?topic=8553.0

Latest version (which is always available on the project page)...
https://code.google.com/p/arduino-tiny/downloads/list?can=2&q=tinytuner

It was designed to work on ATtiny processors but it should not be too difficult to get it working on an ATmega328.

fungus


According to atmel the factory RC can be trimmed to 1%. Has anyone did did on arduino?


Yes, lots of people.

Search the forums for "SoftwareSerial", see for yourself how much trouble it causes...even with trimming.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

john1993

actually using internal osc has nothing to do with uart or softserial. generally 99.9% of new avrs work fine for either w/o any trimming. default osccal is very close to 8mhz. older ones like mega8 which have level 2 type internal osc still pretty close. in my experience 95% require no tuning. calibration is so easy though it dont make too much sense to avoid that step.

casemod


Yes, lots of people.

Search the forums for "SoftwareSerial", see for yourself how much trouble it causes...even with trimming.


Software serial has issues even running with a crystal, so its not a great comparison to start with.

Coding Badly


In addition, over the entire temperature / voltage envelope, a tuned internal oscillator is accurate enough for serial communications.  Any problems with SoftwareSerial have nothing to do with a tuned oscillator.

john1993


Software serial has issues even running with a crystal, so its not a great comparison to start with.


if by twice as accurate as hardware uart (2x resolution), more portable, less code, and more flexible protocols then you are correct. in fact its about the only way to guarantee reliable operation of 115k at 8mhz. the only place where uart excels is when doing many other things concurrently. even then, using pin ints in conjunction w/softserial reduces that problem.

specially comes in handy on avrs that have no uart. lol.

westfw

Quote
a tuned internal oscillator

Note that the "factory calibration" value is for 8MHz +/-10%, at 3V.
In theory, that could be "not good enough" for serial communications.

casemod



if by twice as accurate as hardware uart (2x resolution), more portable, less code, and more flexible protocols then you are correct. in fact its about the only way to guarantee reliable operation of 115k at 8mhz. the only place where uart excels is when doing many other things concurrently. even then, using pin ints in conjunction w/softserial reduces that problem.


Care to post your references?

john1993

if you dont understand that uart baud is limited to 2 clk resolution while nops adjust to 1, all avrs have a portb but minority have uarts, and hw cant do 3/9/16 bit protocols, etc then references wont help. if you really twist my arm i can post code for serial in that is 3/4 the smallest hw routine.

casemod


f you really twist my arm i can post code for serial in that is 3/4 the smallest hw routine.


I'm interested in evaluating that, performance wise.

Go Up