Hardware Reference
In-Depth Information
and breakout boards. Anything that you want to place is present there. The
Inspector panel is used to change component characteristics; you can change
the value of components, for example, change the resistance of a resistor.
Your First Shield
Throughout this topic, you have used libraries and shields created by other
people. Now you are ready to take that a step further and create your own
shield! This chapter describes the steps necessary to design and create your
own shield. To use that shield, you need to create a software library, which is
discussed in the next chapter.
So, what kind of shield can be made? It would be easier to ask what kind
of shield cannot be made; there are so many different shield designs that it is
impossible to list them all. For this chapter, you create an I/O shield, increasing
the capacity of the Arduino by another 16 pins. Why would you want to create
more I/O? Doesn't the Arduino have enough I/O? I've seen projects where the
makers would clearly say that no, even the Arduino Mega 2560 does not have
enough input and output, and more is always welcome. It would be even better
if the shield could use the I 2 C protocol, therefore using up few pins.
There are many I 2 C-compatible components on the market. The component
that you use for this project is the PCF8574AP. This component is an 8-bit I/O
expander, capable of adding eight input and output pins to an I 2 C bus. The
Arduino already has a built-in I 2 C bus, so no other components are required.
The i rst thing to do when using a new component is to download the data-
sheet. This device is created by NXP, and their website contains a link to data-
sheets. This specii c datasheet is available at http://www.nxp.com/documents/
data_sheet/PCF8574_PCF8574A.pdf . Here is an extract from that datasheet.
The devices consist of eight quasi-bidirectional ports, 100 kHz I 2 C-bus interface,
three hardware address inputs, and interrupt output operating between 2.5 V and
6 V. The quasi-bidirectional port can be independently assigned as an input to
monitor interrupt status or keypads, or as an output to activate indicator devices
such as LEDs. System master can read from the input port or write to the output
port through a single register.
A single paragraph tells you a lot about the component. First is the I 2 C speed,
100 kHz, something that the Arduino can use. The I 2 C has three address inputs,
meaning that 3 bits of the address can be set, allowing several components
to be used at the same time, or simply to coni gure the address on a heavily
populated I 2 C bus.
 
Search WWH ::




Custom Search