Topic: GPIO's on CHUMBY One

Hi:

I am planning on buying the new chumby one and install it inside the wall of my my house to use like a touch screen based control panel. I am hoping to use chumby to interface with my alarm system and then use its ability as a webserver to host the status of my alarm system. I am also planning to use to drive some signals out (GPIO).

Has anyone used the GPIO's on chumby?
Are there any GPIO's available? . If yes, how are they programmed?

I guess even a uart interface will do because there are uart to GPIO bridge chips available.

Help !

-Raj

Re: GPIO's on CHUMBY One

As a very unsupported feature, I believe there are a few GPIO pins available on what used to be the NAND flash chip, but is now just an unpopulated pad.  I count around 14 pins on that.  You might be able to find some other unused pins, there are a couple of others.  I believe you could even turn the UART pins into GPIO pins as well, and depending on what other devices you needed, you could turn other outputs into GPIO as well.

The absolute easiest way to manipulate GPIO pins (or anything else on the CPU) is to use a program called regutil, which is just a glorified PEEK and POKE.  You'll want a copy of the Applications Processor Reference Manual (which you can get from http://www.freescale.com/webapp/sps/sit … de=i.MX233 ).  Figure out which pin you're looking to manipulate, then use regutil to (1) Turn that pin into a GPIO, (2) Set the pin for input or output, then (3) read or write that bit.  There are a couple of scripts where I do just that, particularly backlight_full.sh or enable_usb.sh.

Another option is to just pick up a Phidgets board.  I've never used one before, but I enabled that kernel module because I thought someone else might find a use for it.

Re: GPIO's on CHUMBY One

Chumbylurker:

Thanks a bunch!!
I am assuming that regutil comes as part of the linux OS and i need to ssh into chumby to use it, right?

also, you talked about two shell scripts where you use the GPIO's. where can i get those shell scripts?

Thanks!!

Re: GPIO's on CHUMBY One

Also, is there an I2C port on chumby one that can be used?
if yes, are there any built in i2c commands in the linux chain that be used?

Re: GPIO's on CHUMBY One

The shell scripts are located in /usr/chumby/scripts/.

There is an i2c bus, and you can access it from Linux.  I think bunnie may be doing a writeup of this, but I think you'll either need to add a couple of resistors to I think R900 and R901, or just short them out.  Then you can access I2C clock and data lines on the header for the chumbilical.  I did that when I was writing the accelerometer, FM radio, and a few other i2c drivers.

To actually use i2c, open /dev/i2c-0, and either read() and write() from/to it, or (and this is a better option) use ioctls to communicate with the Linux i2c system.  The accelerometer driver we'll be posting soon is probably the easiest example to follow.

Re: GPIO's on CHUMBY One

Thanks again!

Is there any ref info on how to use the i2c controls ? (read/write) and the ioctl?
do i need to write a 'C' program or are these built in commands that be used with shell scripts.

FYI, i hope this is valid for the chumby one because that is the unit i am buying.

Re: GPIO's on CHUMBY One

You might be able to get away with using a perl script, but a C program would be the easiest thing to use.  I've got I2C_Read and I2C_Write functions in acceld_i2c.c you could probably steal verbatim.

What are you trying to communicate with?

Yes, this is valid for the chumby One.

Re: GPIO's on CHUMBY One

Great!

where can i find this c program "acceld_i2c.c" Is it part of the chumby OS?

I am planning on adding a i2c port expander and then GPIO's that i can use. i think i'll leave the GPIO's of the imx alone because i dont know what other functions they could be used for.

Re: GPIO's on CHUMBY One

It's part of the acceld program.  The source code can be downloaded from:

http://files.chumby.com/source/