Output Pins on Arduino Due Pulled High But Less than CMOS 2.4 V Requirement

Dear all,

In scaling my little Arduino projects up to use more and more pins with the Arduino Due, I'm finding that some of them are not operating as I thought they would, which is good because it means I'm about to learn something new.

My current understanding of CMOS logic operating between 0 and 3.3 V of the Due (as opposed to TTL 0 to 5 V with other Arduino species) is that any pin with a voltage between 2.4 V and 3.3 V is HIGH and anything with a pin voltage between 0 and 0.8 V is LOW relative to the board's ground (GND) pin.

When I declare some pins to be OUTPUTS and then use digitalWrite to pull them HIGH, the voltage between these pins and GND is sometimes far below the minimum 2.4 V as measured by my multimeter. There is nothing else to the code: no other functions declared or activities being performed. Neither is there anything attached to the pins other than a Dupont-style connector to measure the voltage.

My simple experiment then. For the bank of pins between 22 and 48, I find the following experimentally determined voltage relationships apply when all these pins are all declared as OUTPUTS and all of them are pulled HIGH (V_high) at the same time, or one-by-one:

Pins 22-36: V_high = 3.2 V
Pins 37-41: V_high = 3. 1 V
Pins 42-45: V_high = ~2.7 V
Pins 46-49: V_high = ~0.5 V
Pin 50: V_high = ~0.4 V
Pin 51: V_high = 3.3 V
Pin 52: V_high = 2.78 V
Pin 53: V_high = 3.25 V

So something seems to be odd between pins 46 and 50. On the other hand, when I repeat this experiment but pull all the pins LOW, all of the values are correct with no similar discrepancy. I did not see anything significant about these pins when looking at the board schematic online, but perhaps I do not know what I am looking for.

My idiot's test code is as follows:

#define Pin_Up22 22
#define Pin_Up23 23
#define Pin_Up24 24
#define Pin_Up25 25
#define Pin_Up26 26
#define Pin_Up27 27
#define Pin_Up28 28
#define Pin_Up29 29
#define Pin_Up30 30
#define Pin_Up31 31
#define Pin_Up32 32
#define Pin_Up33 33
#define Pin_Up34 34
#define Pin_Up35 35
#define Pin_Up36 36
#define Pin_Up37 37
#define Pin_Up38 38
#define Pin_Up39 39
#define Pin_Up40 40
#define Pin_Up41 41
#define Pin_Up42 42
#define Pin_Up43 43
#define Pin_Up44 44
#define Pin_Up45 45
#define Pin_Up46 46
#define Pin_Up47 47
#define Pin_Up48 48
#define Pin_Up49 49
#define Pin_Up50 50
#define Pin_Up51 51
#define Pin_Up52 52
#define Pin_Up53 53

void setup() {
Serial.begin(9600);
pinMode(Pin_Up22, OUTPUT);
pinMode(Pin_Up23, OUTPUT);
pinMode(Pin_Up24, OUTPUT);
pinMode(Pin_Up25, OUTPUT);
pinMode(Pin_Up26, OUTPUT);
pinMode(Pin_Up27, OUTPUT);
pinMode(Pin_Up28, OUTPUT);
pinMode(Pin_Up29, OUTPUT);
pinMode(Pin_Up30, OUTPUT);
pinMode(Pin_Up31, OUTPUT);
pinMode(Pin_Up32, OUTPUT);
pinMode(Pin_Up33, OUTPUT);
pinMode(Pin_Up34, OUTPUT);
pinMode(Pin_Up35, OUTPUT);
pinMode(Pin_Up36, OUTPUT);
pinMode(Pin_Up37, OUTPUT);
pinMode(Pin_Up38, OUTPUT);
pinMode(Pin_Up39, OUTPUT);
pinMode(Pin_Up40, OUTPUT);
pinMode(Pin_Up41, OUTPUT);
pinMode(Pin_Up42, OUTPUT);
pinMode(Pin_Up43, OUTPUT);
pinMode(Pin_Up44, OUTPUT);
pinMode(Pin_Up45, OUTPUT);
pinMode(Pin_Up46, OUTPUT);
pinMode(Pin_Up47, OUTPUT);
pinMode(Pin_Up48, OUTPUT);
pinMode(Pin_Up49, OUTPUT);
pinMode(Pin_Up50, OUTPUT);
pinMode(Pin_Up51, OUTPUT);
pinMode(Pin_Up52, OUTPUT);
pinMode(Pin_Up53, OUTPUT);

}

