CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

flex_keypad driver using #int_rb

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kmp84



Joined: 02 Feb 2010
Posts: 360

View user's profile Send private message

flex_keypad driver using #int_rb
PostPosted: Wed Sep 12, 2012 3:49 am     Reply with quote

Hi Friend !
Any driver for flex_keypad 4x3 using port b (RB7-RB4) interrupts instead of timer interrupt scanning?
Ttelmah



Joined: 11 Mar 2010
Posts: 19563

View user's profile Send private message

PostPosted: Wed Sep 12, 2012 4:22 am     Reply with quote

Realistically, using change interrupts for keyboards, does not work terribly well
Problem is that most keys _will_ give multiple contacts when pushed, normally make, break, make, break, make type patterns. This is why drivers implement debounce, which is always time based.
It would be possible to write a driver, where on the first contact, a time is read, but unless you know for sure that a key is going to produce the same number of make edges every time, you are back to having to read the key again a 'time' later....

Best Wishes
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Sep 12, 2012 5:37 pm     Reply with quote

I coded an 8x8 mini keyboard encoder several months ago as a subsystem in somebody else's design for a consumer communication device.
I had the luxury of using the full A and B ports on a 16f886 and sending key data via TTL/RS-232 to a host device responsible for the main heavy lift.

To have control of debounce and key repeat latency, its not just a good idea: it is essential to use a system timer for this.

and with that support - the key matrix is simply POLLED by sourcing from one port and doing a bit check on the other.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group