cancel
Showing results for 
Search instead for 
Did you mean: 

STM8L151Gx ADC1 Conversion Value Retrieval Time

Jack Mills
Associate
Posted on May 10, 2018 at 05:50

I have a question rooted in pure curiosity as I am still learning my around the STM8 MCU structure. In the general setup of the ADC, single mode conversion and software triggered,  we have to call ADC_GetConversionValue(ADC1) once the ADC has finished its sampling and conversion cycles. This function should retrieve a value from the register to be saved locally. I expected this function to not take too long, but by roughly measuring the time(toggling GPIO pins around the functions and viewing on an oscilloscope) for the function to execute, I measure 5us. This becomes pretty substantial when you are trying to measure short pulse waveforms, but need a high data point collection set. Does anyone have the explanation as to why this retrieval takes that long? 

1 REPLY 1
henry.dick
Senior II
Posted on May 10, 2018 at 14:57

Take a look at the source code and all your curiosity will be satisfied.