Page 466 - Robot Builder's Bonanza
P. 466

OF INPUTS AND OUTPUTS    435


                   SERIAL COMMUNICATIONS
                   Robot subsystems need a way to talk to one another. This is often done with a serial com-
                   munications interface. With serial communications, data is sent one bit at a time. Sounds slow
                   and tedious, but it’s  really not. The communications link needs just a few wires and can
                   exchange data at speeds easily exceeding tens of thousands of bits per second.
                     The most common types of serial communications include the following:


                                                          2
                     I2C  (inter- integrated circuit): also shown as I C. This is a  two- wire serial network scheme
                       that allows integrated circuits to communicate with one another. With I2C you can
                       install two or more microcontrollers in a robot and have them talk to one another.
                     SPI (serial peripheral interface): This is a popular serial communications standard used
                       by many electronic devices. SPI is most often used to interface with microcontrollers or
                       microprocessor support electronics.
                     Synchronous serial port: This is a generic term for most any serial data link where infor-
                       mation is transmitted one bit at a time, using (at least) two wires. One wire contains the
                       transmitted data, and the other wire contains a clock signal. The term synchronous
                       means the clock serves as a timing reference for the transmitted data. This is different
                       from asynchronous serial communication (discussed next), which does not use a sepa-
                       rate clock signal.
                     UART (universal asynchronous receiver transmitter): UARTs are more common in
                       desktop computers, but they have applications in microcontrollers as well. Asynchro-
                       nous means there’s no separate synchronizing system for the data. Instead, the data
                       itself is embedded with special bits (called start and stop bits) to ensure proper commu-
                       nication.
                     MIDI (Musical Instrument Digital Interface): MIDI is a fairly old standard that is found on
                       most every digital keyboard and electronic music device. While you can use MIDI just for
                       its serial communications protocol, you can also adapt it for robotics. Though it’s
                       beyond the scope of this book, it’s  possible— just as an  example— to control a robot by
                       playing notes on an electronic keyboard.
                     Microwire: This is a serial communications scheme used in National Semiconductor prod-
                       ucts, which is popular for use with the PICMicro line of microcontrollers from Microchip
                       Technologies. It’s similar to SPI. Most  Microwire- compatible components are used for
                       interfacing with microcontrollers.


                   PARALLEL COMMUNICATION

                   Parallel data communication is more straightforward than serial, but it’s not necessarily easier
                   to implement. With parallel data, you combine the values of two or more I/O lines of the
                   computer or microcontroller. With eight I/O lines you can communicate 256 different mes-
                   sages; this is because there are 256 different ways to set the two possible states (0 and 1) of
                   the lines.
                     An example of using parallel communication is displaying text on a  liquid- crystal display
                   (LCD) panel. While you can purchase an LCD panel that connects to your microcontroller via
                   serial data, these are much more expensive. With just six I/O lines you can directly control a
                     run- of- the- mill LCD panel.











 34-chapter-34.indd   435                                                                   4/21/11   11:57 AM
   461   462   463   464   465   466   467   468   469   470   471