Backwards I/O
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
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
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
·
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
Thanks,
AlanCF