Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-05-2010, 11:25 PM   #1
LQ Newbie
Registered: Aug 2009
Location: california
Distribution: fedora
Posts: 21

Rep: Reputation: 15
implementing matrix based keypad on x86 processor using GPIO's

Hi all,

I am new to this,

I need to control matrix 5x4 keypad, on a processor

i am doing by making one row low at a time, and keeping all other rows high,

by scaning coloums, the corresponding key value becomes low.

my problems is that it is taking much time to respond, like to make gpio

low to high and high to low...

any suggstions

Old 02-06-2010, 11:32 AM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
What you describe is the standard method used for decades. It sounds like your algorithm must be broken, and not actualy doing what you describe, or it is implemented poorly. I have use the method you describe on a lowly 8051 microcontroller, and still had plenty of CPU for other important stuff. One strategy I employed was to do the key scan in an interrupt routine that ran at about 10 Hz - 100 Hz; somewhere in that range, and stuffed keystrokes into a circular buffer. I'm sure this took less than 1 or 2 percent of the CPU. It should be easy enough to measure with a scope.
How are you accessing the actual IO? Is it controlled by an OS? Do you have to make a lot of system calls to perform the IO? What hardware achitecture?
Can you show us the code that you are using?

--- rod.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing time based file rolling jawaid Programming 5 09-11-2008 10:21 PM
Transmeta Crusoe processor support? Compatible with x86/i686 kernels/binaries? r00tb33r Linux - Hardware 6 06-07-2008 11:58 PM
How can I find if my processor type (x86) from the command line anuradha06 Linux - Software 3 12-15-2005 03:56 AM
Performing a Software Reset from Linux 7.2 to cause a reboot of the x86 processor esi-eric Linux - Hardware 6 07-06-2004 02:17 PM
implementing Class-based queue from a C program.. shrike_912 Programming 1 07-05-2004 01:01 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration