PDA

View Full Version : inputs are 0 all the time!



scorpion
- 20th May 2005, 02:10
Hi all. I really hope that someone can help me with this one!
my pic (16f72) is always seeing 0 on the inputs. I had a big elaborate program written(well for me anyways) but I am only using one input right now to test...... anyways here is my test code:

enone var porta.0
lightone var portb.2
led var portc.0

adcon0 = 0

i var word
i = 0
trisa = 255

main:
i = i + 1
if i = 2000 then
toggle led
i = 0
endif

if enone = 0 then high lightone
if enone = 1 then low lightone
goto main


the light is always on now. and if i switch the 0 and 1 its always off.
I also had a loop in there before if there was a 0 on that pin and it kept getting stuck in that loop. so i know it thinks there is a 0 on the input pins.
oh yea and i measured the pin so i know the 5v is there
thanks for any help you can give
-Scorp

scorpion
- 20th May 2005, 02:38
never mind
adcon1 = 7
i think ill stop posting here haha
-Scorp