STM32 analog-digital converter

Hello.
I am a beginner and i am trying to use one of the ADCs on my stm32f103ze.I have been using the examples from keil, they are well written and understandable. The problem is, they dont have an example showing use of an ADC. I have read the example from the stm firmware library and they use a different way of of setting up things than the examples from keil so i understood nothing.
Can anyone link me to an (understandable,keil-example-like) example describing setting up the adc, and receiving values from it?

Parents
  • "Can anyone link me to an (understandable,keil-example-like) example describing setting up the adc, and receiving values from it?"

    it is probably more helpful to read the datasheet and see how to configure the various registers to read the adc.

    in a non-interrupt mode, I would use two functions, adc_init() to set up the basic parameters for the adc, and then adc_read() to read back a particular channel's adc results.

    hope it helps.

    the firmware library is good in that it shows you how to configure an adc but they are so generic that they become unnecessarily complicated for 99% of the adc applications out there.

    so it is actually a lot easier / simpler to just read the datasheet.

Reply
  • "Can anyone link me to an (understandable,keil-example-like) example describing setting up the adc, and receiving values from it?"

    it is probably more helpful to read the datasheet and see how to configure the various registers to read the adc.

    in a non-interrupt mode, I would use two functions, adc_init() to set up the basic parameters for the adc, and then adc_read() to read back a particular channel's adc results.

    hope it helps.

    the firmware library is good in that it shows you how to configure an adc but they are so generic that they become unnecessarily complicated for 99% of the adc applications out there.

    so it is actually a lot easier / simpler to just read the datasheet.

Children
More questions in this forum