Skip to main content
Associate
September 15, 2025
Solved

On our STM8L151K4 can't get the A2D to read an input on ADC1_IN0(PA6). Need the correct code to start & run the ADC.

  • September 15, 2025
  • 2 replies
  • 1954 views

..

    Best answer by Peter BENSCH

    Welcome @artchace, to the community!

    If you haven't already done so, I would recommend taking a look at the SPL examples in STSW-STM8016. The software package has a folder Project\STM8L15x_StdPeriph_Examples where you will find several examples of how to use the ADC.

    Hope that helps?

    Regards
    /Peter

    2 replies

    Peter BENSCH
    Peter BENSCHBest answer
    ST Technical Moderator
    September 15, 2025

    Welcome @artchace, to the community!

    If you haven't already done so, I would recommend taking a look at the SPL examples in STSW-STM8016. The software package has a folder Project\STM8L15x_StdPeriph_Examples where you will find several examples of how to use the ADC.

    Hope that helps?

    Regards
    /Peter

    In order 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.
    artchaceAuthor
    Associate
    September 15, 2025

    thank you , Peter. We have been looking for someone like you for sometime. My background goes back to writing code for the 68HC11 35 years ago. This project has brought me out of retirement and I have found the modern uProc world to require me to learn a very different way of coding. Needed only the processing power of an 8 bit machine but required the resolution that only the STM8L151 could offer; 12bit A2D, all other 8bits I could find were 10bits. This project has great significance in the area of pain management research, you assistance is much appreciated.

    thanks again,

    Art