Author |
Message |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 9:05 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
I think what was peculiar, was the decision when designing I2C, to put the
R/W bit at the bottom of the address field. It could have been put at the
top just as easily, and if so the addresses wou ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:59 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
One other critical thing. He needs to turn off slew rate control on the
I2C pins. By default this will be on. Needs:
set_slow_slew_C(FALSE);
To disable this on this port.
Thanks a lot, disab ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:43 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
hmm... 'found all addresses' sounds like no I2C pullup resistors, or the wrong value.
With a 3 volt PIC, the pullups should probably be 3K3 or 2K7, though that depends on speed of the interface, d ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:42 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
and....
running I2CSCANNER will SHOW you the address of the device when it finds it.
7 bit addressing has always struck me as odd (no pun), as you must either read or write to the device using 8 ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:41 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
Agree wholeheartedly with Jay on testing with the I2C_scanner.
However the big 'critical' one has already been pointed out by PCM. The
device has a 7bit I2C address of 0x44, so for a PIC 8bit I2C a ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:36 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
Your code has several mistakes. You need to do it like this:
#define SHT40_BASE_ADDR 0x88
#define SHT4X_CMD_MEASURE_HPM 0xFD
//================================
void main(void)
... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Mar 07, 2023 8:13 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
low level hardware comments...
'SHT40'....is a 3 volt device. I see 'LF',so the PIC IS a 3 volt ?
Assuming it's on a 'module', can you confirm, using the I2C scanner program in the code library, ... |
Topic: SHT40-AD1B temperature and Humidity sensor issue |
andrew007
Replies: 17
Views: 45260
|
Forum: General CCS C Discussion Posted: Tue Feb 28, 2023 4:53 am Subject: SHT40-AD1B temperature and Humidity sensor issue |
hi,
Passing from HTS221 to SHT40 seems there is a problem in reading the sensor.
I've used the standard C reference instructions i2c_transfer_in e i2c_transfer_out but the sensor don't answer. I've ... |
|