cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f0 adc configure pins

Harold Vogel
Associate II
Posted on January 15, 2018 at 16:08

Moving code from NPX Freescale chip using CodeWarrior and Processor Expert.  Have 4 lines that are used to monitor different voltages would like to know how the GPIO lines are configured to feed the ADC and check the values to see if the values are in or out of range?

3 REPLIES 3
Posted on January 15, 2018 at 17:54

Have you tried to install the STM32CubeMX? Every STM32 line has its own library. Once you run CubeMX it will download the library to support the MCU you select. Inside the lib package you will find some examples. ADC example is also provided for F0.

You can try to do it without using examples using the CubeMX code generator. Enable ADC through selecting analog inputs, generate the code, then look into HAL library manual to see what API to call to retrieve ADC values.

There is, as far as I remember, nice STM32 CubeMX-based training (ST-provided) covering many basic pheriperals where you can see the process of enabling particular functionality e.g. ADC, I2C etc.

Other option: google 'STM32F0 ADC' - there is online tutorial available (non ST provided).

No sure how deeply you wanna go into the details. Whether you need quick fix or wanna study the STM 32 deeply...

Posted on January 15, 2018 at 18:30

I will look into get STM32CubeMX.  I am looking into an IDE for development also, do you consider this one by STM a good development system?

Posted on January 16, 2018 at 08:33

I use Keil IDE.

I would consider Atollic True Studio as well as ST invested in it so it might be interesting in the future (going to be free and tightly integrated with STM32 tools).