Skip to main content
Visitor II
May 10, 2018
Question

STM8L151Gx ADC1 Conversion Value Retrieval Time

  • May 10, 2018
  • 1 reply
  • 656 views
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? 

    This topic has been closed for replies.

    1 reply

    Visitor II
    May 10, 2018
    Posted on May 10, 2018 at 14:57

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