2013-06-29 04:24 AM
Is it possible to use ADC without configure GPIO for AIN?
For example, if the lines below are commented in the program, can ADC still work? // GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; // GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1; // GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; // GPIO_Init(GPIOC, &GPIO_InitStructure); at really, I put the pin with the mode IN_FLOATING and the ADC work normally.2013-06-29 05:47 AM
AIN turns off all the digital circuitry on the pin, including the Schmitt trigger IN_FLOATING has enabled.
2013-06-30 11:31 PM
The reason for this is that the circuitry starts with an Nmos and Pmos transistor pair. With the input at 0V the P conducts and the Nmos doesn't. With the input at VCC the Nmos conducts and the Pmos doesn't. But inbetween there might be a moment that both conduct.
In the input-circuit of a chip this will cost you a couple of mA of extra current if the signal lingers in the middle. (depending on the process parameters, more than about 0.8V from either supply). That means that if you're running at 1.8V, there is not much drawback. The current will be small and the dangerous region small.2013-07-04 01:06 PM
Looking at reference manual (RM0041) I notice that Analog input is connected before the Schmmit and without flux control. I did a simple experience putting the pin in output mode and after I tried to read the value with the ADC. In this case I could read the right values for output in high or low level.