Pages: [1]   Go Down
Author Topic: Maximum Serial Baud Rate - ANSWERED  (Read 19721 times)
0 Members and 2 Guests are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I need to squeeze about 150000 bps through a serial to bluetooth bridge, and was wondering what the maximum operating speed of the serial port on the Arduino is.  

The reference page specifically mentions 115200 (not quite enough bandwidth to accomodate the amount of data I need sent), but also notes that "other rates are possible."

Please advise.
« Last Edit: February 25, 2009, 04:54:05 pm by datalurkur » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 23
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have a look at the AtMega168 datasheet, on page 197 it would seem to suggest that with a 16MHz clock the serial port can handle 1Mbps.

I use the AtMega8 processor in the Arduino clones I build, and they have no problem using the serial port to receive DMX. DMX runs at 250,000 bps.

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Excellent!  I was concerned about ordering external hardware when the software serial is limited to 115200.  Good to know that I can squeeze more bandwidth out of it than that.

Updating subject to indicate the question has been answered.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So, ...

can you put something like:

Serial.begin(250000);

or even

Serial.begin(1000000);

???
Logged

Italy
Offline Offline
Full Member
***
Karma: 3
Posts: 142
jayduino rox
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can actually put
   Serial.begin(1000000); // 1Bps
it should even work with 2000000.  8-)

I did not test 2Mb with the Hardware serial library but with my own library as I need the serial in half-duplex mode and need some special stuff.

Anyway, you can squeeze a whooping 2Mbps out of an Arduino (tested only on Mega, but should be the same on the others as long as the clock is 16MHz). To modify the UARTnA register bit for Double Speed mode:

bitSet(UCSR0A, U2X0); // NB if you put now speed 10000 it is actually 20000, the UART divider is now 8 and not anymore 16

I am using this on the Arduino Megas TX3, so it is:
bitSet(UCSR3A, U2X3);  
I needed that because I bricked ( :o ) a AX-12+ servo setting it to 2Mbit/sec
Logged

Juergen

Pages: [1]   Go Up
Jump to: