pinMode latches ADC into low impedance state on Teensy 3.2

Status
Not open for further replies.

hbridge55

New member
Hi Paul et al,

I'm filing a kind of technical report that was the result of a few hours of debug time.
This is probably documented elsewhere but you can't have too many reports of this kind of thing.
I didn't find it while googling around for solutions.

I used pinMode(pin, INPUT) on an analog pin reading a piezo sensor.
The pin works fine and reports reasonable outputs (I didn't really check how reasonable the output was - such as hooking up a pot)
somewhere up to a to higher voltage between 2.5 and 3.3 volts - again I didn't check this very accurately - exactly where the latch starts -
it would be easy enough to check with a pot.

At some high voltage, the pin latches into a low impedance state (but still above 10K ohms) and biases the pin at about
2.8 volts. This condition will persist until the pin is unlatched by a lower impedance path to ground.

Anyway the issue is solved - with the takehome being:

DON'T USE PINMODE ON ANALOG PINS USED AS INPUTS!
 
pinmode configures a pin for digital operation and multiplexes it to the GPIO engine of the processor. Thus, it is logical to not using this command for pins which you want to be multiplexed to an ADC for analog operation at the same time. That’s the same as you’d never send the same signal in parallel to a digital and an analog circuit at the same time when using discrete circuitry instead of an embedded MCU. That’s common sense and self understanding.
 
Status
Not open for further replies.
Back
Top