by Jon Williams
Putting the Spotlight on BASIC Stamp Projects, Hints, and Tips
Expansion Made Easy
Interfacing the MCP23016
One of the great things about my job — aside from
the fact that I get to work with BASIC Stamps all
day long (and get paid for it!) — is the customer
contact I am able to have. Almost all of my contacts are
very friendly and find what I get to do here with Nuts &
Volts useful — sometimes even a bit entertaining. Often, I
get messages that are cries for help and I always enjoy
helping, when I can. From time to time, a customer will
alert me to a part that I hadn’t previously worked with.
That’s always an adventure and sometimes those
adventures result in finding a real gem.
Case in point: A couple of months ago, I got a note
from a customer who was trying to connect his BS2p to a
new part from Microchip called the MCP23016. As the
part wasn’t yet in production, he sent me one of his
samples and it turned out that he had made a simple
coding error. I was able to get the BS2p to control the
MCP23016 without breaking a sweat.
Let me just say that this part rocks! Oh ... I’ll bet by
now that you’re wondering what it is. The MCP23016 is a
16-bit (two ports) I/O expander; you can think of it as a
much better version of the PCF8574. Why is it better?
Well, for one thing, there’s none of that quasi-bidirectional
silliness of the PCF8574 (which is a full-on pain in
the backside); its ports behave like those on a
microcontroller — each having a DDR (data direction
register) to specify what an output port does and (this is
the best part) it can sink and source 25 mA per pin.
Honestly, the MCP23016 makes the PCF8574 look like a
Not long after I had worked with the MCP23016,
another customer contacted me about creating an LCD
interface with the PCF8574. I gave him some guidance,
Figure 1. MCP23016 LCD Terminal Schematic.
NUTS & VOLTS