Strange PortA problem (28X1 and 40X1)

Pimenta

New Member
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.
 

eclectic

Moderator
Rui.

I've just tested your program, using an AXE022 board, with
a 28X1, then a 40X1. (both Firmware A.2)

(Minor typo :- you need an extra " , " in the first sertxd line.)

The program works on my setup.

BUT, using 10k resistors – 0v on ALL FOUR PortA pins (legs 2-5)

There is a technical explanation somewhere on the Forum,
but I can't find it at the moment.

Please let us know if this helps.

e.
 

Pimenta

New Member
Many thanks Eclectic!

Tomorrow I will try it (I don't have the hardware at home)

Did you get the same results has I did using 47k pulldown resistors?

or is my problem NOT having pulldown resistors on PortA pin2 and pin3?

I will report tomorrow

Again, thanks!

Rui

PS: the missing "," was just a typo :)
 

Pimenta

New Member
It's working!

Placing 47k resistors on ALL 4 Pins of PortA
did the trick!

Why is this needed in PortA?

Well.. thanks a lot!

Regards,

Rui
 

hippy

Ex-Staff (retired)
I did a search but couldn't find any previous discussion so -

Why does not having pull-downs on all Port A affect the digital pin tests on A0 and A1 which do have pull-downs ?

What if all but A0 and A1 were used for analogue and were impossible to pull-down or bring low ( battery voltage monitoring for example ) ? Does this mean A0 and A1 cannot be used as digital inputs in this case ?
 

BCJKiwi

Senior Member
Have a 28X1 FW v A.1

Current project on Breadboard with;
Port A0 - Digital on/off - with 10k pulldown and switch to v+
Port A1 - ReadADC10
Port A2 - ReadADC10
Port A4 - ReadADC10

All works as expected.
 
Top