2021-06-03 12:22 AM
I am trying to use 2 HTS221 in the same board with I2C. I have SDA pin from both sensors wired to the same pin on my PCB.
When I want to use the first HTS221, I set his CS pin to HIGH and the other HTS221 CS remains LOW. However, when I try to read from any of the sensors, the program locks. The only way I get data from the sensors is when both CS pin are set to HIGH, but I am unable to know from which sensor I am getting the values.
I think the problem could be that when one of the sensors CS is HIGH is using the i2C interface while the other is using the SPI interface and causing the problems.
Thank you.
2021-06-03 02:14 AM
Correct.
Because the HTS221 only has one address pair 0xBE and 0xBF at which it can be reached, you need either two independent I2C channels or an I2C hub or I2C bus switch.
Regards
/Peter