Page 1 of 2

Posted: Sun Oct 30, 2011 12:15 pm

Posted: Mon Oct 31, 2011 11:57 am
You can also refer to one of our DIY project Details Description and sample source code to understand more. The schematic also there, PR9-B. It uses exactly the same keypad.

Posted: Mon Oct 31, 2011 12:46 pm
Read it but I still don't understand.

Posted: Mon Oct 31, 2011 4:56 pm
As you can see in PR9-B Detail Description, the columns are pulled up to +5V and also been connected to PIC's I/O pins (RA0-RA3). Whenever one of these I/O pins is given signal LOW (0V), you will know that only the buttons located in that particular column will give LOW when it's pressed.

In other word, if the PIC sensed LOW from one of the I/O pins connected to rows, it must be the buttons linked to that particular column which is given LOW at that very moment. If you press on the buttons on other columns which are NOT given signal LOW, they'll only give HIGH because they are all pulled-up.

Posted: Mon Oct 31, 2011 6:44 pm
Does that mean that pins K5 - K8 are set as input and pulled LOW; K1 - K4 are set as input and set high. And when you press button 1 (example) C1 and R1 will connect. When that happens, the voltage will short to K5 instead of K1 because K1 is pulled up to high (internal pull up resistor). This will make the reading on K1 to show LOW from HIGH and at K5 HIGH from LOW. This way, I can read the keypad, right?

Posted: Tue Nov 01, 2011 7:07 am
low5545 WROTE:Does that mean that pins K5 - K8 are set as input and pulled LOW; K1 - K4 are set as input and set high. And when you press button 1 (example) C1 and R1 will connect. When that happens, the voltage will short to K5 instead of K1 because K1 is pulled up to high (internal pull up resistor). This will make the reading on K1 to show LOW from HIGH and at K5 HIGH from LOW. This way, I can read the keypad, right?

Nop, K5-K8 are set as output and K1-K4 are set as input. You dont need resistors at the output ports because the outputs of PIC are not "open-drain" or "open-collector". You might not need the 4x10K resistors as some of the input ports in PIC have "weak-pull-up" built in if you read your data-sheets carefully.

Allen

Posted: Tue Nov 01, 2011 9:48 am
Hi Allen, welcome back! And low5545, Allen is right about the connection. However, I'm not sure whether the PIC used in PR9-B has weak pull-up but apparently the diy project uses resistor to pull-up the lines.

Refer to Listing 3: All columns are pulled-up and the corresponding PIC pins are set as outputs. All PIC pins connected to rows are set as inputs. The process to detect button press is conducted column-by-column. If you want to detect any button in Column 1 (eg: Button 1), you'll have to set RA0 to LOW. Then test the input pins (RE1, RE0, RA5 and RA4). If Button 1 is pressed, Column 1 is connected to Row 1. Since Column 1 is set to LOW, Row 1 will get LOW signal and RE1 will detect LOW too.

Posted: Wed Nov 02, 2011 6:15 pm
If columns are set as input, rows are set as outputs (LOW). If a button is pressed, the current will short to the row and columns will get a LOW reading. If so, how can you determine the row of the button?