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 support@ccsinfo.com

Kaypad (12 Keys) on port C?

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



Joined: 15 Sep 2003
Posts: 36

View user's profile Send private message

Kaypad (12 Keys) on port C?
PostPosted: Wed Jan 26, 2005 4:03 pm     Reply with quote

Hello,

I would like to know if I can connect a 12 keys keypad to Port C on a PIC18F252, all examples uses port B... (I need port B for other things).

Thank you
Peter
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Jan 26, 2005 5:53 pm     Reply with quote

If you are not using interrupts, then you can do the same with portc. Note that you may have to add external pullups if the examples use the portb internal pullups.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 26, 2005 11:52 pm     Reply with quote

Note that the CCS driver, kbc.c, recommends putting pull-ups on
the column pins. This is not correct. They should be on the row pins.

The reason is that the driver sequentially sets each column line low,
then it reads the port and tests the Row pins. If a row pin is not
connected to a column pin (by the user pressing a switch) then the
row pin is left floating. You'll read an indeterminate state. That's
why the pull-ups must go on the row pins.

Also part of the time, the driver leaves the column pins in a Hi-Z state.
It's not good design practice to have floating CMOS inputs (at least for
any length of time), so ideally the column pins should have pull-ups on
them as well.

You can use 10K resistors for the pull-ups.
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