Keypad with hardware debounce


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588

    Default Keypad with hardware debounce

    I don't want to have PAUSE in my program,and I'd like to avoid using an interrupt for this if at all possible.

    18F44K22 @ 64MHz, Port D has ST inputs.

    Using this schematic from Mr. E's keypad thread:
    Name:  Keypad schematic.PNG
Views: 1492
Size:  418.7 KB

    Along with this debounce schematic from http://robotgestation.com/SensorForce.html :
    Name:  Keypad debounce.PNG
Views: 2254
Size:  46.6 KB

    I came up with this for my application:
    Name:  Keypad matrix with debounce.PNG
Views: 1466
Size:  12.1 KB

    I always used to have input pins pulled LOW, first time scanning them using HIGH as default.

    Anything stand out as a magic show waiting to happen?

    Robert
    Last edited by Demon; - 20th December 2014 at 20:07. Reason: ST inputs

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Keypad with hardware debounce

    Hi Robert

    I think the 100K resistor should be a 10K. If you read his calculations in the link you posted he uses a 10K. A 100k will
    give you around a 1 second de-bounce, which is very long for a keypad. Or, maybe I missed something?

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,588


    Did you find this post helpful? Yes | No

    Default Re: Keypad with hardware debounce

    That's even better 'cause I have a truckload of 10K. Should be able to scope this later to compare with un-debounced on the scope and Saleae.

    I'm really wishing for USB scope after fiddling for an hour trying to get that pic.

    Had concentrated of finishing up my Charlie-plex thread. Hoping to have time to fix it up into an article.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: Keypad with hardware debounce

    Hi Robert,

    I agree with mark_s, the resistor value in the diagram at http://robotgestation.com/SensorForce.html is incorrect. The 100k resistor with a 10uF cap will calculate to a 1 sec Time Constant (T). To yield a 10ms (T) with a 10uF cap a resistor value of 1k will be needed.

    Since you are using ST inputs and reading the DS on for the 18F44K22 the logic High input minimum is .8 VDD. Using the Universal Time Constant charge curve, to reach .8 Vs (VDD) from 0v the time will be 1.6 (T). The maximum logic Low for the ST input is .2 VDD. The Delta of the Low and High is 1.4 (T).

    If you use a 10k resistor with a 10uF cap (T) will be 100ms, so 1.4 (T) should work out to 140ms to rise to a minimum logic High on the PIC ST inputs.

    Regards

Similar Threads

  1. 8 bit parallel debounce routine
    By cncmachineguy in forum Code Examples
    Replies: 0
    Last Post: - 26th July 2011, 15:54
  2. TMR1 counter debounce?
    By jderson in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 20th March 2008, 21:19
  3. Debounce routine comments?
    By gebillpap in forum General
    Replies: 3
    Last Post: - 20th February 2008, 20:56
  4. Switch Debounce using a 10F chip
    By modifyit in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st March 2006, 06:22
  5. Debounce PULSIN?
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 6th March 2005, 15:45

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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