right now, i have an isr reading:
__interrupt voidKBI_ISR(void) {
//KBI1SC = cKBI1SC | cKBI1SC_Ack;
if(KBI1SC & 0b00001000) //test if KBF set
{
KBI1SC &= 0b11111101; //disable KBIE
//KBI1SC = cKBI1SC_Ack; //clear interrupt flag
KBI1SC |= 0b00000100; //clear interrupt flag
PWRLib_MCU_WakeupReason.Bits.FromKBI = 1; //set KB event flag
}
then, in main control, i read:
if (Res.Bits.FromKBI == TRUE )
{
LED4TOGGLE;
debounceCounter = 0;
while(debounceCounter<100)
debounceCounter++;
//while(debounceCounter<1000){;}
debounceCounter = 0;
/* IH_added functions to record keystroke */
if(!(PTAD & (1<<5))) keyPressed |= KB4;
if(!(PTAD & (1<<4))) keyPressed |= KB3;
if(!(PTAD & (1<<3))) keyPressed |= KB2;
if(!(PTAD & (1<<2))) keyPressed |= KB1;
//TOGGLE_EXT_LED;
//enable keyboard interrupts
KBI1SC |= 0b00000010;
keyState= KEY_PRESSED;
/* clear kb interrupt flag */
Res.Bits.FromKBI = FALSE;
}
in initialisation
PTAPE = 0b00111100;
PTADD = 0b00000001;
KBIPE = 0b00111100;
all this changes nothing because the PTAD pins stay at 00111100 all the time, none of the 4 1s ever drop to a 0. They stay 1s from beginning of startup to termination of program. I can generate the pushbutton event, but i never get any actual response in the ports. i cannot understand why it never drops to 0. Or better yet, its never 0 to begin with.
thanks.