Jump to content
  • 0

The direction of Col signals in PmodKYPD are output.


HomaGOD

Question

As for the point, I feel confused. In my understanding, Row signals and Col signals decides the excat pressed button together, thus they should all be input signals.

I wonder if there is any professional is kind to help me reply to confusion.

 

Thanks a lot.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

@HomaGOD,

Let's see ... when I built with the keypad, I used the COLumns as FPGA outputs, and the ROWs and FPGA inputs.  Here's how I went about reading it:

  1. First, output zeros on all of the COLumns.  This is the normal state of the keypad.  You'll sit here until something happens.
  2. If any of the ROWs, treated as inputs, produce a value other than VCC, then a button has been pressed.
  3. You can then output VCC on two of the COLumns.  If the ROW inputs don't change, then these two columns were not responsible for the button--repeat with the other two outputs
  4. Once you've narrowed down which two of the COLumns is responsible for the button press, you can set VCC out on three of the columns--the two unused (i.e. unpressed) ones, and the one that has been pressed.
  5. Your goal is to find the one COLumn, which when set to zero, leaves the ROW at zero--because the key is pressed.  That column plus the row then gives you the key you need.

Beware of bouncing!  Once the key is pressed, you will have to wait for it to settle before reading it.  Looking back over my notes, I waited for 100,000 ticks after registering the ROWs weren't all VCC before I went and tried to figure out which COLumn was responsible.

Also, this isn't the only way to handle the PMod keypad.  I remember doing this in college (decades ago ...) and reversing the directions of the pins in the process.  In this case, the pull ups can help you to know which way to go.  For example, the COLumns have no pull ups on them--so they work better as outputs than as inputs.

Dan

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...