Other Parts Discussed in Thread: Z-STACK, CC2538, OPT3001
Hello,
My HDC2080 sensor is not giving correct temperature values when connected to cc2538 with Z-Stack environment.
The temperature values are fluctuating and not correct either.
Below is my initialization, i have referred the HDC2082 application note snaa312.pdf.
My i2c bus is communicating properly with other sensors. HDC2080 Configured for single Acquisition configuration
#define HDC2080_ADDRESS 0x82 //As my address pin is connected to VDD. uint8 opt_buf_start[2]={0x0E,0x00}; uint8 opt_buf1_start[2]={0x0F,0x00}; void HDC_Init(void){ HalI2CSendMultiple(HDC2080_ADDRESS, opt_buf_start, 2); HalI2CSendMultiple(HDC2080_ADDRESS, opt_buf1_start, 2); } uint8 addr1 = 0x00; uint16 total,degree; uint8 opt_buf[2]={0x0F, 0x01}; uint8 temp_hu[4]; void HDC2080_Testing(void) { /********* HDC SENSOR TESTING ****************/ HalI2CSendMultiple(HDC2080_ADDRESS, opt_buf, 2);
HDC_WaitUs(2000); //2 msec delay as per application sheet HalI2CSend(HDC2080_ADDRESS, &addr1, 1); HalI2CReceiveMultiple(HDC2080_ADDRESS, temp_hu, 4); total =(temp_hu[1] <<8) + temp_hu[0]; degree = ((total)/pow(2,16))*165-40; }
Please correct if my initialization process is wrong or something missing.
Thank you
Regards,
Akshay