This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HDC2080: How to check the ID or HDC2080 and HDC1080

Part Number: HDC2080
Other Parts Discussed in Thread: HDC1080

Hi

We have a PCB board, that traditionally used the HDC1080, but all our new boards will use the HDC2080.

Is there away to check which device is on the board, so that the correct reading sequence can be applied. I am aware the firmware is slightly different on both devices so it would be good if there is away to confirm the device before applying the correct firmware.

Both device will have the same address. 

  • Dear Dharmesh, 

    for this you could read out Device ID register 0xFF, on HDC2080, you will get 0x07 and with HDC1080, you would get 0x10, if you only clocked out one byte. 

  • Hi Josh

    Thanks

    After reading the 1 clocked bytes, would i need to do a reset or anything? As i believe the ID reg is 2 bytes, as when i am running the id checking function, at certain instances, when i read the temp and humidity of the hdc2080, i get a 0 , 0 . This is my function for your reference,

    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);		
    		twiStop(TWI);	
    		return id_device;
    }

  • Dear Dharmesh - 

    No, you don't have to do any reset after reading a register. When expecting to read out T and %RH values, though - you do have to command the HDC2080 to start a conversion. This is done by writing a 0x01 value to the 0x0F register then waiting the correct amount of time (based on the bit resolution setting of the device) or interrupt (if so set beforehand) before reading out a measurement value. 

    Please see this FAQ on the topic of reading out 0x00 values from the measurement return registers.  https://e2e.ti.com/support/sensors/f/1023/t/878721?tisearch=e2e-sitesearch&keymatch=HDC2080 

     

  • Hi Josh

    When i do not do the check, it seems to be working well, but with the check at times i get false reading. This is my code:

    This is to check the device.

    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);		
    		twiStop(TWI);	
    		return id_device;
    }

    Setup the HDC2080

    void setup_HDC2080(uint8_t add)
    {
    	twiInitialize(TWI);
    	i2c_start_ack = twiAddress(TWI,add,0);
    	twiWriteSingle(TWI,0x0E);
    	twiWriteSingle(TWI,0x00);
    	twiStop(TWI);
    	
    	twiInitialize(TWI);
    	i2c_start_ack = twiAddress(TWI,add,0);
    	twiWriteSingle(TWI,0x0F);
    	twiWriteSingle(TWI,0x00);	
    	twiStop(TWI);				
    }

    Reading samples

    temphumditysensor_t read_humdidity_temperture_HDC2080(uint8_t add)
    {			
    		temphumditysensor_t sensor_output;				
    		twiInitialize(TWI);
    		twiAddress(TWI,add,0);
    		twiWriteSingle(TWI,0x0F);
    		twiWriteSingle(TWI,0x01);
    		twiStop(TWI);
    		
    		for (uint16_t x=0;x<100;x++)
    		{			
    			HAL_Delay(100);	//100 us		
    		}
    		
    			
    		twiInitialize(TWI);
    		twiAddress(TWI,add,0);
    		twiWriteSingle(TWI,0x00);		
    		twiStop(TWI);	
    		
    		//for (uint16_t x=0;x<500;x++)
    		//{			
    			//HAL_Delay(100);	//100 us	
    		//}
    
    		
    		twiInitialize(TWI);
    		twiAddress(TWI,add,1);			
    		sensor_reading[3] = twiReadSingle(TWI,1);
    		sensor_reading[2] = twiReadSingle(TWI,1);	
    		sensor_reading[1] = twiReadSingle(TWI,1);
    		sensor_reading[0] = twiReadSingle(TWI,0);
    		twiStop(TWI);			
    	
    
    
    	    temperture_reading =0;
    		temperture_reading = (sensor_reading[2] <<8) | sensor_reading[3];
    		humdidty_reading = (sensor_reading[0] <<8) | sensor_reading[1];	
    		temp_float= (((float)temperture_reading/65536)*165)-40;
    		humd_float = ((float)humdidty_reading/65536)*100;	
    		sensor_output.temperture=temperture_reading;
    		sensor_output.humidity=humdidty_reading;	
    
    		
    	return 	sensor_output;
    }
    

  • Dear Dharmesh - 

    Please see: https://e2e.ti.com/support/sensors/f/1023/t/878721?tisearch=e2e-sitesearch&keymatch=HDC2080 and then also capture the I2C activity and share it here if possible.