| ??? 07/06/06 14:11 Read: times |
#119739 - LPC932 KBI Interrupt |
Hi Erik I hope you read this message because I need some help. I need to create an Keypad Interrupt only when one (any) of two pins from port 0 are pulled high. This is what you wrote last time, but it is not working.
""The Keypad Interrupt function is intended primarily to allow a single interrupt to be generated when Port 0 is equal to or not equal to a certain pattern." Thus if KBPATN 0x22 KBMASK = 0x22 KBCON = 2 0x22 int 0x00 no int 0x02 no int 0x20 no int Thus if KBPATN 0x22 KBMASK = 0x00 KBCON = 0 0x22 int 0x00 no int 0x02 int 0x20 int use what works and just ignore what you do not want in the ISR Erik " can be found at http://www.8052.com/forum/read.phtml?id=94196 This is what I have but it is not working...can you help me? It is not generating an interrupt when either pin is pulled high. thank you
void keypad_init(void)
{
P0M1 |= 0x03;
P0M2 &= ~0x03;
P0 = 0x00;
KBPATN = 0x03
KBCON = 0x00; // pattern must not match
//KBCON &= 0xFE;
KBMASK = 0x00;
KBCON &= ~0x03;
IP1 &= 0xFD; // set isr priority to 0
IP1H &= 0xFD;
EKBI = 1; // enable keypad interrupt
}
|



