Page 1 of 1

keypad

Posted: Mon Mar 19, 2007 2:02 pm
by Ganr
Im trying a simple setup to make my keypad work.

I've got the following datasheet for my keypad:
http://www.farnell.com/datasheets/73830.pdf

And with my 16f88 PIC I've created the following (europe symbols as far as i know :)). I've got my output LED's on port A and my input from my keypad on port B.

Image


My programming sounds like:
While 1
{
Keypad0.GetkeypadNumber --> number (result stored in number)
output "number" --> PORT A
}

Where my Keypad0 is set to PORT B with the following:
Collum 1: Bit 0
Collum 2: Bit 1
Collum 3: Bit 2
Row 1: Bit 4
Row 2: Bit 5
Row 3: Bit 6
Row 4: Bit 7

As far as i know im doing everything correct, but I have the problem that no key returns the correct value and keys "1,2,6,9,*,0" isnt doing anything. I've tried to replace the PIC and the keypad none of that worked, and i've tried to switch the pins arround to see what that did, it changed the output from the working keys but the rest still wont work.

Im quite lost here

Any know what i should do to make this work?

Posted: Fri Mar 30, 2007 2:23 pm
by Mark
Ganr,

I suggest you look at the wiring diagram of the keyboard you have. There is a fairly standard keyboard out there having a 3 by 4 array, i.e. 7 wire input but actually the internal wiring of the keyboard is very strange and which wire to connect were is not obvious. This may account for your results (i.e. are you sure the keyboard corresponds to the data sheet?).

Hope this helps

Similar issue

Posted: Thu May 24, 2007 2:22 am
by Richard_Barham
We are having a similar problem except it's almost the opposite of what you were seeing using the 16F877A, I was wondering if you ever solved the problem and how you did it. Everything in our project is working well except the keypad. we have quadruple checked the datasheet for the keypad and have tested it to ensure that we have the right pins. are using the same configuration as the E-blocks keypad. we have used two of the same type keypad, the simulation on flowcode works fine.

Posted: Thu May 24, 2007 9:13 am
by Steve
There is a minor problem with the keypad code within Flowcode that could account for your problem. The code scans the keypad too fast and if the wires to the keypad are long, then the keypad returns bad values.

I have modified the keypad code and an updated component will be available in the next release of Flowcode (hopefully on Friday).

Keypad problem

Posted: Thu May 24, 2007 11:24 pm
by Richard_Barham
Great, thanks that gives me something to work with. I was thinking maybe if I add a loop like while keypad=255 to keep it looking for an input that might do it. then maybe store the keypad value in EEPROM and read it once I exit the loop, I'll try it and check back, see how the update is coming and let you know how it worked.

Posted: Thu May 24, 2007 11:48 pm
by Richard_Barham
Well I guess if it's a problem getting the number that may not help.

Question: Keypad

Posted: Tue Oct 21, 2008 1:08 pm
by ZARCOV
Upon trying to get my keypad working, it seems that it scans the assigned port too quickly, not waiting for a key to be pressed.
Any sugestions?

Thanks

Marcus Brunetta

Re: keypad

Posted: Tue Oct 21, 2008 3:14 pm
by Benj
Hello Marcus

The keypad component performs the scan and then returns a value almost instantly. If this value is 255 then no key has been pressed. If you want to halt the program until a key has been pressed then use a loop icon to poll the keypad until the value returns is less then 255.

eg.

keypress = Keypad_Read_Ascii
loop while keypress = 255
{
keypress = Keypad_Read_Ascii
}

Re: keypad

Posted: Wed Oct 22, 2008 3:27 am
by ZARCOV
Hi Benj:

It worked fine :P

Regards

Marcus