cancel
Showing results for 
Search instead for 
Did you mean: 

How to trigger a timer / DMA / ADC acquence with a comparator

LHarm.1
Associate III

I am currently using a nucleo g474re board to acquire 10,000 samples from an ADC using a timer and DMA.

The timer allows me to use any data rate and the DMA puts the samples into memory without CPU intervention.

The process is currently initiated by starting the timer ( after adc & dma is enabled).

Now I want to start the process using the output of a comparator with one input connected to a DAC and the other to the ADC input.

 

How can I do that? 

 

3 REPLIES 3
raptorhal2
Lead

The comparator produces a binary voltage output, the DAC requires an integer word digital input, and the ADC converts a variable voltage input. The comparator can be used to start the ADC and drive a LED, but don't understand why the DAC is needed.

 

 

The DAC here can be used to generate a reference voltage for the comparator. The comparator then compares this reference voltage with the ADC input. When the ADC input crosses the reference voltage, the comparator can trigger the ADC to start the process of acquiring samples. This setup allows to start of the acquisition process based on a specific voltage level, which is set by the DAC.

@LHarm.1 Did you mean this? 

Thank you!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

LHarm.1
Associate III

Yes I want to start an acquisition (multiple ADC readings ) when then put signal goes above the a certain level, provided by the DAC.  I am going to try to use the timer (which drives the ADC sample rate) in slave mode with and trigger source corresponding to the comparator output (itrx).  Hopefully this will work.