Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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
}



List of 28 messages in thread
TopicAuthorDate
LPC932 KBI Interrupt            01/01/70 00:00      
   nothing to do with KBI            01/01/70 00:00      
   Port is good!            01/01/70 00:00      
      whay do you not do as suggested?            01/01/70 00:00      
         I did it            01/01/70 00:00      
            below you talk about a 'stuck' interrupt            01/01/70 00:00      
   More details.            01/01/70 00:00      
      I have never used KBI, it serves no purp            01/01/70 00:00      
         That's my case!            01/01/70 00:00      
            you posted that interrupt DOES occur:            01/01/70 00:00      
               Do not get confused            01/01/70 00:00      
                  continuing            01/01/70 00:00      
                     EA is set            01/01/70 00:00      
                        so, you have an ICE, great            01/01/70 00:00      
                           ICE could affect KBI            01/01/70 00:00      
                              How is your P0 set up            01/01/70 00:00      
                                 forget it            01/01/70 00:00      
                                    ICE?            01/01/70 00:00      
                                       In Circuit Emulator            01/01/70 00:00      
                                          ICE            01/01/70 00:00      
                                             maybe it is ( to some extent?)            01/01/70 00:00      
                                                Yes            01/01/70 00:00      
                                                   Ok an emulator, (E) not an ICE            01/01/70 00:00      
                              as usual - divide and conquer            01/01/70 00:00      
                           Back on track            01/01/70 00:00      
                              you need to change something in the ISR            01/01/70 00:00      
                                 I Got it!            01/01/70 00:00      
         Does this help            01/01/70 00:00      

Back to Subject List