Skip to main content
Graduate II
December 19, 2023
Question

Want to know the each ADC value reading time in Debug Mode ?

  • December 19, 2023
  • 4 replies
  • 1359 views

Hi

I am reading some ADC value in to the DMA 

Is there any option indebug mode to see how much times taken to the each read of the ADC values ?

    This topic has been closed for replies.

    4 replies

    Graduate II
    December 19, 2023

    I use timestamp by another timer or systemtick to measure each period of sampling.

    Graduate II
    December 19, 2023

    hi 

    How to impliment it i didnt get well?

     

    Graduate II
    December 19, 2023

    it's depend on your speed sampling.

    The system Tick is usually increase value every 1ms so if your sampling very slow than 1ms (1KHz), you can gettick every time when ADC Start sampling and you will get how long period for each sampling.

    But another way that you also can use timer to measure that period by read from CNT register in timer on up counter mode but this method is a little more complicate than systemtick because you have to set that timer to be counter mode and you have to know range of period you want to measure too.   

    Technical Moderator
    December 19, 2023

    Hello @thannara123 ,

    You can check this wiki article --> https://wiki.st.com/stm32mcu/wiki/Getting_started_with_ADC.
    There is an example for ADC + DMA.

    Best Regards

    Super User
    December 19, 2023

    The sampling and conversion times for ADC are given in the reference manual.

    TDK_0-1702995850568.png

    Due to the overhead of callbacks and instructions, it is difficult to measure this in code.