I need to measure with SAADC two channels in the same time (NRF_SAADC_INPUT_AIN6 and NRF_SAADC_INPUT_AIN4).
Is possible ?
Have you an code example?
Thanks
Marco
I need to measure with SAADC two channels in the same time (NRF_SAADC_INPUT_AIN6 and NRF_SAADC_INPUT_AIN4).
Is possible ?
Have you an code example?
Thanks
Marco
Anyone find a solution to this?
Anyone find a solution to this?
Can you elaborate? What exactly is your issue?
"seem work but sametime in the buffer I find the values exchanged between channels. WHY ?".
I seem to have this issue as well when I have more than 1 channel getting saadc values. I explain more thoroughly in my question: https://devzone.nordicsemi.com/f/nordic-q-a/58861/saadc-multiple-channel-buffer-inconsistencies
Ok. I assume you will be followed up in your new ticket. The engineer who is assigned to that case will probably be interested in knowing how you trigger the sampling of the ADC, and about what frequency you do that.
BR,
Edvin
hi, John.
Unfortunately I never found a solution.
The frequency of my saples are 2 mS. Each 2 mS I need to sample 2 channels.
For now I set the ADC in order to make 2 different samples with one channel for time
Marco
I've been playing around with this issue a bit today and I may have found a solution, but I have no clue why or how. I'd be interested to find out if it fixes your problem as well.
My solution:
Change saadc_init() to the following:
void saadc_init(unsigned char type) { ret_code_t err_code; nrf_saadc_channel_config_t channel_config = NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN6); err_code = nrf_drv_saadc_init(NULL, saadc_PULSE_INEX_callback); APP_ERROR_CHECK(err_code); err_code = nrf_drv_saadc_channel_init(0, &channel_config); APP_ERROR_CHECK(err_code); channel_config.pin_p = NRF_SAADC_INPUT_AIN4; err_code = nrf_drv_saadc_channel_init(1, &channel_config); APP_ERROR_CHECK(err_code); err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool_scann[0], SAMPLES_IN_BUFFER_SCANN); APP_ERROR_CHECK(err_code); err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool_scann[1], SAMPLES_IN_BUFFER_SCANN); APP_ERROR_CHECK(err_code); }
Can you try it and let me know if it fixes the issue? Or you are done with this project?