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.

Along with this debounce schematic from http://robotgestation.com/SensorForce.html :

I came up with this for my application:

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 19:07. Reason: ST inputs

2. Did you find this post helpful? |

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. Did you find this post helpful? |

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.

4. Did you find this post helpful? |

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

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