cancel
Showing results for 
Search instead for 
Did you mean: 

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

thannara123
Senior

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 ?

5 REPLIES 5
Tinnagit
Senior II

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

hi 

How to impliment it i didnt get well?

 

Tinnagit
Senior II

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.   

Michael E
ST Employee

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

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.

TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".