
52 MAKING THINGS TALK
First, there’s the protocol that the microcontroller speaks,
called TTL serial:
•Physical layer
The Arduino module receives data on digital I/O pin 0,
and sends it out on pin 1.
•Electrical layer
It uses pulses of 5 volts or 0 volts to represent bits.
•Logical layer
A 5-volt signal represents the value 1, and a 0-volt signal
represents the value 0.
•Data layer
Data is sent at 9600 bits per second. Each byte contains
8 bits, preceded by a start bit and followed by a stop bit
(which you never have to bother with).
•Application layer
At the application layer, you sent one byte from the PC to
the Arduino and processed it, and the Arduino sent back
one byte to the PC.
But wait, that’s not all that’s involved. The 5-volt and 0-volt
pulses didn’t go directly to the PC. First they went to a
serial-to-USB chip on the board that communicates using
TTL serial on one side, and USB on the other.
Second, there's USB, the Universal Serial Bus protocol.
It differs from TTL serial in many ways:
•Physical layer
USB sends data on two wires, called Data+ and Data–.
Every USB connector also has a 5-volt power supply line
and a ground line.
Making the Connection: The Lower Layers
You’re already familiar with one example of serial communication, between a microcon-
troller and a personal computer. In Chapter 1, you connected an Arduino module to a
personal computer through the computer’ ...