Hardware Reference
In-Depth Information
some systems, RS-232 low-capacitance cables can be 1,000 feet long, although
most cables limit the distance to 50 feet.
Arduinos use serial ports for communicating with computers and other
devices. The USB port of an Arduino is used for serial communication with a
computer, with the added advantage that USB can also be used to power the
device. USB also has the advantage of auto-coni guring most of the parameters.
Some Arduinos have other hardware serial ports, enabling communication
with up to four other devices. The USB communication is sent to Arduino pins
0 and 1, meaning that those pins are reserved if your device must communicate
with a computer.
UART Communications
A Universal Asynchronous Receiver/Transmitter (UART) is a piece of hardware
that translates from serial and parallel forms. This is what is used to commu-
nicate on a serial interface. Data is sent to the UART device in parallel format,
for example, a byte. The UART takes the byte and sends the data 1 bit at a time,
adding any required information and line handling. On the receiving end,
another UART device decodes the data and returns it to parallel form.
The native UART controller on all Arduinos has a buffer of 64 bytes, mean-
ing the Arduino can receive up to 64 characters while busy with other tasks.
For UARTs to communicate, they must be coni gured in the same way. This
information consists of the following:
Baud rate
Data bits
Parity
Stop bits
Baud Rate
Originally, the baud rate was the amount of times that a signal could be changed
per second. Now, it commonly refers to the speed at which information can be
transmitted. If you want to send a logical one several times in a row, you do
not need to change the signal. The receiving device looks at the input line once
every few microseconds or nanoseconds and samples the level. If your sender
transmits a series of 1s every millisecond, the receiving device looks at the input
line every millisecond. The receiver reads the value and then waits for a mil-
lisecond before the next reading. During this time, the sending device has the
time to change the logical level (if needed) before the receiver re-samples the data.
It is important that both devices share the same baud rate. If one device
is sending faster or slower than another device, the communications will be
 
Search WWH ::




Custom Search