cancel
Showing results for 
Search instead for 
Did you mean: 

ADC and GPIO Input Modes

iperry
Associate
Posted on November 19, 2009 at 05:41

ADC and GPIO Input Modes

6 REPLIES 6
iperry
Associate
Posted on May 17, 2011 at 13:30

Hi there,

The STM32 Manual states that GPIO pins are configured as floating input upon reset. Floating input activates the internal Schmitt trigger on each pin. If a pin is configured as analog input, the Schmitt trigger is deactivated.

I've noticed that doing ADC conversions on pins that are set up in floating input mode instead of analog input seems to work just fine, though I haven't done any systematic testing to see if any resolution is lost, etc. As a matter of curiosity, what happens when the ADC does a conversion on a pin set up as floating input instead of analog input?

[ This message was edited by: iperry on 18-11-2009 07:36 ]

armmcu
Associate II
Posted on May 17, 2011 at 13:30

Hi Guys,

The main reason behind using the Analog input mode for I/Os when converting is because there is no shmitt trigger inside.

As you know this feature will filter all tarnsitions of the signal especilly in the Vhysterisis range which are seen as noise.

Hence many information of the input signal will be lost.

For sure with contunious, square wave signal input you will not see this degradation.

Regards,

Arm.

johnfitzgerald9
Associate II
Posted on May 17, 2011 at 13:30

The reference manual says,

''When the I/O Port is programmed as Analog Input Configuration:

â—� The Output Buffer is disabled.

â—� The Schmitt Trigger Input is de-activated providing zero consumption for every analog value of the I/O pin. The output of the Schmitt Trigger is forced to a constant value (0).

â—� The weak pull-up and pull-down resistors are disabled.

� Read access to the Input Data Register gets the value “0�.''

I think the important part of that is the statement, ''zero consumption for every analog value'', that input current is not affected by input voltage level.

tomas23
Associate II
Posted on May 17, 2011 at 13:30

Hey Arm, the analog connection to ADC goes directly from pin, not from the buffer.

The issue with Input floating mode is bigger power consumption and mighty lower impedance (bigger capacity due to connected Schmitt transistors) and bigger noise on the associated pin => worse frequency response of the ADC.

armmcu
Associate II
Posted on May 17, 2011 at 13:30

I geuss you did'nt get my point

I'm not saying the analog connection to ADC goes from the buffer!!!!

akaiser9
Associate II
Posted on May 17, 2011 at 13:30

It could depend on the power supply source of the digital input logic. In other devices like AVRs, the whole port logic of a port associated with ADC channels is powered by Vdda, so any switching transients from digital port operations affect the analog inputs as well.