Sunday, March 23, 2014

I2C-4SW-4LED 9Sept2012

Now that you have your I2C interface working you will need to test it out on something. I have a nice little board for that. The I2C-4SW-4LED board. You can find the documentation here. As the name implies it has 4 switches (actually 2 pin jumper headers to reduce costs) and 4 LEDs on the board, so you can talk to it with I2C and make lights blink. And/or read the switches. The board is made in such a way that you can wire to external switches and LEDs for use on a front panel of what ever device you are building. If you use external LEDs do not install LEDs on the board. Nothing bad will happen. But it may not work the way you want because of differing LED voltages.

With the three Jumpers on the board - JP1, JP2, and JP3, you can set the address of the board so that you could easily have 32 LEDs and 32 switches in a system. Or other parallel ports using the PCA8574 for other things.

Please note that the chip comes in two flavors. The PCA8574 and the PCA8574A. They differ only in their I2C base address. The PCA8574 has a base address of 40h and the PCA8574A has a base address of 70h. This fact tripped us up in initial testing. Don't let it trip you up. And note: either chip can be used on the board. So you could actually have 16 of these boards in a system. If your I2C driver could drive that many.

OSH Park has the boards for sale for $6.00 each.

Update: 28 April 2014 0907z

You can find some test code that exercises the I2C bus and blinks the 4 LEDs on the board at I2C-4SW-4LED LED-Test.txt. It is written in FISH Forth.

Engineering is the art of making what you want from what you can get at a profit.

No comments:

Post a Comment