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

interrupt based i2c with softdevice

Hello,

I am using SDK 9.0 and softdevice 8.0 and testing on Evaluation board. I referred the i2c example driver suggested by Torbjorn in this link

I wrote a simple driver for eeprom and succeeded without the softdevice. But when I integrate with the softdevice, data is neither writing nor reading from eeprom. I am not getting i2c interrupts.

Can anyone help me procedure for i2c driver with softdevice?

Update: It is working when I commented the sd_nvic_SetPriority(SPI0_TWI0_IRQn, 1); and enabled using NVIC. I am using template application workspace and integrated i2c driver. But now BT is not advertising. The voltage on the board is 3.3V. Can anyone help me regarding drivers with BT stack?

Regards, Sowmya

Parents
  • Is this the correct way to be using the driver in non-blocking mode? Trying to achieve the lowest possible power. The event handler gets called, but it doesn't appear to wake up from WFE or power_manage if running with BLE. Thanks! Brian

     nrf_drv_twi_init(&p_twi_instance, &p_twi_config, twi_event_handler); 
      nrf_drv_twi_enable(&p_twi_instance); // Enable the TWI instance   
    
    while(1) {
    
        nrf_drv_twi_rx(&p_twi_instance, 0x55, dummy_data, 7, false);          
        //power_manage()                                      
        __WFE();   
    }
    
    static void twi_event_handler(nrf_drv_twi_evt_t *p_evt){   
        if(p_evt->type == NRF_DRV_TWI_RX_DONE)
        {
    
          SEGGER_RTT_printf(0, "\n\nDATA: ", dummy_data);
          for(i=0;i<7;i++) SEGGER_RTT_printf(0, "%02x ", dummy_data[i]);
    
        } 
    }
    
Reply
  • Is this the correct way to be using the driver in non-blocking mode? Trying to achieve the lowest possible power. The event handler gets called, but it doesn't appear to wake up from WFE or power_manage if running with BLE. Thanks! Brian

     nrf_drv_twi_init(&p_twi_instance, &p_twi_config, twi_event_handler); 
      nrf_drv_twi_enable(&p_twi_instance); // Enable the TWI instance   
    
    while(1) {
    
        nrf_drv_twi_rx(&p_twi_instance, 0x55, dummy_data, 7, false);          
        //power_manage()                                      
        __WFE();   
    }
    
    static void twi_event_handler(nrf_drv_twi_evt_t *p_evt){   
        if(p_evt->type == NRF_DRV_TWI_RX_DONE)
        {
    
          SEGGER_RTT_printf(0, "\n\nDATA: ", dummy_data);
          for(i=0;i<7;i++) SEGGER_RTT_printf(0, "%02x ", dummy_data[i]);
    
        } 
    }
    
Children
No Data
Related