i want to use tmp100 temperature sensor with 24F16KA102 in CCS picc by using software i2c.
i am confused about acknowledgment in i2c.
Second how can i convert data in to decimal. i need only decimal .
here is sample code
#use i2c(Master,scl=PIN_b4,sda=PIN_B6,SLOW)
i2c_start();
i2c_write(0x90); // Write to point register
i2c_write(0x01); // Write configuration reg to point register;
i2c_write(conf);
i2c_stop();
tm_setconf(0x60); // value for configuration
i2c_start();
i2c_write(0x90); // Write to point register
i2c_write(0x00); // Write Temp reg to point register;
delay_ms(1);
i2c_start();
i2c_write(0x91);
my_temp = i2c_read();
rec_temp = (int)my_temp;
delay_us(100);
my_temp = i2c_read();
rec_temp = rec_temp << 8;
rec_temp = rec_temp | my_temp;
i2c_stop();