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

1,4,7 and * are not working in the keypad

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



Joined: 21 Sep 2005
Posts: 7

View user's profile Send private message

1,4,7 and * are not working in the keypad
PostPosted: Mon Nov 14, 2005 9:07 am     Reply with quote

Hi,

I am using ACE kit. I have built a PCB involving an electromechanical display being controlled by the keypad that came along with ACE kit.

I have connected the keypad on port D and with pull up resistors on D1-D4. The problem is that the coloum Co which has 1 4 7 and * is not working. Rest other digits are being working fine and can be displayed on the electromechanical display.

When I designed the circuit on the bread board earlier all the rows and coloumns of the keypad were working fine but not on the PCB. I have compared the PCB with the breadboard circuit and there is no difference.

I wonder what could possibly be the problem is.
Please advice
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

PostPosted: Mon Nov 14, 2005 9:26 am     Reply with quote

I'm not sure what compiler version you are using, nor what processor you are using. Anyways, I had the same problem with a pic18f458 the other week with some of the newer compiler versions, i.e. PortD pins wouldn't work right. I did some reading and found that:

If TRISE.4 (Yes, TRISE) is '1', then your PORTD pins will act like a parallel port and override your desired I/O settings. So in your port setup routine, verify that TRISE.4 is indeed '0'; then your portD pins ought to work.
kushb



Joined: 21 Sep 2005
Posts: 7

View user's profile Send private message

Reply - Mike
PostPosted: Mon Nov 14, 2005 10:11 am     Reply with quote

Hi

I am using PIC 16F877A with PCW compilor.

Please advice where should I make the changes suggested by you.

I am not able to understand that why is it only the first coloum is not functioning. Can you throw some light on that?

Please advice

Thanks
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

PostPosted: Mon Nov 14, 2005 10:56 am     Reply with quote

Yeah, i just glanced at the I/O port section on the 16f877, and the TRISE.4 setting does apply for this chip as well.

I noticed in past compiler versions (around 5 versions ago) that i can get away with this, but it doesn't seem so forgiving now.
kushb



Joined: 21 Sep 2005
Posts: 7

View user's profile Send private message

PostPosted: Mon Nov 14, 2005 11:03 am     Reply with quote

Well I went through the device 16F877A and kbd.c

Please advice where is the I/o port section on 16F877A so that I can change the TRISE.4
MikeValencia



Joined: 04 Aug 2004
Posts: 238
Location: Chicago

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

PostPosted: Mon Nov 14, 2005 1:10 pm     Reply with quote

I'm not sure if the TRISE.4 issue is indeed your problem, but I would start by
putting in the very first line of your main() function:

set_tris_e(0x0X); // X corresponds to your 0000 1xxx on port E.

If port E is unused, then just try:
set_tris_e(0x0F);
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 14, 2005 10:45 pm     Reply with quote

The problem is likely going to be:

1. You have a broken wire between the Column 0 pin on your keypad
and the PIC.

2. You have the Column 0 wire connected to the wrong pin on the PIC
or on the keypad.

3. The #define statements in the keypad driver which define the
PIC pins used for the Columns do not match your hardware
connections.

4. You have mis-interpreted the schematic drawing or data sheet
of the keypad with regard to the connector pinout. The pin you
think is Column 0 is not really Column 0.

etc.
kushb



Joined: 21 Sep 2005
Posts: 7

View user's profile Send private message

PostPosted: Tue Nov 15, 2005 6:04 am     Reply with quote

Thanks PCM programmer and Mike

The problem has been fixed. There was a loose connectioin between B5 and keypad pin.

Thanks
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