This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

TWI in nRF52810 QCAA doesn't work.

Hello, I meet some problem. The chip I used is nRF52810 QCAA, the softdevice I used is s112, I defined P0.09 as SCL and P0.06 as SDA, the TWI can't work and it stops in while(m_xfer_done==false){}.
However when I programed the same code into nRF52810 QFAA(only SCL changed into P0.18 and SDA changed into P0.14), the TWI work normally and can get data from mpu6050.
What's more, the button_0 event in nRF52810 QCAA doesn't work, although I have defined the touch, release and long push event. But when I changed the same I/O pin into button_1, button_2 or button_3 event, it works normally. All buttons are defined in same way. And when I programed the same code into nRF52810 QFAA, button_0 event can work normally.
All problem look like the code is suit for nRF52810 QFAA but not nRF52810 QCAA. What should I do, hoping for your help.
Some of the definition code is below
const nrf_drv_twi_config_t twi_config = {
.scl = 9,
.sda = 6,
.frequency = NRF_DRV_TWI_FREQ_100K,
.interrupt_priority = APP_IRQ_PRIORITY_HIGH,
.clear_bus_init = false
};
ret_code_t err_code;
uint8_t tx_buf[MPU6050_ADDRESS_LEN+1];
tx_buf[0]=register_address;
tx_buf[1]=value;
m_xfer_done=false;
err_code=nrf_drv_twi_tx(&m_twi,MPU6050_ADDRESS,tx_buf,MPU6050_ADDRESS_LEN+1,false);
while(m_xfer_done==false){}
if(NRF_SUCCESS!=err_code)
{
return false;
}
return true;
}
#ifdef BSP_BUTTON_0
{BSP_BUTTON_0, true, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_0
#ifdef BSP_BUTTON_1
{BSP_BUTTON_1, true, BUTTON_PULL, bsp_button_event_handler},
#endif // BUTTON_1
#ifdef BSP_BUTTON_2
{BSP_BUTTON_2, true, BUTTON_PULL, bsp_button_event_handler},
#define BUTTON_START 20
#define BUTTON_1 20
#define BUTTON_2 21
#define BUTTON_3 25
#define BUTTON_4 28
#define BUTTON_STOP 28
#define BUTTON_PULL NRF_GPIO_PIN_PULLDOWN
APP_TIMER_V2 APP_TIMER_V2_RTC1_ENABLED BLE_STACK_SUPPORT_REQD BOARD_PCA10040 CONFIG_GPIO_AS_PINRESET FLOAT_ABI_SOFT NRF52810_XXAA NRF52_PAN_74 NRF_SD_BLE_API_VERSION=7 S112 SOFTDEVICE_PRESENT __HEAP_SIZE=2048 __STACK_SIZE=2048

Related