2016-07-29 05:09 PM
Hello,
I am trying to access the HTS221 (TR) Temperature Humidity sensor. Firstly, the driver code of this sensor provided by ST Microelectronics states that the I2C address is 0xBE but I had been trying that address for a while and it did not work. Whereas on pinging the I2C port with different addresses, I understood that the sensor I2C address is 0x5F. So, I am using 0x5F address to access all the registers of the sensor. Secondly, Following are the temperature data that I can getting from the calibration registers: T0_OUT = -258T0_degC = 21CT1_OUT = 2570T1_degC = 35.63T_OUT = 30840 // this value looks too high On conversion, the room temperature comes to be 181C. which is definitely wrong. You mentioned about trimming the values in one of the discussion, please let me know about it. Thirdly, the driver for HTS221 keeps multiplying T0_degC & T1_degC by 10, I dont understand the reason for that. Can you elaborate on that? The datasheet mentions that T0_degC is 8*(10 bit T0_degC), nowhere 10 was mentioned. Please let me know about it. Thanks & Regards, #hts221-hts221tr2016-08-01 02:18 AM
2016-08-03 10:33 AM
Thank you for your reply.
1. I wanted to know if you could take a look at the values of T0_OUT, T1_OUT and T_OUT. I really doubt the value of T_OUT is too high to get a right temperature. It should generally fall between the T0 and T1 values right? 2. The above values are from wire library I2C implementation but if I use your driver to read temperature, my arduino is giving me an error of collectible2.exe. This is the error when usually the included file is not in right path or not included at all. On looking inside the HTS221_Driver.h, I see that it asks the user to include HAL_EnvSensors.h. Can you share those files to get the implementation of HAL_ReadReg and HAL_WriteReg? Please let me know about it. Thanks & Regards,2016-08-04 10:50 AM
Can anybody share the firmware of HTS221 humidity and temperature sensor? The firmware files that I currently have, does not have HAL_ReadReg and HAL_WriteReg Implementation files and I require those two implementations to grab the temperature values.
Thanks,2016-08-05 02:22 AM
Hi,
the code line #include ''HAL_EnvSensors.h'' in HTS221_driver.h is only an example prototype. The user must include the proper own file where HAL_ReadReg and HAL_WriteReg are implementedThis implementation depends on the used hardware, depends on the microcontroller and if it is used I2C bus or SPI bus.
After that the kind of bus has been chosen, it needs to configure the GPIO of micro used as SDA, SCK, CS and so on.Regards
Antonella2016-09-05 06:09 AM
Hi,
Is it possible to have an example of a file (HAL_EnvSensors.h) where HAL_ReadReg and HAL_WriteReg are implemented with an I2C communication ?Thanks a lot,Regards !JL