Input current on A0 higher as soon as I read A1
Posted: 25 Oct 2017 12:20
I am new to Z-Uno so I may be doing something wrong.
When i use the ADC on A0 it has a very high impedance. As soon as I use the multiplexer, input current is much higher. Am I doing something wrong, or is something on the Z-Uno switching input mode of the pin? Like, accidentally turning on the weak pull-up?
Here's runnable code to reproduce the problem:
When i use the ADC on A0 it has a very high impedance. As soon as I use the multiplexer, input current is much higher. Am I doing something wrong, or is something on the Z-Uno switching input mode of the pin? Like, accidentally turning on the weak pull-up?
Here's runnable code to reproduce the problem:
Code: Select all
// petergebruers analog input current test.
// connect uA meter and a 1k resistor between A0 and ground.
// Observe current is < 1 uA and measurement is correct
// Then uncomment the line // analog1 = analogRead(A1);
// Observe current is 26 uA so a voltage of 26 mV develops
// across the resistor and the measurement changes.
// Z-Uno 2.1.1
#define SENSOR_MULTILEVEL_SCALE_MILLIVOLT 0x01
ZUNO_SETUP_CHANNELS(
ZUNO_SENSOR_MULTILEVEL(
ZUNO_SENSOR_MULTILEVEL_TYPE_VOLTAGE,
SENSOR_MULTILEVEL_SCALE_MILLIVOLT,
SENSOR_MULTILEVEL_SIZE_TWO_BYTES,
SENSOR_MULTILEVEL_PRECISION_ZERO_DECIMALS,
Analog0getter));
void setup() {
analogReference(INTERNAL);
Serial1.begin();
}
uint16_t analog0, analog1;
void loop() {
analog0 = analogRead(A0);
Serial1.println(analog0);
// UNCOMMENT next to observe higher input current.
// analog1 = analogRead(A1);
}
int16_t Analog0getter(void) {
return 0; // not important.
}