I2C hardware routines

Name HI2C.C
Revision V1.0 - December 12th, 2002
Code size 455 bytes with Keil V5.50 compiler
Needed RAM size 17 bytes

 

These routines provides a set to manage the hardware controller included in some 8051 derivative. I've tested it on p89c668 succesfully. It should works on other chips. The code is interrupt driven.

The functions are :

Currently, the code is allowing only Master mode. I'll add later the Slave mode.

 

You can Download the code here (ZIP, 3Kb).

For more details on I2C bus, you can download the Philips I2C specification V2.1 here. (PDF, 280Kb)