2009-11-18 08:41 PM
ADC and GPIO Input Modes
2011-05-17 04:30 AM
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 ]2011-05-17 04:30 AM
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.2011-05-17 04:30 AM
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.2011-05-17 04:30 AM
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.2011-05-17 04:30 AM
I geuss you did'nt get my point
I'm not saying the analog connection to ADC goes from the buffer!!!!2011-05-17 04:30 AM
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.