View previous topic :: View next topic |
Author |
Message |
kushb
Joined: 21 Sep 2005 Posts: 7
|
1,4,7 and * are not working in the keypad |
Posted: Mon Nov 14, 2005 9:07 am |
|
|
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
|
|
Posted: Mon Nov 14, 2005 9:26 am |
|
|
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
|
Reply - Mike |
Posted: Mon Nov 14, 2005 10:11 am |
|
|
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
|
|
Posted: Mon Nov 14, 2005 10:56 am |
|
|
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
|
|
Posted: Mon Nov 14, 2005 11:03 am |
|
|
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
|
|
Posted: Mon Nov 14, 2005 1:10 pm |
|
|
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
|
|
Posted: Mon Nov 14, 2005 10:45 pm |
|
|
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
|
|
Posted: Tue Nov 15, 2005 6:04 am |
|
|
Thanks PCM programmer and Mike
The problem has been fixed. There was a loose connectioin between B5 and keypad pin.
Thanks |
|
|
|