5.b. TTL Serial
The Maestro’s serial receive line, RX, can receive bytes when connected to a logic-level (0 to 4.0–5 V, or “TTL”), non-inverted serial signal. The bytes sent to the Maestro on RX can be commands to the Maestro or an arbitrary stream of data that the Maestro passes on to a computer via the USB port, depending on which serial mode the Maestro is in (Section 5.a). The voltage on the RX pin should not go below 0 V and should not exceed 5 V.
The Maestro provides logic-level (0 to 5 V) serial output on its serial transmit line, TX. The bytes sent by the Maestro on TX can be responses to commands that request information or an arbitrary stream of data that the Maestro is receiving from a computer via the USB port and passing on, depending on which Serial Mode the Maestro is in. If you aren’t interested in receiving TTL serial bytes from the Maestro, you can leave the TX line disconnected.
The serial interface is asynchronous, meaning that the sender and receiver each independently time the serial bits. Asynchronous TTL serial is available as hardware modules called “UARTs” on many microcontrollers. Asynchronous serial output can also be “bit-banged” by a standard digital output line under software control.
The data format is 8 data bits, one stop bit, with no parity, which is often expressed as 8-N-1. The diagram below depicts a typical asynchronous, non-inverted TTL serial byte:
|Diagram of a non-inverted TTL serial byte.|
A non-inverted TTL serial line has a default (non-active) state of high. A transmitted byte begins with a single low “start bit”, followed by the bits of the byte, least-significant bit (LSB) first. Logical ones are transmitted as high (VCC) and logical zeros are transmitted as low (0 V), which is why this format is referred to as “non-inverted” serial. The byte is terminated by a “stop bit”, which is the line going high for at least one bit time. Because each byte requires a start bit, 8 data bits, and a stop bit, each byte takes 10 bit times to transmit, so the fastest possible data rate in bytes per second is the baud rate divided by ten. At the Maestro’s maximum baud rate of 250,000 bits per second, the maximum realizable data rate, with a start bit coming immediately after the preceding byte’s stop bit, is 25,000 bytes per second.
Whenever connecting devices, remember to wire the grounds together, and ensure that each device is properly powered. Unpowered devices with a TTL serial port can turn on or partially on, drawing power from the serial line, which means that extra care must be taken when turning power off and on to reset the devices.