Hardware Reference
In-Depth Information
NOTE Tolearnallaboutserialcommunication,checkoutthistutorial:
www.jeremyblum.com/2011/02/07/arduino-tutorial-6-serial-
communication-and-processing/ .Youcanalsofindthistutorialonthe
Wileywebsiteshownatthebeginningofthischapter.
To begin, you need to understand the differences between serial and USB.
Depending on how old you are, you might not even remember serial (or techni-
cally, RS-232) ports, because they have been primarily replaced by USB. Figure 6-1
shows what a standard serial port looks like.
Figure 6-1: Serial port
The original Arduino boards came equipped with a serial port that you con-
nected to your computer with a 9-pin serial cable. Nowadays, few computers still
have these ports, although you can use adapters to make DB-9 (the type of 9-pin
connector) serial ports from USB ports. Microcontrollers like the ATMega328P
that you find on the Arduino Uno have one hardware serial port. It includes a
transmit (TX) and receive (RX) pin that can be accessed on digital pins 0 and
1. As explained in the sidebar in Chapter 1, “Getting Up and Blinking with the
Arduino,” the Arduino is equipped with a bootloader that allows you to pro-
gram it over this serial interface. To facilitate this, those pins are “multiplexed”
(meaning that they are connected to more than one function); they connect,
indirectly, to the transmit and receive lines of your USB cable. However, serial
and USB are not directly compatible, so one of two methods is used to bridge
Search WWH ::




Custom Search