Gumstix I2C using an MCP23017 for a slave device
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



A command line program for demonstrating how to use the 
Gumstix Overo I2C-3 bus from a userland program. A Microchip 
MCP23017 I/O Expander is used as the slave device which
might be useful in your project.

No attempt is made to explore all of the MCP23017 features.
See the datasheet if you want to know what else you can do 
with these devices. It's easily found on the web. 

There is a diagram that shows how to wire things for this
program, including the logic level conversion you'll need.

The jumpers from the GPIO PortA to PortB pins is just so
you can see that something is happening when the program
toggles I/O. I didn't want to add any more components.
I can't think of a reason why you would ever jumper them 
this way in a real project. 


Logic Level Converter from Sparkfun : p/n BOB-08745, $1.95
I/O Expander from Digi-Key : p/n MCP23017-E/SP-ND, $1.44 


The makefile is intended to be run from a workstation that has
the OE cross-build environment already setup. If you've built
a gumstix image, then you should be good to go. If not, do that

If you have modified your OE TMPDIR then make that change
to OETMP in the make file. It's defined in 
${OVEROTOP}/build/conf/site.conf (which if you didn't know, 
then you probably haven't modified it.) 

Other then that, the Makefile should just work.   

You can use the Makefile as a template for your own gumstix code
if you don't want to use the bitbake/recipe framework.


Copy the mcptest executable and run it. There are no arguments
and no options. It's just a simple how-to demo, it's not meant 
to be useful other then as code to take ideas from. 


Let me know if something doesn't work. I tried to keep it as simple 
as possible. 

Hopefully, it saves you a little time on your first gumstix I2C