initialization two TWI and Only one is work

I used nrf52840 board with SDK 17_1_0 

I used segger embedded studio IDE

i want to Implement two VL53L5CX TOF sensor with nrf52840  so i used two TWI,

but when i init two TWI then only one TWI is work which one second initialization,

like  

#define TWI_INSTANCE_ID 0
#define TWI_INSTANCE_ID1 1

/* TWI instance. */
nrf_drv_twi_t m_twi = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID);
nrf_drv_twi_t m_twi1 = NRF_DRV_TWI_INSTANCE(TWI_INSTANCE_ID1);

IW_IIC_Init(&m_twi); 

IW_IIC_Init1(&m_twi1);

then  IW_IIC_Init1 work,

when i init like

IW_IIC_Init1(&m_twi1); 

IW_IIC_Init(&m_twi);

then IW_IIC_Init work both are not work ony one TWI is work,

how both TWI is work?

Parents
  • Hi there,

    I was under the impression only 1 and 2 are available, 0 is used for QSPI?

    look forward to an Answer.

    GL :-) PJ

  • Hi,

    in sdk_config.h two instance available o and 1

    / <e> TWI0_ENABLED - Enable TWI0 instance
    //==========================================================
    #ifndef TWI0_ENABLED
    #define TWI0_ENABLED 1
    #endif
    // <q> TWI0_USE_EASY_DMA - Use EasyDMA (if present)

    #ifndef TWI0_USE_EASY_DMA
    #define TWI0_USE_EASY_DMA 1
    #endif

    // </e>

    // <e> TWI1_ENABLED - Enable TWI1 instance
    //==========================================================
    #ifndef TWI1_ENABLED
    #define TWI1_ENABLED 1
    #endif
    // <q> TWI1_USE_EASY_DMA - Use EasyDMA (if present)

    #ifndef TWI1_USE_EASY_DMA
    #define TWI1_USE_EASY_DMA 1
    #endif

Reply
  • Hi,

    in sdk_config.h two instance available o and 1

    / <e> TWI0_ENABLED - Enable TWI0 instance
    //==========================================================
    #ifndef TWI0_ENABLED
    #define TWI0_ENABLED 1
    #endif
    // <q> TWI0_USE_EASY_DMA - Use EasyDMA (if present)

    #ifndef TWI0_USE_EASY_DMA
    #define TWI0_USE_EASY_DMA 1
    #endif

    // </e>

    // <e> TWI1_ENABLED - Enable TWI1 instance
    //==========================================================
    #ifndef TWI1_ENABLED
    #define TWI1_ENABLED 1
    #endif
    // <q> TWI1_USE_EASY_DMA - Use EasyDMA (if present)

    #ifndef TWI1_USE_EASY_DMA
    #define TWI1_USE_EASY_DMA 1
    #endif

Children
No Data
Related