??? 07/06/06 19:33 Read: times |
#119774 - Does this help Responding to: ???'s previous message |
I use it. In my case I set a bunch of matrix drive lines low and if any key is pressed then the matrix receive lines which are normally pulled high, go low and thus trigger the KBI. Here is a snippet.
KBPATN = 0x4F; // Define pattern. KBMASK = 0x4F; // Define P0 pins that trigger int. KBCON = 0x00; // Pattern must not match. EKBI = 1; // Enable keypad interrupt. PCON |= 0x03; // Total power down. // ZZzzz.... // ZZzzz.... // ZZzzz.... // ZZzzz.... PCON &= 0xFC; // Power back up. KBMASK = 0x00; The input pins are P0.0 to P0.3 and P0.6. The KBI ISR looks like: void MainKeypadISR(void) interrupt 7 // using 0 { KBCON &= 0xFE; // Clear interrupt flag. EKBI = 0; // Disable keypad interrupt. } GB |