Not sure if this is a general problem, or just some weirdness with my ATmega328 / Arduino duemilanove:
I was trying to use an analogue output (pwm) to fade a led in a project I'm working on.
One led connected to pin 11 will fade as expected, one led connected to pin 10 will NOT fade, and acts like the PWM clock on the pin is really slow (slow as in waiting 10 seconds then turn on to full brightness for a short while, then off again).
To chase down the problem, I have loaded the Fading sketch, to see if I could recreate the problem.
changing the ledPin, I tested all the PWM outputs on the Duemilanove board:
3: works fine
5: works fine
6: works fine
9: does not work
10: does not work
11: works fine
so it seems like there are 2 of the PWM pins that are behaving strangely.
Can any of you prove or disprove this? (in other words, tell me if I'm mad or not ;D )
My arduino is loaded with the Optiboot bootloader.
(slow as in waiting 10 seconds then turn on to full brightness for a short while, then off again).
The change rhythm is controlled by delay(30) in the Fading example. This looks a little bit as if someone else keeps changing the timer register setting in an active interrupt routine. This is most unlikely a bootloader... Hardware defect?
I may be too short in my words. I do not deny that you can also damage the output port. I just wanted to say that the OP (most likely) has used resistors, otherwise he would have reported dead LEDs...
Good point!
A general symptom of groggy output transistors is that they do not fully close any longer.
One conseuence is that the chip becomes hot by this constant internal current. Another consequence is that the output voltage is no longer (close to) zero and five volts, but 1 and 4 (or something)...
Forgive my ignorance, i have no idea how to test without opitboot but as i have an Arduino Uno im guessing i am running optiboot if as one of the previous posters mentioned this is default on my unit.
All pins 0 through to 13 work fine on a simple blink
As expected, running fade causes a correct fade on pins 3, 5, 6 and 11 and replicates a blink effect on pins 0,1,2,4,7,8,12 and 13
Fade running on 9 and 10 does nothing. Not even a slow fade effect. Somewhat disappointed when i am just learning the basics and already run into this issue. Until i found this thread id assumed i had a duff unit.
Not even had a chance to look round the rest of the forums yet.
Edit: Bah in the time it takes me to look up this issue, mull what im going to say and finally send someone posts a fix, trying it now :-/
Edit: Working fine on all analogue pins now, thank for the help.
It's too bad this thread didn't get more attention back before Uno was released. I guess not enough people were using (or expected to be using) optiboot...