I used NRF52832 TWI master to drive BMA223 sensor,
a. gs.c/gs.h are the driver codes
b. the i2c wave is looks right, but there still not generates a NRF_DRV_TWI_EVT_DONE event
c. so sinks into while(!this_done)
Who can help me? Thanks!
I used NRF52832 TWI master to drive BMA223 sensor,
a. gs.c/gs.h are the driver codes
b. the i2c wave is looks right, but there still not generates a NRF_DRV_TWI_EVT_DONE event
c. so sinks into while(!this_done)
Who can help me? Thanks!
You should check the return values from your calls to nrf_drv_twi_* functions. I would also recommend you to check the return values using APP_ERROR_CHECK(), and follow this debugging method to see if any errors are reported. Have you tried setting a breakpoint in the event handler, to see if it is called at all? Are you using softdevice in your application, and have initialized this before calling sd_app_evt_wait()
? In your call to nrf_drv_twi_tx()
you have set the no_stop
parameter to false, but the datasheet seems to not expect a stop condition between tx and rx in a read operation. Have you tried setting this to true?
You should check the return values from your calls to nrf_drv_twi_* functions. I would also recommend you to check the return values using APP_ERROR_CHECK(), and follow this debugging method to see if any errors are reported. Have you tried setting a breakpoint in the event handler, to see if it is called at all? Are you using softdevice in your application, and have initialized this before calling sd_app_evt_wait()
? In your call to nrf_drv_twi_tx()
you have set the no_stop
parameter to false, but the datasheet seems to not expect a stop condition between tx and rx in a read operation. Have you tried setting this to true?