Is my Digital PWM Pin D9 burned?

Hi, My UNO's D9 can't correctly drive an LCD backlight. I was expecting to see the backlight fade as I write a value from 0 to 255, just like D6 does! If I use D9 I only see full brightness. Whatever I write it looks like is constantly set on HIGH. BUT, if I drive a simple LED with D9 it works fine and no difference in brightness or something between D9 and D6, looks like exactly the same.

Some example code to explain better:

pinMode(9, OUTPUT);
digitalWrite(9, LOW);

pinMode(6, OUTPUT);
digitalWrite(6, LOW);

If I connect the backlight to D6, backlight is OFF as it should be, but remains ON when I connect to D9. Same problem with analogWrite() 0 to 255. It should work like D6.

Does someone have an idea?

Thank you in advance and sorry for my poor english!

EDIT: I've just tried to set to LOW D3, D5, D6, D9, D10, D11, and to read their value with A0. Every Pin reports "0". With PWM pins set to LOW like this, every pin except D9 can actually turn OFF the brightness. With D9, the brightness just does not react, and remains ON...

Sounds like a pin conflict, wiring error, or a coding error in your sketch. Without seeing the entire sketch and the wiring of everything connected to your Arduino it will be hard to guess what has gone wrong.

pinMode(9, OUTPUT); analogWrite(9, 255);// between -0-255

pinMode(6, OUTPUT); digitalWrite(6, LOW);

I’ve just tried this (i don’t think is needed the code, is simple a bunch of pinMode and digitalWrite):

PWM pins set to LOW. I’ve read their values with A0 and reported to be “0” for every single pin.
But if I try to connect D9 to the wire which control the LCD backlight, it does not react. With every other PWM pins the backlight turns OFF.

Just in case:

void setup()
{
    for(int i = 2; i <= 13; i++)
    {        
        pinMode(i, OUTPUT);
        digitalWrite(i, LOW);
    }
}

void loop()
{
}

D9 can’t turn OFF the backlight like every other pins.

the backlight some times use strange + and - if you have rgb color
had some strange thing like this also , change the pin

It is a simple Backlit LCD Display 16x2. The brightness is controlled by a single wire. If this wire is connected to ground the backlight turns off otherwise it will remain ON... With PWM you can dim it.

The problem is this: even if I set OUTPUT LOW D9 it still act like is HIGH. And PWM doesn't do anything. Other pins works fine...

I think D9 is gone... And I don't know why... :roll_eyes: Is there anything I can do?

Note, if you use the servo library on the Uno, you cannot use PWM on pins 9 and 10, since the servo library uses the timer for pin 9/10 PWM for its own uses. There may be other libraries that use the same timer: http://arduino.cc/en/reference/servo

The way to test it out, is put a normal led + resistor on pin 9, and run a sketch that only does analogWrite to pin 9 using different values, and see whether the led dims or not.

MichaelMeissner: Note, if you use the servo library on the Uno, you cannot use PWM on pins 9 and 10, since the servo library uses the timer for pin 9/10 PWM for its own uses. There may be other libraries that use the same timer: http://arduino.cc/en/reference/servo

The way to test it out, is put a normal led + resistor on pin 9, and run a sketch that only does analogWrite to pin 9 using different values, and see whether the led dims or not.

The tests I did with the LCD backlight were done without any library I've just powered ON the lcd backlight (just +5v and gnd) and controlled it by the dedicated wire using digitalWrite() and analogWrite()

This is the LCD: http://www.dfrobot.com/wiki/index.php?title=Arduino_LCD_KeyPad_Shield_(SKU:_DFR0009)

I connected the wire which control the backlight and measured D9 Voltage with A0, and it results in ~0.73V (analogRead = 150) when I set D9 to LOW and ~4.62V (analogRead = 945) when I set to HIGH. Every other digital pins show ~0.09V (20) LOW and ~4.99V (1022) HIGH... 5 Volt reference.

So D9 does have something wrong, because reports so much different voltages. And it does nothing to the LCD backlight since it does not "understand" these threshold of HIGH and LOW, is right?

try new bootloader ! :%

Tam81, can you blink common led using D9 with blink sketch?