All things being equal (hardware, software etc) are there pros and cons of using 9600 or 115200 Baud speeds for Serial? One obvious benefit of 115200 over 9600 is throughput. But does 9600 have some advantages over 115200?
Hi,
9600 was a sort of default speed, a lot of industry/commercial equipment used to be 9600.
This was because of noise and EMR interference.
Before that 1200 baud.
As technology has rolled on, higher speeds have been able to conquer these problems, I use 115200 with the IDE monitor, but haven't tried it over more than about a metre of RS232.
You will find some sensors, GPS devices communicate at 4800 or 9600 as their default speed to allow them to communicate with most devices and no errors.
Any slower and they would have trouble sending all their data at the typical once a second.
The grade of cable is one area that has helped higher speeds.
I work in industrial electronics and now most of the newer systems are Ethernet, CAT, Canbus, or some proprietary adaptation measured in 100s of Mega bits per second, Giga is not far behind.
All at a much higher speed than the old 9600baud.
IDE monitor speed of 115200 can be of an advantage when there is a lot of code and some very time sensitive processing being done.
Actually 9600 was the fastest modems(synchronous) that you could get for the telephones lines. They could default to 4800 when errors were prevalent on the lines. Before that was 2400 BPS modems and 1200 bps modems. All used 4 wires. Two for transmit and two for receive. Some 1200 bps modems split the audio spectrum so both TX and RX could use two wires.
Some modems used a primary speed and a subchannel for a second channel. RS-232 was designed for the latter. Data General sourced modems that could do the latter and was used extensively to communicate WHILE a large data file was being sent.
I used 1200baud for packet radio VHF, AX25.
Most of the homebrew packet was world modem AM7910 chip or there was a dedicated 1200baud IC used in telecoms.
I ran Digicom with Commodore 64, great machine, then went to 286 with Baycom.
Tom..
PS. I'm off to bed, hayfever been keeping me awake.
I do understand. I have juniper pollen fever every Spring. That is over till next year. I used a recliner at 45 degrees in order to get sleep at night.
I plan on using my "Serial" knowledge gained here to further my plans for world domination (with in the next 3 months I will use Serial at 9600 to take over the UN, China , and all Western nations but please don't tell anyone of my plans. Just a secret between you and me , OK?) ...
Or perhaps I am just curious about the two speeds and just wanted to learn more for learning's own sake.
So, Two plain wires close together at say 3 yards give or take might have significant cross talk / capacitance at 115200 but much less so at 9600? If that is what your implying I am going to set up and try that out this weekend. Should be interesting to see what pops up in the experiment. Again: properly shielded cable will reduce that effect but plain wires close to each other might show it up (??).
@SamBrownADK When you've thoroughly explored the 5V TX/RX world of Arduino, look up true RS232, at +/-12V. After that, research RS485 and RS422 for a giggle.
I use RS485 all over my basement, as one data point for you. No noise. Tried it at 1 megabit, rolled it back to 115200 because that's a lot more than I need, I was getting zero errors at that rate(and only very few per hour at the 1 megabit).
Because that is NOT how data on the telephone system worked. Most leased lines were multiplexed over radio as well as high speed land lines. And the telephone system uses bridges to connect multi-drop location to a single leased line. Bridges are several in and one way out.
I've been experimenting with Arduinos on an RS485 network, where I also want to connect a computer to share the data via the USB ports, which means the computer has to use the same baud rate. To get the throughput I want, I'm using 250KB, and I've got the monitor in the IDE using that rate too. It all seems to work just fine. So far the RS485 side is all in a single room, but advice online says that with any reasonable wiring method, RS485 at 250KB is good for hundreds of meters range. I can't see any down side to doing things this way.
There are baud rates between 9600 and 115200 and even over a USB (non repeating / booster) I can still use my Arduinos.
If you use good quality cable and avoid being close to high power mains runs there should be almost zero issues.
My CNC machines are all 115200 and have never missed a beat.
Using the ULTRA FAST and THREADING mode USB is over 8 foot long including the extension.
Simply ramp up until you loose reliability with your project and then step back from there.
Plenty of loopback tests you can perform to check how well you are doing.
another behavior of lower speeds that MIGHT be considered an advantage, sometimes, is that continuous output will throttle your application to the serial speed. Ie, 9600bps is about 1 character per millisecond, so an infinite loop that outputs single character will run about 1 loop per ms (while 115200 will run about 11 per ms.)
The CPU load on both ends will also be lower for lower bit rates (11000 interrupts per second is a pretty heavy load. Potentially double that for full duplex.)