Nice one !!!
Great documentation, and I particularly like the diode schema. As the old saying goes: "a real engineer is someone who can build something for 50 cents that any other dam fool can do for $2"
Given the price of a diode these days Vs an integrated circuit-based equivalent solution, you my friend, place considerable emphasis on that old saying.
Trent Jackson
Hmm, the post is an excellent job on the matrix keyboard projects. I am just thinking to myself if it is worth to get in the trouble to built all these switch and wirings when a PC keybord has more keys, is very reliable and cost nothing!
Of course you cannot embed it in your own shell, but that is another story.
Just my thoughts, over a very nice project.
Ioannis
Last edited by Ioannis; - 16th November 2008 at 21:26.
I can see the schema being ideal for "custom membranes" ...
It is a popular trend for even low-volume manufactures of electronic equipment to get membrane switches tailored to suit their own enclosures. They're DEAD cheap, and easy-to-install.
Trent Jackson
During the weekend I came to the conclusion that the project should be for 60 keys.
The reason is that it is simpler to workout a smaller keypad from a larger one. (at least in this case)
Just remove the unnecessary switches and diodes and you have the keypad already designed.
The software has also been changed a bit in order to work around the fact that 16F84A could not accomodate an array of 61 bytes.
So with this new solution I had it at work reducing also the code work space.
Now the software works with all combination of keypad from 4x1 to 4x15 (Rows x Columns)
I am attaching the file with the new version (Hardware & Software) sure that this will make life easier.
Al.
Last edited by aratti; - 17th November 2008 at 21:56.
All progress began with an idea
Hi Aratti,
You're doing a good job here, but there are a couple issues I'd like to bring up.
Don't shoot me.
While scanning the first row, you set PortB =16 which puts RB4 high and RB5-7 low.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3010" /><!---->
If someone accidentally presses keys 1.1 and 2.1 at the same time, you have a dead short across RB4 and RB5. If you have a small power supply it won't last long because the PIC will reset as soon as the voltage drops low enough. But if you have a strong power supply, somethings likely to smoke.
The problem can be overcome a couple ways, either by adding ~100 ohm resistors in series with each Row's pin. Or you can manipulate the TRIS register in your program instead of PORTB, and only allow 1 Row at a time to be in OUTPUT mode.
And, it would be allot nicer to have the Outputs on the lower bits of PORTB, and the Inputs on RB4-7.
Then you would be able to use the PortB Change interrupts to monitor the keypad, and you wouldn't have to keep scanning it all the time. You would then place all outputs to HIGH and when you get an interrupt, scan the rows 1 by 1 like normal.
HTH,
DT
Thank you Darel to have pointed out the problem, which I did noticed! I will modify the software to have only one output pin at the time on portB. The updated version will be posted tomorrow.
Thank againg for your promp notification.
Kind regards
Al.
All progress began with an idea
Bookmarks