Weird DemoBoard LED behaviour (SOLVED)
simonl
Posts: 866
Hi All,
If I toggle pin 18, LED 18 and 19 light (19 is slightly less bright, and gets brighter if I toggle 19)! Both extinguish if I toggle 18 again. Same happens with 20 and 22.
I'm not sure if this is:
a) my program - probably, so I've attached it (see details below)
b) just my DemoBoard
c) something to do with the fact that these LEDs share pins with the VGA connector
I wonder if one of you'd mind running my code to see if you get the same behaviour?
The code:
Basically the code allows you to type commands, such as "Toggle 16", in (say) PST, and they get interpreted by the Prop - in this case it toggles the state of pin 16.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again
BTW: I type as I'm thinking, so please don't take any offence at my writing style
Post Edited (simonl) : 4/13/2009 10:26:49 PM GMT
If I toggle pin 18, LED 18 and 19 light (19 is slightly less bright, and gets brighter if I toggle 19)! Both extinguish if I toggle 18 again. Same happens with 20 and 22.
I'm not sure if this is:
a) my program - probably, so I've attached it (see details below)
b) just my DemoBoard
c) something to do with the fact that these LEDs share pins with the VGA connector
I wonder if one of you'd mind running my code to see if you get the same behaviour?
The code:
Basically the code allows you to type commands, such as "Toggle 16", in (say) PST, and they get interpreted by the Prop - in this case it toggles the state of pin 16.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again
BTW: I type as I'm thinking, so please don't take any offence at my writing style
Post Edited (simonl) : 4/13/2009 10:26:49 PM GMT
Comments
It's documented how to prevent that, but I can't remember where... the attached code lights individual LED's via individual cogs on a demo board... just a "play" program.
I commented it to death. That was for someone I knew would need it.
Ned
Edit: Just remembered... you can't leave the adjacent pin floating. You have to set it for output, Low so there's no path through the connected resistor.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
Post Edited (WNed) : 4/13/2009 10:15:59 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again
BTW: I type as I'm thinking, so please don't take any offence at my writing style
I'm guessing that the reason is indeed the shared pins - as not setting a direction on one of the shared pins means it's floating (?) and current can flow through?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.com
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again
BTW: I type as I'm thinking, so please don't take any offence at my writing style
That is correct, sir.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"They may have computers, and other weapons of mass destruction." - Janet Reno
I'd not call that floating! A not connected pin which is set to input is a floating pin. As input pins have a high impedance it depends on currents and electrical fields close to that pin what level you get when reading the INA-register. These fields can generate a voltage because the discharge rate of the high impedance input is very small (very low current).
An LED needs some mA for light emitting. The resistor value to ground is low and the fields don't transfer enough energy to charge a voltage high enough to light the LED.
So, according to the previous posts, the currency comes from a resistor which is normally used to mix the VGA signal. The current that drives P19 LED comes from P18 via this resistor (and the P18 resistor) which makes it light darker.