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

nrf51822 and oled ssd1306 without softdevice

Hello

SDK12.3, nRF51822

I'm trying to interface the ssd1306
the program freezes in function app_twi_perform
internal_transaction_cb is not called
internal_transaction_in_progress is not reset.

if you use the SoftDevice (instead of lfclk_config call ble_stack_init) then everything works fine.

static void twi_config(void)
{
   ret_code_t err_code;
   nrf_drv_twi_config_t const config ={
   .scl = ARDUINO_SCL_PIN,
   .sda = ARDUINO_SDA_PIN,
   .frequency = NRF_TWI_FREQ_100K,
   .interrupt_priority = APP_IRQ_PRIORITY_LOW,
   .clear_bus_init = true
   };
   APP_TWI_INIT(&m_app_twi, &config, MAX_PENDING_TRANSACTIONS, err_code);
   APP_ERROR_CHECK(err_code);
}

static void lfclk_config(void)
{
   ret_code_t err_code = nrf_drv_clock_init();
   APP_ERROR_CHECK(err_code);
   nrf_drv_clock_lfclk_request(NULL);
}

int main(void)
{
   APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
   lfclk_config();
   twi_config();
   APP_ERROR_CHECK(app_twi_perform(&m_app_twi, twi_buf, 1, NULL));
   while (1) ;
}

Parents Reply Children
No Data
Related