Matrix Keypad routine


Closed Thread
Results 1 to 40 of 135

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OK NO NEED FOR THAT

    i've attach the latest version... which i thought i had posted here


    So the only thing you will have to do, is to add this simple line
    Code:
    DEFINE SCAN_ONCE 1
    And this should cure the problem.

    I have added this feature once i needed to scan a keypad with a timer interrupt... which is certainly the way to go for any Push-Button/Keypad entry anyways.

    Enjoy!
    Attached Files Attached Files
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Steve

    EXCELLENT!! Now everything works 100%!

    One last question:
    What is the debounce and autorepeat functionality as set by

    DEFINE KEYPAD_DEBOUNCEMS 200 ' debounce delay = 200 mSec
    DEFINE KEYPAD_AUTOREPEAT 1 ' use auto-repeat feature

    Thanks again!

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Let's say the user press on a specific key for awhile, the AUTOREPEAT feature should allow to scan/give you the Keypad scan each 200mSec.. handy? Not sure of it In your case, of course not.

    Debounce delay will be the delay the software will wait after a key have been pressed before to go out and giving you the right Key. On most tact-switch keypad, 100 mSec is more than enough, but.. the best way to know it, is to test it.

    Glad to know it's working now!
    Last edited by mister_e; - 14th June 2007 at 21:00.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    May 2007
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Steve

    Thus, am I right in saying that if I want the keypad scanner to interfere the least with the rest of the program execution, then I must switch the AUTOREPEAT OFF?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you don't define AutoRepeat, the program will spin in round until you release the keys.

    To make a short story Use AutoRepeat and SCAN_ONCE... i should have written that routine in a different way...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Maybe using Darrel's Instant Interrupts? Just an idea...

    When I have some spare time I'll try it to have a true multitasking keyboard scanner.

    Ioannis

  7. #7
    Join Date
    May 2007
    Location
    Harvest, Alabama
    Posts
    10


    Did you find this post helpful? Yes | No

    Question Pullup Resistor

    I have noted this discussion on Pull Up resistors. I am running the PIC18F series chip and it in the documentation says it supports a weak pull up setting internally in the chip. Could I get any discussion of this relative to the pull up resistors on Vcc. Also Pull Ups as I understand their function is to bring the voltage on the pin up a little so that when the transistor in the chip is triggered only slightly the pin will appear digitally to have tripped.

    As such what values do you think these resistors should be generally?

    If the support is internal, does this mean we still have to place the external resistors?

    Thanks to all.

  8. #8


    Did you find this post helpful? Yes | No

    Default

    I found this solution which was already in the forum, thanks

    Quote Originally Posted by mister_e View Post
    OK NO NEED FOR THAT

    i've attach the latest version... which i thought i had posted here


    So the only thing you will have to do, is to add this simple line
    Code:
    DEFINE SCAN_ONCE 1
    And this should cure the problem.

    I have added this feature once i needed to scan a keypad with a timer interrupt... which is certainly the way to go for any Push-Button/Keypad entry anyways.

    Enjoy!

  9. #9
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    This is an update to the PM version of Steve's Matrix Keypad routine.

    Steve added a SCAN_ONCE option after I converted it for PM.exe. And someone recently asked for an update to it. It took me so long to do it, I forget who asked.

    Note: This is for PM only. It will not work with MPASM.

    HTH,
    Attached Files Attached Files
    DT

Similar Threads

  1. calculator-like code entry with matrix keypad and display
    By Dennis in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 16th December 2009, 22:58
  2. Need help in matrix keypad coding
    By rano_zen06 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 24th May 2008, 13:16
  3. I2C PCF8574 4X4 Keypad routine
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th January 2007, 21:25
  4. Inconsistent output on a 4x4 matrix keypad
    By markcadcam in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 24th November 2006, 03:54
  5. very basic matrix keypad question
    By kitcat in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th July 2006, 21:33

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts