I have two sensor: Si7021 and CCS811 connect to board (nRF51 DK). Si7021 work fine. CCS811 always return NRF_DRV_TWI_EVT_ADDRESS_NACK error. Anyone can give me a help?
I have two sensor: Si7021 and CCS811 connect to board (nRF51 DK). Si7021 work fine. CCS811 always return NRF_DRV_TWI_EVT_ADDRESS_NACK error. Anyone can give me a help?
So the CCS811 is either not (properly) connected to this bus, or is sending a NACK (Negative Acknowledge) when you try to communicate with it.
What debugging have you done to find the source of this problem?
Are you sure that you are sending the correct Slave Address?
I used eclipse and Jlink to debug. I got Slave Address in data sheet, 0x5A or 0x5B.
So are you using the correct one of those two?
Be careful that an I2C Slave Address is just 7 bits, but some people quote it as a byte - including the R/W bit ...
See www.avrfreaks.net/.../1872781 - starting from "The discrepancy between talking of I2C addresses as 7 or 8 bits is very common..."
I tested with (0x5A << 1), (0x5B << 1), 0x5A, 0x5B, (0x5A >> 1) and It's still error.
The fact that those addresses differ by 1 suggests that they include the R/W bit ... ?