AnsweredAssumed Answered

Unable to Read XYZ data from MMA8652FC

Question asked by saiteja nalamala on Apr 22, 2017

hi sir i am working on NRF52 to get MMA8652FC accelerometer data i am using twi driver to read XYZ data from MMA8652. when i do nrf_drv_tx and nrf_drv_rx operations it is returning NRF_SUCCESS for both operations but i am unable to get read data to buffer here is my code.


#define MMA8652_I2C_ADDR  0X1D

uint8_t err_code;

uint8_t rx_data[6] = {0};

uint8_t tx_data = MMA8652_REG_OUT_X_MSB;

err_code = nrf_drv_twi_tx(&m_twi_mma_8652, MMA8652_I2C_ADDR, &tx_data, sizeof(tx_data), false);

while(m_xfer_done == false);


err_code = nrf_drv_twi_rx(&m_twi_mma_8652, MMA8652_I2C_ADDR, rx_data, sizeof(rx_data));


unable to get data to rx_data buffer