I2C Slavery

*Blah*

Pulling “all night” (and well into the morning) programming sessions ain’t as easy on the body as it was back in my college days.

But, with approximately 16 hours coding time, I have mastered the ‘art’ of i2c slavery on the picmicro.

I2C stands for inter-ic communications. It is something Philips cooked up mainly to allow microprocessors to communicate with other devices on the board, as sort of a back-channel communication

Most desktop computers use I2C to read information about the system memory and monitor the health of system components (temps, voltages, etc).

My objective is to use I2C to allow data collection from a large bi-directional led sensor array. I plan to have several PIC microcontrollers each controlling a line in an array of leds and then use another PIC as an I2C master to coordinate scanning of the array and interface with a host PC. Most compilers support I2C master communications ‘out of the box’ for things like talking to serial eeproms and real-time clocks. However, no compilers that I know of offer any support for I2C slave-side communications. I think this is because very few picmicro actually have the proper hardware to implement the i2c slave role (which is very timing sensitive), and there are other methods (which may have been easier) such as RS485. I also think that the majority of picmicro compilers are used by hobbyists, and hobbyists have little need to network multiple picmicros – usually programming and managing a single pic is enough trouble.

I have the basic interrupt driven i2c slave routines available in heavily commented source code if anyone needs them. I will probably setup a static webpage with some more information, but its lower on the priority list. It is written is in Proton Basic. If anyone wants the code, let me know and I’ll send it your way.

Leave a Reply

Your email address will not be published. Required fields are marked *