View previous topic :: View next topic |
Author |
Message |
janbbeck
Joined: 23 Dec 2010 Posts: 7
|
Trouble using touchpad functions with 12lf1822 |
Posted: Wed Dec 29, 2010 2:29 pm |
|
|
I am trying to simply get a touch sensing on two pins on my 12lf1822 to replace some qprox sensors I have used in the past.
I am basically using the code from the help file, but have had no success:
Code: |
void main()
{
#USE TOUCHPAD (PIN_A1='1')
char c;
enable_interrupts(GLOBAL);
while (TRUE) {
if ( TOUCHPAD_HIT() ) //wait until key on PIN_B0 is pressed
{
output_bit(PIN_A5,!input(PIN_A5)); //switch LED
c = TOUCHPAD_GETC();
}
}
}
|
This code gives me an "bad pin 97" error message from the compiler 4.116
if I change the touch pin to A4 it will compile. But it never senses a touch. I see no signal on pin A4 with my scope.
I need both pins to work, but can't get either one to work, apparently for different reasons.
Any ideas? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Dec 29, 2010 4:30 pm |
|
|
I get the same error. Report it to CCS, and give them a compilable
sample program. In other words, add the #include for the PIC, #fuses,
and #use delay() to your posted code. Tell them the compiler version.
A work-around option would be to compile the code with settings that
allow it compile OK. Then study the .LST file to see what the CCS
library code is doing. Then write functions in C to duplicate the
functionality of the library code. I don't have time to do this right now.
It's better if you can get CCS to quickly fix it in a new release. |
|
|
|