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

nrf_drv_twi_tx twi softdevice s110 problem

hi~ i am working with nrf 51822 with custom board and softdevice s110. i am using is7020-a20 temperature / humidity sensor via twi (i2c)

i tried 2 versions of twi example in sdk ver.10 using nrf_drv_twi and app_twi. twi_init() looks working fine on both.

address of pin scl is 15 and sda is 16 and address of sensor is (0x80 >> 1). i checked it several times.

when i execute nrf_drv_twi_tx() or nrf_drv_twi_rx(), device stops and doesn't work neither app_twi_perform().

i know that app_twi_xxx functions uses nrf_drv_twi_xxx functions.

i read some questions about twi communication with softdevice s110. so i tried to assign ppi channel to twi and it didn't work too.

please check my code and tell me what is wrong with my code

i commented out what i've tried before, so check the commented code too. thanx. main.c

Parents
  • Hi.

    • Have you tried to communicate with your device without the SoftDevice running?
    • Are you sure the address is correct and that you are supposed to right shift it?
    • Have you checked for errors returned from the TWI drivers? You can check p_event->type for NRF_DRV_TWI_ERROR as well as NRF_DRV_TWI_RX_DONE and NRF_DRV_TWI_TX_DONE. If you don't use a TWI handler then the TWI drivers will operate in blocking mode meaning that your code will get stuck if you try to transmit something on the TWI bus and something goes wrong.
    • Here is a simple example for debugging a TWI application.
Reply
  • Hi.

    • Have you tried to communicate with your device without the SoftDevice running?
    • Are you sure the address is correct and that you are supposed to right shift it?
    • Have you checked for errors returned from the TWI drivers? You can check p_event->type for NRF_DRV_TWI_ERROR as well as NRF_DRV_TWI_RX_DONE and NRF_DRV_TWI_TX_DONE. If you don't use a TWI handler then the TWI drivers will operate in blocking mode meaning that your code will get stuck if you try to transmit something on the TWI bus and something goes wrong.
    • Here is a simple example for debugging a TWI application.
Children
No Data
Related