CCS M I2C 16f648A & 16F877A

Started by Harrie Geerts November 24, 2004


I'm using CCS M compiler.
I want an interface I2C between a master 16f648A and a slave
hardware I2C 16F877A.
I'm succeeded in sending commands from the 648A to the 877A.
But I can't transmit data from the 877A to 648A.

Does anybody have an example.

16F648A master code
i2c_start();
i2c_write(0xF0);
i2c_write(0x01);
i2c_write(170);
i2c_stop();
i2c_start();
i2c_write(0xF1);
i2c_write(0x01);
//Here it keeps waiting
read_in = i2c_read();
i2c_stop();