Hi all,
I've been having strange problems using multiple PortA commands
so I did a very simple program (28X1 or 40X1):
---------------
main:
if porta pin0 = 1 then
sertxd("pin0 = 1"cr,lf)
endif
if porta pin1 = 1 then
sertxd("pin1 = 1",cr,lf)
endif
goto main
----------
you would expect that when "pressing" pin0 you'd receive
several "pin0 = 0" and when "pressing" pin1 you'd receive
several "pin1 = 1" BUT the thing is that when I press the
button connected to (porta) pin0 i get a series
of "pin0 = 1" AND "pin1 = 1" (?!?!)
without pressing the button associated with (porta) pin1 !
I used 47k pulldown resistors on pins 0 and 1 (I've also tried
with 10k and with no resistor at all)
I did the same but using adc0 and adc1 and I get the same
problem although I'm using only one pin the two react!
I've tried it on a 28X1 and on a 40X1, same problem!
I've checked connections with a multimeter and everything seems fine.
I've tried on the 40X1 the same approach but with the 4 pins a0 to a3
and they all mix up!
(What the heck is going on?)
I've used up all input pins on my 40X1 and I need to use 2 of the porta
digital inputs to check to buttons.
Many thanks!
Rui.
I've been having strange problems using multiple PortA commands
so I did a very simple program (28X1 or 40X1):
---------------
main:
if porta pin0 = 1 then
sertxd("pin0 = 1"cr,lf)
endif
if porta pin1 = 1 then
sertxd("pin1 = 1",cr,lf)
endif
goto main
----------
you would expect that when "pressing" pin0 you'd receive
several "pin0 = 0" and when "pressing" pin1 you'd receive
several "pin1 = 1" BUT the thing is that when I press the
button connected to (porta) pin0 i get a series
of "pin0 = 1" AND "pin1 = 1" (?!?!)
without pressing the button associated with (porta) pin1 !
I used 47k pulldown resistors on pins 0 and 1 (I've also tried
with 10k and with no resistor at all)
I did the same but using adc0 and adc1 and I get the same
problem although I'm using only one pin the two react!
I've tried it on a 28X1 and on a 40X1, same problem!
I've checked connections with a multimeter and everything seems fine.
I've tried on the 40X1 the same approach but with the 4 pins a0 to a3
and they all mix up!
(What the heck is going on?)
I've used up all input pins on my 40X1 and I need to use 2 of the porta
digital inputs to check to buttons.
Many thanks!
Rui.