Shop OBEX P1 Docs P2 Docs Learn Events
Weird DemoBoard LED behaviour (SOLVED) — Parallax Forums

Weird DemoBoard LED behaviour (SOLVED)

simonlsimonl Posts: 866
edited 2009-04-14 14:15 in Propeller 1
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 wink.gif
BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif

Post Edited (simonl) : 4/13/2009 10:26:49 PM GMT

Comments

  • WNedWNed Posts: 157
    edited 2009-04-13 22:09
    It is in fact because the pins are shared for VGA.
    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
  • simonlsimonl Posts: 866
    edited 2009-04-13 22:14
    Hey, thanks for the swift response Ned - I'll take a look at your code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    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 wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • simonlsimonl Posts: 866
    edited 2009-04-13 22:21
    Yay - solved it; I needed to set the direction of ALL the LED pins at once - using:
    dira[noparse][[/noparse]16..23]~~
    


    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 wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • WNedWNed Posts: 157
    edited 2009-04-13 22:34
    Simonl said...
    not setting a direction on one of the shared pins means it's floating (?) and current can flow through?

    That is correct, sir.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-04-14 07:20
    Because you have the question mark behind the 'floating', I think it makes sense to clarify that:

    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.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-04-14 14:15
    The way that the VGA is matrixed there will be back feeding of it's neighbour on the Red, Green and Blue pins. If the monitor is connected the backfeed voltage is insufficient to light the led. I have two seriesed diodes down to deck on the R,G,B. The 1V video is unaffected and 1.4V wont get a led going.
Sign In or Register to comment.