Hi Friends, I am new to ARM. I have a project where i am trying to interface the keypad with controller. After a try of two days i thought i will try to take help from you guys....if somebody can refer me to any tutorial on this subject ...going to be a great help for me. I have tried to find any application note based on this but in a vain never found any thing after lot of googling. Guys please help me! Just guide me to some site where they have discussed any matrix keypad interfacing with LPC2148 or any other ARM controller.
Thank you!
Are you familiar with any other microcontroller?
Do you understand the basic principles of how to scan a switch matrix? These principles will be independedent of what technology - microcontroller or otherwise - you use.
Have you spent time studying how to use the GPIO on an LPC2148? eg, blinking a LED (output) and detecting a single switch (input)? These, again, are fundamental principles - once you have mastered them, you should be able to apply them to the switch matrix problem...
There are plenty of examples of using the LPC2148 on this site, on the NXP site, and on many other websites...
Don't forget to check out the application notes, tutorials, etc, on the NXP site.
www.lmgtfy.com www.lmgtfy.com
LOL.
Google have thousands of descriptions of how to scan keypads. Must be hundreds of good descriptions.
And best of all - it doesn't matter what microcontroller, if we ignore microcontrollers that happens to have hardware-controlled keypad scanning.
After having isolated the code that sets pins and reads back states of pins, the code for scanning a keypad on a 8051 is just about identical to the code for an ARM or a MIPS or a PPC or a PIC or an AVR or a Z80.
So: 1) Learn the concept of how keypads are scanned. 2) Learn the relevance of debounce. 3) Learn the difference between handling single-key or multi-key presses. 4) Learn how _your_ processor configures processor pins. 5) Learn how _your_ processor sets processor pins. 6) Learn how _your_ processor reads back processor pins. 7) Learn how _your_ processor measures time (remember debounce?)
Combine, shake a bit and then test and release.
Don't see problems. See possibilities. This is a general exercise all schools have quite early in the microcontroller courses. That should be a hint that it is considered rather basic. I.e. not hard to learn. Not hard to do. And all the students are expected to manage the task on their own. Are you different from all the hundred thousands of students who does this exercise every year?
Thanks Per Westermark, I really appreciate your efforts! and thanks for this wonderful motivational speech.......thanks!
Thanks Andrew Neil, Thanks for those links it really helped me.....thanks a lot!
Those links simply showed you how to type key words like "switch matrix" into google, and press the 'Search' button.
Had it really not occurred to you to do that before?!
i was using the word like matrix keypad, interfacing keyboard with LPC2148..etc.
"interfacing keyboard with LPC2148"
Haven't you considered using the word "microcontroller" instead of "LPC2148"? As I did write, the concept and the algorithmic part of the source code is very little affected by used processor.
You get further by trying to break down problems into their smallest ports. So both looking about microcontrollers interfacing keyboards, and as a separate issue how to accessing I/O pins of LPC2148 (or maybe LPC21xx) and a third thing to look for good time delays for LPC21xx.
If you do google for "interfacing keyboard with LPC2148" you may get hits. You may get great hits. But you get much, much, much, much fewer hits than if you google for a more generic implementation. This means that if you are looking for code, you may find much more beautiful code. Much better working code. Much better documented code. Much better textual descriptions of the concepts involved.
In the end, the best code is not the first one you find. It's way better to get multiple options and figure out which code is written by the most competent developer. Even if that code requires you to perform minor modifications to port the code to your specific compiler or your specific processor.