2

Otherwise worded: How do I resolve my understanding about baud rates and high speed serial data transfer?

From what I understand, serial communication is relatively slow. By slow, I mean that the fastest common rate of transmission of data is 115.2 kBaud.

However, also from what I understand there are fast ways of transferring data serially. I know that some serial configurations through Firewire or Ethernet can transfer data at speeds that are orders of magnitude higher than 115.2 kBaud. These data streams are able to be read on simple computers that you can buy from Staples. I don't know how these systems receive data at such a high speed if common baud rates are so low.

I know something is wrong with my understanding of it all. I am new to electrical engineering and I am trying to teach myself some basic ideas for my research project - with much frustration. I know that I need to have a system that can receive a pulse train at a minimum speed of 10MHz (hopefully up to 500MHz). I will then program it to process this data. The system that I currently have to receive the data is an Arduino certified product:

http://store.arduino.cc/product/E000052

Programming in the Arduino language is not a problem, I already know how to do this. I just want to understand what I can do to receive this data stream. Do I need something faster than this? Or will this suffice? I'm more interested in the theory than the device; it is more valuable for me to bolster my education than for me to solve my problem (though it needs to be solved).

7

Basically there are two kinds of serial: Asynchronous and Synchronous.

With asynchronous, which is what serial as in UART and RS-232 are, it's all down to how accurate a system's clock is. Both ends of the line have to agree on the same speed (baud rate) and any deviation from that causes transmission errors. The more accurately the two ends can agree on their baud rates the faster you can transfer data.

Note that on many systems (Arduino included) when you ask for one baud rate you actually get a slightly different baud rate. That's due to the way that the internal UART hardware works - it divides the system clock into finer and finer bits to get as close to the requested baud rate as possible. Lower baud rates are easer to get close to, but higher ones are much harder. So it's "safer" to use a lower baud rate which gives more reliable communication to a greater variety of devices.

The other kind of serial, synchronous, uses an extra wire for the transmitting (or master) end of the connection to send the clock to the receiving (slave) end. The receiver uses the incoming clock to know precisely when it should look at the data line to receive a bit of data. This is how things like SPI and I²C work, and very high baud rates can be achieved. Speeds in the tens of megahertz are common.

Some synchronous systems (such as Ethernet), instead of providing the clock as a discrete wire, encode the clock into the data stream. This keeps the number of wires to a minimum yet allows high speed data transfer. The down side is that this usually means the maximum speed you can run at is actually slightly lower since the effective size of the data being transmitted is increased.

4

The other answers have really good info in them, but I'd still like to expound a bit on the different types of serial protocols, and how they vary in speed. I'll also mention a few devices and show some comparisons. For synchronous vs asynchronous and what that means, see Majenko's really good answer.

Clarification:

Your phrasing of "receive a pulse train at a minimum speed of 10MHz" is quite confusing to me. Perhaps this is because when I hear "pulse train" I think you mean you want to read pulse widths in order to obtain data, ie: like the PPM pulse train used in Radio Control communication signals.

Is what you mean simply that you want 10Mbps (megabit per second) transmission rates? If so, the Arduino Intel Galileo can do SPI serial communication at a rate of up to 25MHz, or you can do Ethernet communication with this board up to 10 MHz or 100 MHz (see previous link as well). Note that some Ethernet devices can communicate up to 1000 MHz (like the Orange Pi Plus), but the Intel Galileo only goes up to 100 MHz, according to the link above.

USB3.1 serial communication, if a device supports it, however, can be done up to 10Gbps.

Standard RS-232 0-5V (TTL) Serial, and example:

