Schematics and build info for assembling a Raspberry Pi breakout board with multiple MCP23017 input/output port expanders
Python
Switch branches/tags
Nothing to show
Latest commit a64f110 Jan 1, 2014 @rm-hull Merge pull request #1 from bitdeli-chef/master
Add a Bitdeli Badge to README
Permalink
Failed to load latest commit information.
doc Level shifter circuit May 18, 2013
src Don't hardcode the address Mar 2, 2013
.gitignore Initial commit Feb 16, 2013
README.md Add a Bitdeli badge to README Jan 1, 2014

README.md

mcp23017

Schematics and build info for assembling multiple MCP23017 input/output port expanders with bi-directional level shifters and selectable power source (Internal 3V3, 5V, External 5V), as below.

Level shifter [Attribution unknown]

Further technical details for the MCP23017 expander can be found in the datasheet [PDF].

Schematic

Stripboad Layout

Installation

Edit /etc/modules and add the following entries:

i2c-bcm2708
i2c-dev

and reboot. Alternatively, modprobe them in. Either way, confirm the driver has loaded properly:

$ dmesg | grep i2c
[   18.310467] bcm2708_i2c bcm2708_i2c.0: BSC0 Controller at 0x20205000 (irq 79) (baudrate 100k)
[   18.332292] bcm2708_i2c bcm2708_i2c.1: BSC1 Controller at 0x20804000 (irq 79) (baudrate 100k)
[   18.480593] i2c /dev entries driver

Then add your user to the i2c group:

$ sudo adduser pi i2c

Install some packages:

$ sudo apt-get install i2c-tools python-smbus

Check to see if the chip has registered (revision 2 RPi's should use icbus 1, whereas earlier revisions use 0):

$ i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --    

TODO

  • Expand documentation

  • Example programs

References

Bitdeli Badge