Shop OBEX P1 Docs P2 Docs Learn Events
Backwards I/O — Parallax Forums

Backwards I/O

AlanCFAlanCF Posts: 6
edited 2008-06-25 23:44 in General Discussion
When I try to·set an output pin to 1 or use the HIGH command the output turns off, when I use LOW or 0 it turns on and when I detect an input IO it's also backwards. This happens with most of my programs, so I think it's the code.


Here's The Code:

' TESTB.SXB
DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ 4_000_000
LED1 PIN RA.3
PROGRAM Start
Start:
low LED1

GOTO Start

Thanks,

AlanCF

Comments

  • BeanBean Posts: 8,129
    edited 2008-06-25 21:46
    You probably have the LED connected backwards and the other lead connected to Vdd instead of ground.

    What do you mean by "when I detect the input IO it's also backwards" ???

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Uhhhm, that was on fire when I got here...

    www.iElectronicDesigns.com

    ·
  • PJMontyPJMonty Posts: 983
    edited 2008-06-25 22:24
    AlanCF,

    If you are following the standard way to hookup LEDs, then setting the bit to 1 will turn it off and 0 turns it on - exactly as you are getting. Normally people attach the LED to the positive power supply and then provide a path to ground through an output pin. If you followed virtually any schematics or directions on the 'net or in books, you'll find this is the normal way to attach LEDs (and pretty much any device you plan on enabling/disabling via a CPU).

    Thanks,
    PeterM
  • AlanCFAlanCF Posts: 6
    edited 2008-06-25 23:44
    Thanks, that worked! I see the way it works now, it's either VSS or VDD not·on or off.

    Thanks,
    AlanCF
Sign In or Register to comment.