Now, as for standard RS-232-type serial done with TTL logic levels (ie: signal voltage levels 0 to 5V), via a UART (piece of hardware that allows this type of asynchronous communication protocol), I have written C++ code on a PC and on a standard Arduino (ex: Nano, Uno, or Pro Mini--under $10 cost + $2 external UART) which communicates at 250kbaud (though 2Mbaud is possible on an Arduino Uno--see Connor Wolf's answer here).

When communicating via a serial UART type device, plugged into a PC via a USB plug, a Windows-based computer sees it as a "COM" port. The UART simply does USB to RS-232 TTL data conversion, so I can use this COM port as a serial port on the PC. Since pretty much every Arduino supports standard Serial communication, even the cheapest ones, this is very appealing to me to learn how to write C++ code to do this. I spent the last couple weeks working on my communication code.

At a serial communication speed of 250kbaud (250kbps in my case) I am able to transfer 25-byte binary data packets from my PC to my sub-$10 Arduino at a rate of up to 1000 packets/sec, while doing error checking on the Arduino receiving the data. In my case, each packet contains 8 commands, plus error checking bytes and a couple other things, to control an RC vehicle.


Here's a few key serial protocols, and their associated speeds, to be aware of.

All of these are different types of serial communication protocols:

  1. I2C:

    Normal Arduino (ex: Uno) default speed is 100kbps; it can be increased to 400kbps. Some non-Arduino devices can do 1Mbps or 3.4Mbps.

  2. SPI:

    Arduino default speed is 4Mbps. Normal Arduinos can go up to 8Mbps; Galileo can do 25Mbps. I have seen some devices (ex: Wiznet W5200 Ethernet chip), which can do SPI serial communication up to 80Mbps (source).

  3. RS-232 TTL via UART:

    This is what most people mean I think when they just use the word "serial" without specifying it further by saying "SPI," "I2C," etc. Whenever you see the term "baud" or "baudrate," this is the type of serial communication they are referring to too. Hardware (UART)-based serial communication is done via pins 0 and 1 on most Arduinos. Normally, the "high-end" speed is considered 115200bps, but I regularly use 250kbps on an Arduino. Up to 2 Mbps is theoretically possible under the right conditions for the Atmel AVR-based Arduinos, like the Uno. See Connor Wolf's answer here. Arduino also includes a software serial library for this type of serial communication on any of the Arduino's pins, and I have used it up to 250kbps. I haven't yet tested it beyond that speed, but being software-based, I'd expect it to become unreliable much beyond that.

  4. USB:

    USB Speeds (https://en.wikipedia.org/wiki/USB)
    USB 1.0: Low Speed mode (1.5Mbps), Full Speed mode (12Mbps)
    USB 2.0: High Speed (480Mbps)
    USB 3.0: SuperSpeed (5Gbps)
    USB 3.1: SuperSpeed+ (10Gbps)

  5. Ethernet:

    Standard rates are 10/100/1000 Mbps.


Conclusions:

  • If you must have a minimum of 10MHz (AKA mbps) communication rates, you can use the SPI, USB, or Ethernet protocols. I2C and RS-232 TTL serial are too slow.
  • If you really want the ~500MHz communication rate, you can use USB 2.0 or higher, or Ethernet 1000Mbps. All the rest are too slow.

Note that embedded boards and devices, microcontrollers, etc, can all do some type of serial communication, even if it's just slow bit-banged RS-232 TTL-type or SPI-type serial. Nevertheless, some high-end devices can do really high speed serial communication via USB, USB 3.0, high-speed Ethernet, high-speed SPI, etc. When it comes to really fast serial communication methods (~3Mbps and higher), synchronous techniques must generally be used rather than asynchronous techniques, as the errors in clock-rates caused by using separate clocks begin to be too pronounced.

You just need to look at your actual needs. For most of my needs, 250kbaud is plenty fast using the built-in UART inside every cheapo low-end AVR-based Arduino device. Your needs, however may be different.

1

Different serial communications protocols use different signal modulation methods to encode data; if you want to roll your own wire protocol, you'll want to learn about those.

Back in the day, low-rate UART serial systems were mostly used with modems that had to transmit long distances over voice telephone circuits. Those circuits were bandwidth-limited to the needs of voice communication, and were frequently "noisy", so phone line modems never evolved beyond 56Kbit/s rates. The UARTs themselves could go faster, so if you were doing a local serial connection you could get up to 115kbps. These UARTs were relatively cheap.

More advanced encoding schemes plus more expensive hardware (with a lower noise floor) allowed connections about 100 times faster -- 10mbps ethernet. That's a much more common standard now than RS-232 serial connections, and as it became widely adopted it got cheap, and so 100mbps and gigabit ethernets followed the same form factor and basic electrical characteristics because (under good conditions) all could work over the same wiring, so compatibility with existing systems was good; the endpoints for the most part can automatically downgrade to whatever speed is supported by both ends of a given wire.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.