This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello.
In our project, until now, the sampling of two ADC channels was made via only one ADC (ADC0). Due to phase requirements, I need to sample those channels simultaneously, via ADC0 and ADC1.
The ADC0 was triggered via an external pin at 500khz, and the data was captured via PING-PONG buffer with the DMA and it was working fine.
As I understand, now I need to set up another sequencer for the ADC1, another DMA channel for the ADC1, and I need to change my DMA setup on the ADC0 because I will be capturing only one channel (half the data). Right?
Does the ARB size change as well?
Will I get two interrupts instead of only one? If so, will those interrupts be consecutive at nearly the same time?
Do you have an example for this?
Thank you
PS: Besides I have seen that there is a bug with ADCSequenceConfigure and ADC1 in Tivaware. What workaround do you recommend?
ADCSequenceConfigure() bug in TivaWare for ADC1 - Arm-based microcontrollers forum - Arm-based microcontrollers...
Re: Identical sampling time (aperture) across multiple ADC Channels.
Might this be best served by TWO (or more) external ADCs - clocked in unison - via a common clock?
MCU as, "kitchen sink" may not always prove (best) "cat-skinning technique." Specialized devices DO exist for good reason...
At the very least - your acquisition & build of this suggested (external) circuit would well, "inform" you of the MCU's capability (by enabling comparison of the MCU's results vs. those of (more proper) external devices) - that's important - is it not?
In addition - you may find multiple resolution (external) ADCs - which all accommodate the SAME pcb footprint & signal inventory. (the ability to "tailor" both the ADC's speed of conversion as well as its conversion depth is sure to prove of value - at some point w/in your design effort...)
cb1 said:Might this be best served by TWO (or more) external ADCs - clocked in unison - via a common clock?
MCU as, "kitchen sink" may not always prove (best) "cat-skinning technique." Specialized devices DO exist for good reason...
Yes, but this is a test of a proof of concept on an already made board. Everything is routed, in the end product we will probably use a dedicated DSP....but it is better to make the test as close as possible to the final signal.
Amit Ashara said:Hello PAk
You mean external trigger?
One way is to monitor the ADC analog channel with a Pull Up resistor. When the ADC sampling is started, there is a small dip in the voltage. By putting two scope probes it can be checked if the dips on the two channel happen at the same time. A persistence capture will show the variation if any on the sampling of the channels.
I was asking about how to setup the ADCs/DMAs modules in sw to make them sample at the same time via an external pin.
To test the phase, I think it is better to inject a sin signal in both channels, and calculate the phase of the FFT or the ddelay between them.
I was stating the same as the partner cb1 ....a linear ramp would also do it:
Inject a known signal, and measure the difference between the sampled points of both ADCs. If everything is good, they have to be almost the same (of course, you could do that using FFTs if your sampled signal is inside Nyquist)....so let's keep it simple....Linear ramp.
The ADC clock is received in an GPIO pin, and selected via: GPIOADCTriggerEnable(GPIO_PORTM_BASE, GPIO_PIN_7);
Would it work for both ADCs?
How should we set up the rest of the ADCs and DMA blocks to get simultaneous sampling of two channels?
Amit Ashara said:Hello PAk,
Yes, that would work. There is no selection of the trigger pin at the ADC. It is only external trigger. All qualified pins are OR-ed together to form the external trigger.
Ok, but will both ADC then sample at the same time?
Is it necessary to set the phase?
Amit Ashara said:Hello PAk
No, the interrupt generation is based on the conversion complete. The setting of Phase would allow control on the sampling by a single ADC and then its propagation. Without setting the phase the sampling of the trigger would be handled by the ADC's themselves independently which may result in change of the interrupt generation.
Ok, I tried setting both ADCs with DMA on an external trigger, and there is not any delay on the samples.
In fact, if I use the same input for both of them, the samles are virtually identic!! No delay, even one clock.
Thank you for everything.
Amit Ashara said:position of the External trigger w.r.t to the ADC clock. Since the ADC clock is not directly visible outside, a synchronous sweep with a psuedo-end of conversion signal would do the trick.
That is exactly what i am doing...and it is working!!!
Amit Ashara said:And what is the granularity of the sweeping external trigger w.r.t the end of conversion signal? Also not all the devices you have may belong to different silicon characterized.
Around 100ns....
Amit Ashara said:Hello PAk,
That is not sufficient enough when compared to the sampling clock of 16 or 32 MHz. The movement of the external trigger must be at least 1/2 of the clock for any base check and I would normally be sweeping it in 100 ps to get to a 99% confidence. However without knowing the characterized nature of the device any data collected would only go as far 95% range in terms of always being sampled at the same time. If you are OK with 1 ADC clock error, then you are in a much better state of behavior conformity of the devices.
Sorry...I meant 100ps...100ns is the granularity of the DMA interrupt.
In fact, the ADC clock signal and EoC signal are coherent in our system (generated from the same crystal)