TC74 i2c driver?
Rforbes
Posts: 281
Hey all,
I thought I had seen an I2C driver for the TC74 temperature sensor in OBEX awhile back but now I don't see it. I'm not completely sure I saw one- my mind has left me behind these days.
Do you know if there is/was a driver written for this sensor? If so, could you please point me to it?
Thanks much!
Robert
I thought I had seen an I2C driver for the TC74 temperature sensor in OBEX awhile back but now I don't see it. I'm not completely sure I saw one- my mind has left me behind these days.
Do you know if there is/was a driver written for this sensor? If so, could you please point me to it?
Thanks much!
Robert
Comments
There are so many types of temperature sensors but really they are all fairly simple to read. In the case of this device I assume that you would use an I2C object and all that is required is a simple I2C read at the device address (1001 101b) as the default register is 0 which is the termperature. You could probably get away with this simple method as the CONFIG register access is probably unnecessary as the data ready bit should be active all the time expect for when it just powers up, but then the Prop's takes a little time to boot anyway.
in Tachyon Forth by way of example I would do it this way:
pub TEMP@ ( -- temp )
I2CSTART $9B I2C! 1 I2C@ I2CSTOP
;
As simple as that!
I never did find an official "TC74" driver but did find a generic I2C driver that works great. Just now got it up and running. Hoping to string a few of them and see how they do. Thanks for the input!