KEYPAD Programming using Flowchart in PIC Micros

Arthur C

New Member
Hi guys , I'm trying to program a KEYPAD using a PICAXE 20M IC and Project board. I have seen elsewhere in manuals and on this website various basic codes to do the programming but wonder if anyone would have a FlowChart file that they could send me, or even just advice on how to use PIC MIcros to program, to use the KEYPAD for a 4 digit code, but I really want to use flowcharts as I dont understand 'basic'.

Many thanks in advance
Arthur
 

hippy

Ex-Staff (retired)
I am sure there have been flowcharts produced - I even recall producing at least one myself - but don't seem able to locate those.

The basic matrix technique is to raise the keypad column lines one at a time and see which row line is activated. From that one can determine which key was pressed.

To implement a 'security code' type project: Implement a routine which returns when a new key is pressed and check the correct key presses appear one after each other.
 

M.Hancock

New Member
I've attached the instruction booklet that came with the old PICAXE PIC Self assembly Lock Kit - which gives lots of information and an example flowchart for the software you'll need to make a keypad work.

Which brings me onto a related problem I wonder if anyone can help me with?

I have a GCSE student who has created a Keypad code lock but rather than having 4 outputs (the rows) feeding the keypad from the PIC and 3 Inputs (the columns) receiving the switch presses from the Keypad he has made his circuit with 3 Outputs and 4 Inputs. Looking at the schematic diagram of the keypad I can't see that this should make a difference but when he tests his circuit only the odd numbers on the keypad work. Using a bit of wire it's possible to take an input high at the right time to make the PIC think it is seeing an even number and register it (so I'm fairly sure it's not his code that's at fault) but it won't recognise the even number key presses on the key pad.

I've built these before with 4 outputs and 3 inputs and they work fine but I just can't see what the problem can be with it built the other way around.
 

Attachments

Technical

Technical Support
Staff member
This will work, but you would need to alter the program if you did this - post your amended program/flowchart so we can see how it is now attempting to work.
 

hippy

Ex-Staff (retired)
As the odd and even numbers on the keypad are interspersed on every row and column, having only odd numbers work suggests a software issue rather than a hardware one. Perhaps post the program code and someone may be able to figure out what is going wrong.
 

Technical

Technical Support
Staff member
The code looks ok in principle, have you put a logic probe/scope on the PICAXE output that drives the centre column of the keypad - this is the most likely cause of the issue (the centre column on the keypad never getting a correct high signal to start with).
 

M.Hancock

New Member
The code looks ok in principle, have you put a logic probe/scope on the PICAXE output that drives the centre column of the keypad - this is the most likely cause of the issue (the centre column on the keypad never getting a correct high signal to start with).
Hi, Sorry for the delay in replying - GCSE Mock exam week got in the way of him fault finding. The logic probe suggestion made him look at the wiring of his keypad to the PIC and he found he had two wires transposed. All working fine now and big smiles! Thanks again for your help.

Martin
 
Top