cancel
Showing results for 
Search instead for 
Did you mean: 

ADC pin configuration in STM32F072B

Siddharth Kachhia_2
Associate II
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.

1 ACCEPTED SOLUTION

Accepted Solutions
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

View solution in original post

6 REPLIES 6
Artur IWANICKI
ST Employee
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 II
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
Lead
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.

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?

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

Posted on June 04, 2018 at 13:31

Hello,

Thanks for the sharing the information.