Reply
Posts: 2
Registered: ‎09-01-2017

EFM8LB1 Port Mach interrupt error

When a Port Match interrupt occurs, i read the value of port & then want to disable the interrupt until the Port match (or mismatch ) condition re-occurs.i have taken reference from one of the demo codes of EF8LB1starter kit. 

SI_INTERRUPT (PMATCH_ISR, PMATCH_IRQn)
{
   // If the Port Match event occurred on S1, toggle LED_GREEN.
   if(S1 == 0)
   {
	  LED_GREEN = !LED_GREEN;
   }

   // If the Port Match event occurred on S2, toggle LED_BLUE
   if(S2 == 0)
   {
	  LED_BLUE = !LED_BLUE;
   }

   EIE1 &= ~0x02;                      // Disable Port Match interrupts to
									   // prevent multiple interrupts from
									   // occurring while the switches are
									   // pressed
}

However, when running this example, the interrupt is continuously regenerated.The flag never gets cleared[I can see in debug].

 

 

Please suggest a solution.

Posts: 182
Registered: ‎07-12-2016

Re: EFM8LB1 Port Mach interrupt error

hi @Punit,

 

What flag did you check the port match interrupt ? 

In fact, the demo code will disable Port Match interrupts to prevent multiple interrupts from occurring while the switches are pressed, and re-enable Port Match interrupt after releasing the switches.

 

Thanks

Posts: 2
Registered: ‎09-01-2017

Re: EFM8LB1 Port Mach interrupt error

You can check the demo code...even if the interrupt is disabled, the flag is not reset[registers viewed in debug] & the interrupts occurs continuously.

Highlighted
Posts: 3,100
Registered: ‎02-07-2002

Re: EFM8LB1 Port Mach interrupt error

Is this maybe an SFR page problem? Is EIE1 available when the page for the port match registers is selected?