Hello,
I notice that the sample code requires floating point operations, specifically in the calc_sth11 and calc_dewpoint functions. I would suspect that the HC908QB8 may not have sufficient capacity for the floating point library, if you need to do these calculations.
Regards,
Mac
Hello ppcco,
It appears that the data transfer arrangements for the SHT75 device are neither compatible with I2C nor SPI. This means you will need to 'bit bang' the transfer routine using two of the GPIO pins, using one pin for the clock output, and the other for data I/O.
For the data output mode (sending the command bits) the high logic state of the data line must be non-driven, and an external pull-up resistor used (10k). The internal pull-up alone may not be sufficient, depending on the clock speed. A method of achieving the required output characteristic is to set the output latch for the data pin continuously low, and control the output state using the data direction bit. This bit would be set for logic low, and cleared for logic high. The bit would also be cleared when receiving data from the device.
To write the code, you will need to refer to the waveforms shown in the data sheet for the sending of the command and reading the returned data. I will leave this as an exercise for you to attempt. I might suggest that you will need a function to initialise the GPIO used, and another function for the transmission start sequence and the sending of the command bits. Further functions would be required to read the humidity/temperature data, and possibly to read and write the status register, if required. The CRC data attached to the humidity/temperature data can probably be ignored.
Regards,
Mac