void loop() {
digitalWrite(Pin_Up22, HIGH);
digitalWrite(Pin_Up23, HIGH);
digitalWrite(Pin_Up24, HIGH);
digitalWrite(Pin_Up25, HIGH);
digitalWrite(Pin_Up26, HIGH);
digitalWrite(Pin_Up27, HIGH);
digitalWrite(Pin_Up28, HIGH);
digitalWrite(Pin_Up29, HIGH);
digitalWrite(Pin_Up30, HIGH);
digitalWrite(Pin_Up31, HIGH);
digitalWrite(Pin_Up32, HIGH);
digitalWrite(Pin_Up33, HIGH);
digitalWrite(Pin_Up34, HIGH);
digitalWrite(Pin_Up35, HIGH);
digitalWrite(Pin_Up36, HIGH);
digitalWrite(Pin_Up37, HIGH);
digitalWrite(Pin_Up38, HIGH);
digitalWrite(Pin_Up39, HIGH);
digitalWrite(Pin_Up40, HIGH);
digitalWrite(Pin_Up41, HIGH);
digitalWrite(Pin_Up42, HIGH);
digitalWrite(Pin_Up43, HIGH);
digitalWrite(Pin_Up44, HIGH);
digitalWrite(Pin_Up45, HIGH);
digitalWrite(Pin_Up46, HIGH);
digitalWrite(Pin_Up47, HIGH);
digitalWrite(Pin_Up48, HIGH);
digitalWrite(Pin_Up49, HIGH);
digitalWrite(Pin_Up50, HIGH);
digitalWrite(Pin_Up51, HIGH);
digitalWrite(Pin_Up52, HIGH);
digitalWrite(Pin_Up53, HIGH);

Serial.println(digitalRead(Pin_Up46));
}

Here the plot becomes even stranger. When I use Serial.println(digitalRead(Pin_X) where X corresponds to pins between 46 and 50 to read off the status of the pin, the value is returned as 1, not zero, which indicates that even though these logic voltages should be considered low as read by my multimeter, the Arduino is reading them as high.

My multimeter is a Fluke 289, which should be within calibrated specs.

Any suggestions for a newbie?

Cheers

I'm not familiar with the Due. But reading back an output pin might not be possible; I think that in Arduino land, that only works on AVR microcontrollers. You will have to check in the datasheet of the specific microcontroller.

No idea as to why you have mixed readings.

My multimeter is a Fluke 289, which should be within calibrated specs.

But is it :wink: It probably is as you manage to measure 3.3V on a number of pins.

Your results for pins 46 to 49 are very surprising.

Try out this super basic sketch with an LED connected to pin 46 on one side, and the other side connected to a resistor (e.g. 1K) and the resistor connected to GND:

void setup() {
pinMode(46, OUTPUT);
}

void loop() {
  
digitalWrite(46, HIGH);
delay(1000);
digitalWrite(46, LOW);
delay(1000);
}

BTW, you can always read an output pin, providing this output pin is powered (via pinMode()).

Maybe the compiler version of the DUE you have selected is bugged with this feature.

Some thoughts:

  • When the DUE is powered via the USB cable, the board can't output more than 500 mA. When powered thru the jack, the board can provide up to 800 mA (it's cautious though to remain well under...)
  • There is table that gives, pin by pin, the maximum current a pin can provide:
    https://www.arduino.cc/en/Hacking/PinMappingSAM3X
  • In Sam3x datasheet, you will find a table (pages 12 and 13) with the list of the schmitt trigger pins.

sterretje:
I'm not familiar with the Due. But reading back an output pin might not be possible; I think that in Arduino land, that only works on AVR microcontrollers. You will have to check in the datasheet of the specific microcontroller.

No idea as to why you have mixed readings.
But is it :wink: It probably is as you manage to measure 3.3V on a number of pins.

My three rules when troubleshooting:
1.) Check ignorance/idea
2.) Check connections/set-up
3.) Then check/blame operation of the tools

I'm stuck on 1 for now!

ard_newbie:
Your results for pins 46 to 49 are very surprising.

Try out this super basic sketch with an LED connected to pin 46 on one side, and the other side connected to a resistor (e.g. 1K) and the resistor connected to GND:

void setup() {

pinMode(46, OUTPUT);
}

void loop() {
 
digitalWrite(46, HIGH);
delay(1000);
digitalWrite(46, LOW);
delay(1000);
}




BTW, you can always read an output pin, providing this output pin is powered (via pinMode()). 

Maybe the compiler version of the DUE you have selected is bugged with this feature.

Some thoughts:

- When the DUE is powered via the USB cable, the board can't output more than 500 mA. When powered thru the jack, the board can provide up to 800 mA (it's cautious though to remain well under...)
- There is table that gives, pin by pin, the maximum current a pin can provide:
https://www.arduino.cc/en/Hacking/PinMappingSAM3X
- In Sam3x datasheet, you will find a table (pages 12 and 13) with the list of the schmitt trigger pins.

Thanks for your suggestion. I have tried using the USB power alone vs USB with barrel jack previously without any different in 'voltage highs', however I was spurred on to try it again today with your test code in case I missed something.

I used a red LED with a voltage rating between 2-2.2 V with a 330 ohm resistor attached to one leg. Polarity of LED legs checked with diode function on multimeter. With pin 46, no blinking of the red light.

For any of the 'dubious pins' from 46 to 50, this doesn't work. For pin 41, it works as intended and blinks every 1000 milliseconds.

I don't think it's a current output issue, since when I measured the voltage highs of all of these pins, nothing else was connected to them.

The plot thickens!

If the basic sketch provided in #2 doesn't work (no blinking LED), then your board is faulty.