KeyPad 4X4 Error
Moderator: Benj
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
KeyPad 4X4 Error
Using keypad 4x4.
But Column 1, 2 signal is out. 3, 4 signal is nothing.
Sorry! english little.
I have Ghost & FC7 PIC.
But Column 1, 2 signal is out. 3, 4 signal is nothing.
Sorry! english little.
I have Ghost & FC7 PIC.
- Attachments
-
- Flowcode2.fcfx
- (13.73 KiB) Downloaded 253 times
Last edited by seokgi on Wed Aug 17, 2016 11:30 am, edited 1 time in total.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: KeyPad 4X4 Error
Hello,
Please could you attach your program that is demonstrating the bug.
Please could you attach your program that is demonstrating the bug.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: KeyPad 4X4 Error
Benj!!!
Thank you for your interest. This is not the people who use fc7. it's too hard.
Thank you for your interest. This is not the people who use fc7. it's too hard.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: KeyPad 4X4 Error
Hello,
Right your using pins A6 and A7 for those bits on the keypad.
In the device configuration settings (Build -> Project Options -> Configure Tab) your Oscillator is set to HS crystal oscillator which also uses pins A6 and A7.
If you need to use A6 and A7 then you will need to switch the oscillator type to INTOSC.
The INTOSC helper component available from the Tools -> Matrix Tools component menu will help you to configure the internal oscillator.
http://www.matrixtsl.com/wikiv7/index.p ... 38a5735b6e
If your using an EB006 then there is a jumper (J18/J19) which configures if A6 and A7 are connected to the on-board crystal (OSC) or the PortA I/O D-Type connector (A6&7).
Right your using pins A6 and A7 for those bits on the keypad.
In the device configuration settings (Build -> Project Options -> Configure Tab) your Oscillator is set to HS crystal oscillator which also uses pins A6 and A7.
If you need to use A6 and A7 then you will need to switch the oscillator type to INTOSC.
The INTOSC helper component available from the Tools -> Matrix Tools component menu will help you to configure the internal oscillator.
http://www.matrixtsl.com/wikiv7/index.p ... 38a5735b6e
If your using an EB006 then there is a jumper (J18/J19) which configures if A6 and A7 are connected to the on-board crystal (OSC) or the PortA I/O D-Type connector (A6&7).
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: KeyPad 4X4 Error
How about this Program. Use port B
- Attachments
-
- Flowcode2.fcfx
- (12.74 KiB) Downloaded 253 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: KeyPad 4X4 Error
Hello,
The second program looks like it should work fine.
Are you saying that pins B6 and B7 are also not doing anything?
The second program looks like it should work fine.
Are you saying that pins B6 and B7 are also not doing anything?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: KeyPad 4X4 Error
The second program is column 1 and 2 signal out. but 3,4 are no signal. i checked logic probe.
1,2 is pulse out 3,4 no signal.
1,2 is pulse out 3,4 no signal.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: KeyPad 4X4 Error
Hmm,
The C code all looks ok to me, specifically the "MX_UINT8 FCD_08c31_keypad_base1__GetIndex()" macro which is responsible for scanning the keypad.
I'm going to compile and put the code on a micro and double check that all the column pins are firing.
Your not using ICD are you, the default ICD pins on the 16F1937 are B6 and B7? Also are you programming via a PICkit or other programmer that could be interfering, B6 and B7 are the chips programming pins.
The C code all looks ok to me, specifically the "MX_UINT8 FCD_08c31_keypad_base1__GetIndex()" macro which is responsible for scanning the keypad.
Code: Select all
while (FCL_INDEX < 4)
{
switch (FCL_INDEX)
{
case 0:
{
#if (1) // 4 >= 1
FCP_SET(B, B, 0x10, 0x4, 1);
// #else
//Code has been optimised out by the pre-processor
#endif
break;
}
case 1:
{
#if (1) // 4 >= 2
FCP_SET(B, B, 0x20, 0x5, 1);
// #else
//Code has been optimised out by the pre-processor
#endif
break;
}
case 2:
{
#if (1) // 4 >= 3
FCP_SET(B, B, 0x40, 0x6, 1);
// #else
//Code has been optimised out by the pre-processor
#endif
break;
}
case 3:
{
#if (1) // 4 >= 4
FCP_SET(B, B, 0x80, 0x7, 1);
// #else
//Code has been optimised out by the pre-processor
#endif
break;
}
default:
{
}
}
Your not using ICD are you, the default ICD pins on the 16F1937 are B6 and B7? Also are you programming via a PICkit or other programmer that could be interfering, B6 and B7 are the chips programming pins.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: KeyPad 4X4 Error
Right the program wasn't running correctly for me because the PLL enable bit was set in the chips configuration.
I'm using a 19.6608MHz crystal on my hardware so the 4X PLL was multiplying the frequency too high to operate the device correctly.
Once I made this change I am getting spikes on all four column pins.
Here is the current project with the PLL disabled.
I'm using a 19.6608MHz crystal on my hardware so the 4X PLL was multiplying the frequency too high to operate the device correctly.
Once I made this change I am getting spikes on all four column pins.
Here is the current project with the PLL disabled.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 164
- Joined: Fri Jan 13, 2012 4:21 am
- Location: South KOREA
- Has thanked: 18 times
- Been thanked: 16 times
- Contact:
Re: KeyPad 4X4 Error
I solved.
Using column b0,b1,b2,b3
row c0,c1,c2,c3
That's OK!
But I still don't know. Why does not the Port B.
Thanks So Much !!! Benj!!!
Using column b0,b1,b2,b3
row c0,c1,c2,c3
That's OK!
But I still don't know. Why does not the Port B.
Thanks So Much !!! Benj!!!