digital Pin 11 always outputs a signal

Hello! digital Pin 11 (PWM) on my Diecimila always outputs a signal at Pin 11. I tested it with a LED, which is lighting half strong, what doesn't absolutely depend from programming commands digitalWrite(Pin11, HIGH), digitalWrite(Pin11, HIGH).

For information: Befor I tested a code for DMX-interfacing, where the same pin11 is required. I used the code by Peter Szakal und Gabor Papp.

Can it be, that the problem is connected with this code, or the fact, that this code uses partly assamble routines?

Any suggestions?

Best Regards

Hans-Gunter Lock New Media Department Estonian Academy of Arts

what doesn’t absolutely depend from programming commands digitalWrite(Pin11, HIGH), digitalWrite(Pin11, HIGH).

Try
void loop(){
digitalWrite(11, HIGH);
delay(500);
digitalWrite(11, LOW);
delay(500);
}

Hello!

I tried it:

void loop(){ digitalWrite(11, HIGH); delay(500); digitalWrite(11, LOW); delay(500); }

At first, no reaction, same as before, LED lighting half-bright. Then I measured with a multimeter, measured 2.3 V in parallel with the LED, removing th LED it was 4.7 V.

After that also this voltage disappears. No reaction to the binking code. Same code is working in pin 10 and 12. And than I observed something like overtalk (I don't know, if the word is right used: while blinking the digiPin 10, a LED connected to digiPin 11 flashes on a very low level. Strange!

What's the problem? Software? Hardware?

I will be lucky for any helping!

Hans-Gunter Lock

What value of resistor do you have in series with the LED? Are you enabling the pin as an output in the setup() routine?

Try increasing the delay and seeing if you can see the blinking on the raw pin (nothing connected) with your voltmeter.

If it works on the other pins I can only think there is something wrong with the Arduino Pin 11, or the way it is wired up.

It sounds like you've got pin11 set up as an INPUT with the internal 20k pullup engaged. If you use digitalWrite() on an INPUT pin, you're engaging or disengaging the internal pullup resistor. If you're toggling between them, it would be like going from high-impedance to slightly-less-high-impedance, and the LED would flash dimly.

If you use analogWrite(), it should set the pin as an OUTPUT and enable the PWM timer for the pin. If you use digitalWrite() on a PWM-timer-enabled pin, it should turn off the PWM-timer. But using digitalWrite() does not force the pin to be an OUTPUT, because that's also how you engage the INPUT pullups.

Post the code that you're using Hans.

I am sorry for answering late:

So now I tested it again, using two LEDs, each with 220 Ohm Resistor in series, one on Pin9, the other on Pin11.

This is the code: A) DigitalWrite

int testpin1 = 9; int testpin2 = 11;

void setup() { pinMode(testpin1, OUTPUT); pinMode(testpin2, OUTPUT); }

void loop() { digitalWrite(testpin1, HIGH); digitalWrite(testpin2, HIGH); delay(500); digitalWrite(testpin1, LOW); digitalWrite(testpin2, LOW); delay(500);

}

B) AnalogWrite int testpin1 = 9; int testpin2 = 11;

void setup() { pinMode(testpin1, OUTPUT); pinMode(testpin2, OUTPUT); }

void loop() { analogWrite(testpin1, 127); analogWrite(testpin2, 127); delay(500); analogWrite(testpin1, 0); analogWrite(testpin2, 0); delay(500);

}

For both codes, Pin11 definitly doesn't work, I exchanged the wires on the Pins, only on LED flashes, not both like it should. Not with digitalWrite neither with analogWrite.

Maybe the internal resistor is broken?

Best Hans