Can I use the AREF pin for regular analog input?

Status
Not open for further replies.

DougSauve

Member
I'm using a Teensy LC and I'm going to need all the analog inputs I can get. Can I set pinMode to INPUT on the AREF pin and use analogRead on it? I don't want to mess with the reference voltage.
 
No. AREF can't be used as a regular analog input.

There is a difficult and usually impractical hack to use AREF as an input, where you configure the ADC for AREF and then measure a known signal (which must be lower than whatever input you have on AREF) and then use some math to deduce what AREF must have been.

But on top of the limited range (AREF must be higher than some other signal that's known), this requires a slow reconfig and recalibration of the ADC. The AREF pin also draws pulses of current during conversions, so it's not a proper input that samples the signal once before doing the conversion. These limitations make the AREF pin not very useful as an input, except in very unusual circumstances, like how our bed-of-nails test fixture does the verification that AREF really is connected and working.

If you need more signals, usually a mux chip like 74HC4051 is the best way. Scroll down to "Connecting Many Buttons & Knobs/Sliders" on this page for info.

https://www.pjrc.com/teensy/td_midi.html
 
Status
Not open for further replies.
Back
Top