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
maybe I can't explain myself well.
The event of LPCOM is only on 1 signal.
When this event start I need to scan both signals in the same time.
In the buffer: static nrf_saadc_value_t m_buffer_pool_scann[2][2];
Normally I found in position 0 the first signal and in position 1 the second signal. And this is OK, all seem to work good.
Sometimes during the acquisition of the signals I find the values exchanged, so in position 0 the second signal and in position 1 the first signal. This situation continues and then every once in a while it is reversed.
I don't understand. Other people on the web complain about this problem
Marco
Hello Marco,
Ok. I think I understand. Does this happen when you disable and enable the different channels? I am sorry to ask the same questions over and over, but I try to think of why this may happen. I still don't think it is exactly the same as in the ticket that you link to, and I hope that it isn't, because there is really no good solution to that issue.
So the reason why you disable and enable the channels is that you want to measure on different times, is that correct? Or do you intend to measure them at the same time?
Because when you have two ADC channels, and you trigger the scan, it will scan both channels one after the other (because there is only one physical ADC on the chip).
What I suspect is happening is that you are triggering the scan via CPU interrupts, the interrupts are too fast for the CPU to handle all, so some of them are skipped. What I suggest is that you try to use the PPI to trigger the interrupts, which is more efficient, and you may not miss any of the events.
Now, the reason that the positions swap is that the buffer isn't aware of how many channels, or which channel the interrupts are coming from. This is not a problem if you only use one channel, but it is if you have more. If one sample is interrupted, it may happen that it scans twice on one channel, and then they will be swapped.
So: Do you disable/enable the channels? And have you tried triggering them via PPI? And do you need to measure at different points in time, or can you measure both channels at the same time?
Thank Edvin ! Difficult to find help in mid-August
Yes I need to measure both channels at the same time (AIN4 and AIN6)
If I enable only one channel all is perfect, if I anable 2 channel sometimes I have the swap.
Anyone find a solution to this?
Can you elaborate? What exactly is your issue?