Other Parts Discussed in Thread: HDC1080
Dear Josh
This is in addition the my previous post,https://e2e.ti.com/support/sensors/f/1023/t/936000
I am trying to check which HDC device(HDC2080 or HDC1080) the PCB is using. The aim is that once it is known the correct code can be executed in my firmware.
I do not have an analyser therefore i can not send whats happening on my i2c bus.
But at times(maybe after a reset), i have noticed that i am getting -40 degrees and 0% reading, and after a little investigation i found that device id was not getting read correctly , therefore not selecting the appropriate sensor library to execute. When HDC2080 is used, at times it will output 0x07 which i belive is correct, but then it will output 0x00,0x80,0x81. If i was to preform multiple resets i eventually get the correct id, which then progresses to correct results.
This is my code, am i doing something wrong to obtain a id of the device on HDC2080?
uint8_t check_humdidity_temperture_device_type(void) { uint8_t id_device= 0; twiInitialize(TWI); twiAddress(TWI,HUM_ADDR,0); twiWriteSingle(TWI,0xFF); twiAddress(TWI,HUM_ADDR,1); id_device = twiReadSingle(TWI,1); twiReadSingle(TWI,1); twiStop(TWI); return id_device; }
Thanks