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

How to use matrix keypad with IOC interrupts ?

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



Joined: 19 Jun 2017
Posts: 27

View user's profile Send private message

PostPosted: Sat Jul 08, 2017 3:40 pm     Reply with quote

temtronic wrote:
Check here...
http://www.ccsinfo.com/forum/viewtopic.php?t=26333&highlight=flexkbd

This is a 'flexible' version of the keypad driver. I'm currently using it for a couple of projects. The GREAT thing about it is how EASY it is to re-define PIC I/O pins to be rows and columns !
One warning...be sure to check the I/O pins as to whether they can be used for input or output or both. Some pins can ONLY be say input...so you can NEVER use them as an output.

If the link doesn't work, just use the forum search and enter 'flex_kbd', 4th or 5th hit is the flex driver.

Jay



Is there any way to implement it using IOC interrupt?
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 08, 2017 4:17 pm     Reply with quote

That PIC, which is 20+ years old does not have IOC available on PORT C, the port you said you wanted to use. It does have 4 pins on PORT B that does though. This is why reading the 400+ pages of a typical PIC datasheet is critical.
From a design aspect , you should choose a current PIC, if possible having 2 HW UARTs, lots of memory, fast internal clock..something like my 'goto' PIC the 18F46K22. You'll always need a few more bytes of memory and 2 I/O pins..Murphy's LAW of PICs !
Yes, the driver could be modified for 'interrupt' driven operation, though I can't cut code for awhile. Perhaps another person can show you how.

Jay
Alphada



Joined: 19 Jun 2017
Posts: 27

View user's profile Send private message

PostPosted: Sat Jul 08, 2017 5:09 pm     Reply with quote

Thx for the answer but i wasn't expecting exactly a code working out of the box, i have one example that works what i need is to learn how to ad the very basics aspects, some pseudo code or some tips so i can try it out my self.

btw Im not the OP i hope not to off topic his issue.
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 08, 2017 6:36 pm     Reply with quote

get a PIC, a KPD, 4 resistors and start cutting code ! Learn by doing, experiment, basic 'hands on the bench' schooling! Draw schematics, make notes, test, retest,code/compile/ try again. Build upon what you learn.
After 1/2 century of electronics and 1/4 century of 'playing with PICs', I still use breadboards and DIP PICs.
You could look at the 74c922 kpd encoder chip, see how it works, then get a PIC to emulate it.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 08, 2017 6:54 pm     Reply with quote

newguy posted a keypad routine that uses IOC interrupts in the code library:
http://www.ccsinfo.com/forum/viewtopic.php?t=19726
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