
So connect it to 5V!įinally we have the three hardware address pins 15~17.

Pin 18 is the reset pin, which is normally high – therefore you ground it to reset the IC. Pin 14 is unused, and we won’t be looking at interrupts, so ignore pins 19 and 20. Pin 9 connects to 5V, 10 to GND, 11 isn’t used, 12 is the I2C bus clock line (Arduino Uno/Duemilanove analogue pin 5, Mega pin 21), and 13 is the I2C bus data line (Arduino Uno/Duemailnove analogue pin 4, Mega pin 20).Įxternal pull-up resistors should be used on the I2C bus – in our examples we use 4.7k ohm values. The sixteen I/O ports are separated into two ‘ports’ – A (on the right) and B (on the left.


After reading this you should have the knowledge and confidence to move forward with using a MCP23017.įirst, let’s look at the hardware basics of this IC. The MCP23017 can be quite simple or complex to understand, so the goal of this article is to try and make it as simple as possible. You can order these in through-hole, surface-mount and also mounted on a breakout board. At this point you should also download yourself a copy of data sheet – it will be referred to several times, and very useful for reference and further reading.įurthermore if you are not familiar with Arduino and the I2C bus, please familiarise yourself with the I2C tutorials parts one and two. Here is our subject of the article in DIP form: Plus we think the I2C bus is underappreciated! So let’s get started… However you may have a distance between the Arduino and the end-point of the I/O pins – so with these ICs you can run just four wires instead of a lot more save board space with custom designs, and preserve precious digital I/O pins for other uses.

This 28-pin IC offers sixteen inputs or outputs – and up to eight of the ICs can be used on one I2C bus… offering a maximum of 128 extra I/O ports.Ī few people may be thinking “Why not just get an Arduino Mega2560?” – a good question. In this article we discuss how to use the Microchip MCP23017 16-bit serial expander with I2C serial interface.
