Please some an example or tutorial how to use nrfx_saadc_buffer_convert with softdevice enabled.
Please some an example or tutorial how to use nrfx_saadc_buffer_convert with softdevice enabled.
Hi,
You can find that the ble_app_proximity example in nRF5 SDK use the adc driver to measure VDD. If you want to migrate from the adc driver to nrfx this guide may be useful:
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/nrfx_migration_user_guide.html
Also check out this thread:
https://devzone.nordicsemi.com/f/nordic-q-a/38956/15-2-proximity-example-nrfx-saadc-driver-not-updating-battery-service-value
Best regards,
Kenneth
Hi,
You can find that the ble_app_proximity example in nRF5 SDK use the adc driver to measure VDD. If you want to migrate from the adc driver to nrfx this guide may be useful:
https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/nrfx_migration_user_guide.html
Also check out this thread:
https://devzone.nordicsemi.com/f/nordic-q-a/38956/15-2-proximity-example-nrfx-saadc-driver-not-updating-battery-service-value
Best regards,
Kenneth
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);
Check out the documentation: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/hardware_driver_saadc.html#saadc_nonblocking