Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help 3x4keypad to PIC16F84A microcontroller

Status
Not open for further replies.
I agree with Nigel. There are plenty of examples for wiring and writing code for a multiplexed 3x3 or 3x4 keypad on PICLIST, in Nigel's tutorials, and elsewhere. If you had taken time to look at a couple of them you'd realize you don't really connect 5v to any of the lines. Instead you connect the column and row lines directly to pins on the PIC.

Mike
 
directly to PIC? but what will trigger the input if there no current flowing?
you can detect what button is press by ANDING right? but how did you know if its press when there is no current? or is PIC will give but its input not output.
 
use pull-down resistors, pull-up resistors or enable the internal pull-ups (if the port you are using has one).
 
Nigel,

I checked out your Keypad Tutorial and it does a very good job of covering the basics. It's obvious you put a lot of time and effort into providing newcomers with a wealth of information in a relatively easy-to-comprehend format.

Unfortunately, there seems to be a problem with your example Keypad code. It seems the four column lines are configured as outputs with one low and the other three high at any given time. I think this must have been an oversight because if you press a switch on the active low column and another switch on that same row at the same time you'll have a short circuit.

Mike
 
Mike said:
Nigel,

I checked out your Keypad Tutorial and it does a very good job of covering the basics. It's obvious you put a lot of time and effort into providing newcomers with a wealth of information in a relatively easy-to-comprehend format.

Unfortunately, there seems to be a problem with your example Keypad code. It seems the four column lines are configured as outputs with one low and the other three high at any given time. I think this must have been an oversight because if you press a switch on the active low column and another switch on that same row at the same time you'll have a short circuit.

To be 'foolproof' I would have added diodes to prevent that, but I wanted to keep it as simple as possible - as I try and do with all the hardware. The PIC is quite 'happy' like this anyway (pretty bomb proof devices) - although I completely agree it's not 'nice' :D
 
Nigel,

can i ask favor? can you post the diagram of the keypad together with the diode
so i can experiment with it including what type of diodes thank you nigel so it will be fool proof :)
 
Nigel Goodwin said:
To be 'foolproof' I would have added diodes to prevent that, but I wanted to keep it as simple as possible - as I try and do with all the hardware. The PIC is quite 'happy' like this anyway (pretty bomb proof devices) - although I completely agree it's not 'nice' :D
I don't mean to pick 'nits' but you don't need to add hardware (diodes) to make it foolproof, simply modify TRISB so that only one pin is an output (active low) at any given time. Here's a PICList example, though not a very good one;



Mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top