SeattleWireless
[Blog Home] [Homepage] [Projects] [SeattleWireless] [Email Me] [Resume DOC] [Resume HTML]
Location:

Thu, 15 Apr 2004

Gumstix and I2C
The Gumstix has no I/O. This topic has been ran into the ground a million times. Last tuesday at hacknight, i was let down when I found out that the cool 8 line header on the waysmall daughter board was not a collection of I/O's (GPIO), but actually an I2C bus, NSSP bus, and a battery indicator. But I2C does still give us some functionality, even if its not very fast. There are some pretty cool chips available which would be cool to interface to buttons, servo controllers, etc. without the use of a PIC.

One in particular is the $2 PCF8574 in DIP package (the big one we can use $0.50 radio shack chip sockets with), which gives us 8 I/O lines addressable from I2C, and an interrupt line on state change. If you want 16 bits, check out the PCF8575.

An alernative, the OnSemi JLC1562, will give you 8 bits and a 6 bit DAC, in replacement of the cool interrupt line. The chip also features an analog comparator tied to 5 of the lines, so it could also become a 5 line ADC as well.

A latching relay driver is also available.

Unfortunately, I2C on the gumstix is a pain right now. There is no serial device that i am aware of (ie: /dev/i2c) and I haven't found any neat programs yet that would let me do something like: I2CCmd read [address] [value] or I2CCmd write [address] [value]. Linux does have support for I2C, as most PCs use this to monitor fans, temperature, etc. So perhaps someone could write this some day. I'm heart set at writing some embedded code in perl or python....I really hate C/C++ for this type of thing.

I guess it didn't hurt to look .. apparently 'lm_sensors' supports the 8 and 16 bit versions of the freaking PCF8575! And better yet, its controlable under /proc/sys/dev/sensors/pcf8574-<0>-<1>/ ... this contains more information. I wonder if lm_sensors was compiled with the gumstix kernel?

Cool, but still, where is my i2ccmd read/write program?!?!?

[/pic] permanent link

For past blog entries, check out the archive on the side or click here.


Make some extra cash with your blog too: