Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Description Performs repeated start condition.
Example
I2C_Repeated_Start
5.2.8.4 I2C_Rd – Receives byte from slave
Prototype
sub function I2C_Rd(dim Ack as byte) as byte
Description Receives 1 byte from slave and sends not acknowledge signal if <Ack> is 0; otherwise, it sends acknowledge.
Example
Data = I2C_Rd(1) ' read data w/ acknowledge
5.2.8.5 I2C_Wr – Sends data byte via I2C bus
Prototype
sub function I2C_Wr(dim Data as byte) as byte
Description After you have issued a start or repeated start you can send <Data> byte via I2C bus. The function returns 0 if
there are no errors.
Example
I2C_Wr($A2) ' send byte via I2C(command to 24cO2)
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (57 sur 112)05/11/2004 02:20:52