BS2pe AND I2C TEMP SENSOR TC74
hnilo
Posts: 3
Hello!
I've been trying to use the Microchip TC74 I2C temperature sensor with the·BS2pe with no success.·
This is the first time I'm using I2C and I'm struggling... I'd appreciate if somebody could give me some help.
The SDA and SCLK are pulled up with 4.7K resistors and connected to P8 and P9 respectively.
·
These are the addresses I'm using:
·
RW········ CON·· $9A 'device's default address 1001101b and LSB 0b (write)= 9Ah
RD········ CON·· $9B 'device's default address 1001101b and LSB 1b(read) = 9Bh
·
·
to write, as I understand, it would be:
·
ICOUT SDA,RW,command,[noparse][[/noparse]VALUE] ' where command byte can be: 0h read temperature, or·1h read/write configuration
·
to read I see that needs to be done in two steps, but all that I was able to read was FFh.
·
thanks
I've been trying to use the Microchip TC74 I2C temperature sensor with the·BS2pe with no success.·
This is the first time I'm using I2C and I'm struggling... I'd appreciate if somebody could give me some help.
The SDA and SCLK are pulled up with 4.7K resistors and connected to P8 and P9 respectively.
·
These are the addresses I'm using:
·
RW········ CON·· $9A 'device's default address 1001101b and LSB 0b (write)= 9Ah
RD········ CON·· $9B 'device's default address 1001101b and LSB 1b(read) = 9Bh
·
·
to write, as I understand, it would be:
·
ICOUT SDA,RW,command,[noparse][[/noparse]VALUE] ' where command byte can be: 0h read temperature, or·1h read/write configuration
·
to read I see that needs to be done in two steps, but all that I was able to read was FFh.
·
thanks
pdf
339K
Comments
I2CIN SDA,RD,0,[noparse][[/noparse]value]
where "value" is the byte variable to receive the data.
This doesn't check to see whether the conversion of the temperature value to digital is done yet. It looks like it should take a maximum of 250ms to get a new reading from either power on or the previous reading. You could read the configuration register to see when a new reading is available
Thank you