LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-05-2010, 11:25 PM   #1
nathan
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

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

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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.
 
  


Reply


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


All times are GMT -5. The time now is 06:36 PM.

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