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 :
- Initialization routine : HI2C_Init()
- Send a byte : HI2C_SendI2C (u8Adress,*u8I2CDatas)
- Receive a byte : u8ReceivedData = HI2C_ReceiveI2C (u8Adress)
- I2C slaves detection : HI2C_Scanning ()
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)