Hi !
I'm using the nrf52832 chip and I'm trying to communicate with a LIS2DH12 accelerometer using the I2C protocol.
But unfortunately I can't handle with it, it seems that the accelerometer doesn't respond at his adress...
So first here is my hardware connections :
The pin are connected as follow to the nrf52832 :
SDA - P0.14
SCL - P0.15
As said in the LIS2DH12 datasheet, the SD0 pin is connected to the supply voltage so the I2C address of the accelerometer is 0x19.
Here are the relevant firmware parts :
1) Address of the LIS2DH12
2) twi_handler() and twi_init()
So as you can see, I've just followed the nordic example (twi_sensor).
But when I try to configure the accelerometer with this function :
The program get stuck in the first while loop :
And using a breakpoint, I can see that the twi_handler() is called because an NRF_DRV_TWI_EVT_ADDRESS_NACK event is rised.
So it seems that the lis2dh12 does not respond...
I tried to "scan" every adresses from 1 to 126 and for each I receive the same event : NRF_DRV_TWI_EVT_ADDRESS_NACK
Is there a configuration that I forgot ? Maybe the SDA and SCL pins needs to an internal pull-up ?
I don't understand, so if someone could help me, it would be great !
Thank you !!
Olivier