Skip to main content
Visitor II
January 27, 2024
Question

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

  • January 27, 2024
  • 2 replies
  • 977 views

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? 

 

    This topic has been closed for replies.

    2 replies

    Graduate
    January 27, 2024

    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.

     

     

    ST Employee
    January 29, 2024

    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!

    LHarm.1Author
    Visitor II
    January 29, 2024

    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.