Pages: [1] 2   Go Down
Author Topic: Serial baud rate  (Read 932 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 10
Posts: 736
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: July 27, 2014, 07:16:31 am by casemod » Logged

Global Moderator
Netherlands
Online Online
Shannon Member
*****
Karma: 227
Posts: 14048
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)

Logged

Rob Tillaart

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

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5759
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 316
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 10
Posts: 736
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 152
Posts: 5759
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 316
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 10
Posts: 736
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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.
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 316
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6806
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 10
Posts: 736
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 316
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
God Member
*****
Karma: 10
Posts: 736
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1] 2   Go Up
Jump to: