In order to be backards-compatible with old stuff, I have to interface an
old-style keypad. It has an array of 16 switches in 4 rows of 4. Each row of 4
has its own common input an each column of 4 has its own common output. A load
of diodes prevent any 'feeding back'. Basically, I drive one row low,
the others high, and check to see if any output line has gone low - if it has ,
I can debounce it and work out which key was pushed. I'm sure you get the
idea - it's vey old-school. Anyway..
I plug in my keypad and use some recycled old code, tweaked for the correct
ports/pins, to poll this keypad, (I will change it shortly to raise an interrupt
if any key is pressed, so I only need to poll then).
It doesn't work, so I check all the pinsels, directions etc. All seems OK.
Debugging shows that the software does not see the keypress when it reads in the
port.
I notice that an occasional key does in fact work, sometimes. Not one row or
one column consistently, (and so probably not a wiring/PINSEL/port error).
Out with the 'scope.
When a key is pressed, I can see the polling pulses on its output line, nice and
clear. With no switch pushed, there are still gungy, misshapen, rounded pulses.
Touching the scope pin with my finger introduces mains hum wobbles as well. The
output line is obviously high-impedance :(
Upon checking old hardware, there are specific pull-up resistors on the output
lines, but I don't need them now because the default PINMODE is to enable
pull-up resistors. Or so I read in the manual.
I tried spcifically setting the PINMODE0/1 to 0 to 'force' pullup -
still the same :((
Anyone else had this issue with aparrently non-working internal pullup
resistors?
Rgds,
Martin
LPC2378 GIO pullups
Started by ●July 3, 2012
Reply by ●July 4, 20122012-07-04
Hi Martin,
The tricky part of LPC23xx is the GPIOM bit in SCS register, which control whether the GPIO is under normal GPIO or FastIO.So, if you don't receive anything from GPIO (IOPIN or FIOPIN), better check the settings of the GPIOM bit.
By default, the PORT0 and PORT1 are controlled by normal/slow GPIO after RESET, while the rest ports are controlled by FastIO.
Regards,
-daniel
________________________________
From: mjames_doveridge
To: l...
Sent: Wednesday, July 4, 2012 9:42 AM
Subject: [lpc2000] LPC2378 GIO pullups
In order to be backards-compatible with old stuff, I have to interface an old-style keypad. It has an array of 16 switches in 4 rows of 4. Each row of 4 has its own common input an each column of 4 has its own common output. A load of diodes prevent any 'feeding back'. Basically, I drive one row low, the others high, and check to see if any output line has gone low - if it has , I can debounce it and work out which key was pushed. I'm sure you get the idea - it's vey old-school. Anyway..
I plug in my keypad and use some recycled old code, tweaked for the correct ports/pins, to poll this keypad, (I will change it shortly to raise an interrupt if any key is pressed, so I only need to poll then).
It doesn't work, so I check all the pinsels, directions etc. All seems OK. Debugging shows that the software does not see the keypress when it reads in the port.
I notice that an occasional key does in fact work, sometimes. Not one row or one column consistently, (and so probably not a wiring/PINSEL/port error).
Out with the 'scope.
When a key is pressed, I can see the polling pulses on its output line, nice and clear. With no switch pushed, there are still gungy, misshapen, rounded pulses. Touching the scope pin with my finger introduces mains hum wobbles as well. The output line is obviously high-impedance :(
Upon checking old hardware, there are specific pull-up resistors on the output lines, but I don't need them now because the default PINMODE is to enable pull-up resistors. Or so I read in the manual.
I tried spcifically setting the PINMODE0/1 to 0 to 'force' pullup - still the same :((
Anyone else had this issue with aparrently non-working internal pullup resistors?
Rgds,
Martin
The tricky part of LPC23xx is the GPIOM bit in SCS register, which control whether the GPIO is under normal GPIO or FastIO.So, if you don't receive anything from GPIO (IOPIN or FIOPIN), better check the settings of the GPIOM bit.
By default, the PORT0 and PORT1 are controlled by normal/slow GPIO after RESET, while the rest ports are controlled by FastIO.
Regards,
-daniel
________________________________
From: mjames_doveridge
To: l...
Sent: Wednesday, July 4, 2012 9:42 AM
Subject: [lpc2000] LPC2378 GIO pullups
In order to be backards-compatible with old stuff, I have to interface an old-style keypad. It has an array of 16 switches in 4 rows of 4. Each row of 4 has its own common input an each column of 4 has its own common output. A load of diodes prevent any 'feeding back'. Basically, I drive one row low, the others high, and check to see if any output line has gone low - if it has , I can debounce it and work out which key was pushed. I'm sure you get the idea - it's vey old-school. Anyway..
I plug in my keypad and use some recycled old code, tweaked for the correct ports/pins, to poll this keypad, (I will change it shortly to raise an interrupt if any key is pressed, so I only need to poll then).
It doesn't work, so I check all the pinsels, directions etc. All seems OK. Debugging shows that the software does not see the keypress when it reads in the port.
I notice that an occasional key does in fact work, sometimes. Not one row or one column consistently, (and so probably not a wiring/PINSEL/port error).
Out with the 'scope.
When a key is pressed, I can see the polling pulses on its output line, nice and clear. With no switch pushed, there are still gungy, misshapen, rounded pulses. Touching the scope pin with my finger introduces mains hum wobbles as well. The output line is obviously high-impedance :(
Upon checking old hardware, there are specific pull-up resistors on the output lines, but I don't need them now because the default PINMODE is to enable pull-up resistors. Or so I read in the manual.
I tried spcifically setting the PINMODE0/1 to 0 to 'force' pullup - still the same :((
Anyone else had this issue with aparrently non-working internal pullup resistors?
Rgds,
Martin