Pages: [1]   Go Down
Author Topic: Baud rate restrictions for NewSoftSerial and AltSoftSerial  (Read 1134 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Full Member
***
Karma: 1
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear Arduino experts,

I need to use more than 1 UART on Atmega328. Hence, I will be using either NewSoftSerial or AltSoftSerial. May I know if there are any restrictions on the kinds of baud rates for these software UARTs? Any recommended baud rates?

Thank you.
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The AltSoftSerial claims it can do 57600 baud.
The SoftwareSerial claims it can do up to 115200 baud.
But has a major disadvantage: If using multiple software serial ports, only one can receive data at a time.

http://arduino.cc/en/Reference/SoftwareSerial

For a single serial port, use the SoftwareSerial. It is a well working library.

What is it for ? Do you need a higher baudrate than the common 9600 baud ?
With higher baudrates, the other device must have a precise clock with a X-tal.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49343
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also keep in mind that AltSoftSerial is linked to specific pins (8 and 9 IIRC), while SoftwareSerial allows you to use any pins other than the hardware serial pins (0 and 1).

NewSoftSerial is for 0023 and earlier versions, which are now obsolete.
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 103
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The AltSoftSerial claims it can do 57600 baud.
The SoftwareSerial claims it can do up to 115200 baud.
But has a major disadvantage: If using multiple software serial ports, only one can receive data at a time.

http://arduino.cc/en/Reference/SoftwareSerial

For a single serial port, use the SoftwareSerial. It is a well working library.

What is it for ? Do you need a higher baudrate than the common 9600 baud ?
With higher baudrates, the other device must have a precise clock with a X-tal.

Thanks for the reply. I know when using internal oscillator, the hardware UART cannot use higher baud rates. Does this also apply for SoftwareSerial? If you don't mind, another question is whether the baud rate chosen for the SoftwareSerial independent of the baud rate for hardware UART.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 614
Posts: 49343
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Does this also apply for SoftwareSerial?
Yes, it does.

Quote
If you don't mind, another question is whether the baud rate chosen for the SoftwareSerial independent of the baud rate for hardware UART.
Yes, they are.
Logged

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


For the Software Serial library I derived formulas for the magic numbers in the library allowing it to support "any" baud rate up to about 70K

see - http://arduino.cc/forum/index.php?topic=138497.0 -

Note that the hardware serial (tested UNO only) can do higher baud rates than 115200 . success with 230400, 345600 and 500000 baud but not with the IDE of course which only supports up to 115K2

Logged

Rob Tillaart

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

Pages: [1]   Go Up
Jump to: