Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Gumstix I2C using an MCP23017 for a slave device

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Makefile
Octocat-spinner-32 Makefile-old
Octocat-spinner-32 README
Octocat-spinner-32 main.c
Octocat-spinner-32 mcp23017_regs.h
Octocat-spinner-32 mcp23017_simple_circuit.png
README
OVERVIEW

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. 


PARTS

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 


BUILDING

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
first. 

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.


RUNNING

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. 


FINAL

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 
project. 

Something went wrong with that request. Please try again.