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

How to use saadc nrfx_saadc_buffer_convert with softdevice

Please some an example or tutorial how to use nrfx_saadc_buffer_convert with softdevice enabled.

Parents Reply
  • the blocking function nrf_drv_saadc_sample_convert works

    the non-blocking nrf_drv_saadc_buffer_convert does not jump to the event handler function

    settings saadc:

    saadc_conf.resolution = NRF_SAADC_RESOLUTION_10BIT;
    saadc_conf.interrupt_priority = APP_IRQ_PRIORITY_LOWEST;
    saadc_conf.low_power_mode = false;
    saadc_conf.oversample = NRF_SAADC_OVERSAMPLE_32X;
    	
    ret_code_t err_code = nrf_drv_saadc_init(&saadc_conf, saadc_event_handler);
    APP_ERROR_CHECK(err_code);

    settings channel:

    batt_channel_conf.resistor_p = NRF_SAADC_RESISTOR_DISABLED;
    batt_channel_conf.resistor_n = NRF_SAADC_RESISTOR_DISABLED;
    batt_channel_conf.gain = NRF_SAADC_GAIN1_6;
    batt_channel_conf.reference = NRF_SAADC_REFERENCE_INTERNAL;
    batt_channel_conf.acq_time = NRF_SAADC_ACQTIME_3US;
    batt_channel_conf.mode = NRF_SAADC_MODE_SINGLE_ENDED;
    batt_channel_conf.burst = NRF_SAADC_BURST_ENABLED;
    batt_channel_conf.pin_p = NRF_SAADC_INPUT_VDD;
    batt_channel_conf.pin_n = NRF_SAADC_INPUT_DISABLED;
    	
    err_code = nrf_drv_saadc_channel_init(0, &batt_channel_conf);
    APP_ERROR_CHECK(err_code);

Children
Related