Skip to main content
Siddharth Kachhia_2
Associate
May 30, 2018
Solved

ADC pin configuration in STM32F072B

  • May 30, 2018
  • 3 replies
  • 1371 views
Posted on May 30, 2018 at 14:36

How to configure ADC pin in STM32F072B controller?

I do not give any input in ADC pin but I got the output?

Same configuration and code working correctly on STM32F072B Discovery Board.

    This topic has been closed for replies.
    Best answer by Artur IWANICKI
    Posted on June 04, 2018 at 07:25

    Hello,

    Schmidt triggers are disabled automatically once you configure IO line in analog mode.

    Best Regards,

    Artur

    3 replies

    ST Employee
    May 30, 2018
    Posted on May 30, 2018 at 14:45

    Hello,

    In case you are using STM32CubeMX tool:

    If you would like to select IO pin as analog (to be used by ADC), please just select ADC channel. You can configure all not used pins automatically as analog using Project settings. The second option is used to reduce current consumption in the application as by default IOs are configured as input floating. In this configuration there is Schmit trigger active at the pin which is causing an additional current consumption. This component is disabled in analog mode.

    In case you are writing code manually you should configure IO lines in analog mode (GPIOx_MODER register).

    Best Regards,

    Artur

    Siddharth Kachhia_2
    Associate
    May 31, 2018
    Posted on May 31, 2018 at 06:26

    Thanks to the for the reply.

    Yes, I am using STM32CubeMX tool.

    I check analog pin configured is correct. but how to disabled Schmit trigger?

    Artur IWANICKIBest answer
    ST Employee
    June 4, 2018
    Posted on June 04, 2018 at 07:25

    Hello,

    Schmidt triggers are disabled automatically once you configure IO line in analog mode.

    Best Regards,

    Artur

    Siddharth Kachhia_2
    Associate
    May 30, 2018
    Posted on May 30, 2018 at 15:38

    Thanks to the for the reply.

    Yes, I am using STM32CubeMX tool.

    I check analog pin configured is correct. but how to disabled Schmit trigger?

    AvaTar
    Senior III
    May 30, 2018
    Posted on May 30, 2018 at 15:45

    That does not mean too much.

    What is the external wirings on both boards ?

    Short the ADC input to ground, and you shall read zero. If the input floats, the S&H will pick up noise.