2016-12-20 02:49 AM
Hi,
could tell me someone, how to read value on GPIO analog mode (not ADC analog on AF mode). I was Googled this, and I just found that this mode has 8-bits converter. How can I recieve value from this, using HAL library? I need to configure something else in STM32CubeMX?
#gpio #analog #mode #stm322016-12-20 02:54 AM
Show the link you googled.
JW
2016-12-20 03:34 AM
The description is a bit blur.
For GPIO with Analog function, the pin structure looks like this: (reference manual)
If you want to know the input voltage level, make sure the pull-up and pull-down are disabled (unless wanting to self test)
Then reading the GPIO Input Register (IDR) to read the pin level respective to datasheet high-low threshold voltage spec.
There is no alternate function for the ADC, ADC has a mux to multiple channels going to selected GPIO as the one above.
I guess that if the pin is not connected and the GPIO is forced as output low or high, the ADC or Analog input can be read/converted. Does it make sense?