joseMiguel
Member level 5
- Joined
- Jan 10, 2011
- Messages
- 86
- Helped
- 10
- Reputation
- 20
- Reaction score
- 10
- Trophy points
- 1,288
- Location
- Montpellier FRANCE
- Activity points
- 1,967
Hi, i just have SW problems to run the TC74 with the I2C libraries.
thank you
JoseMiguel
Code:
void main()
{
int i;
TRISB=0x0;
OpenI2C(MASTER, SLEW_ON);// Initialize I2C module
init_LCD();
SSPADD = 9; //400kHz Baud clock(9) @16MHz
//100kHz Baud clock(39) @16MHz
// generates a start condition
while(1)
{
Delay1KTCYx(10);
StartI2C(); // initiate START condition
WriteI2C( 0x9A );
WriteI2C( 0x00 );
//StopI2C();
StartI2C(); // initiate START condition
WriteI2C( 0x9B );
data = ReadI2C();
//NotAckI2C();
StopI2C();
fahr = (9*(long)data);
fahr = fahr/5;
fahr = fahr +32;
for(i=0; i<10; i++)
Delay10KTCYx(100);
//floatToStr(fahr);
//chaintxt(str,0);
}
}
thank you
JoseMiguel