AnsweredAssumed Answered

How to avoid Spurious Interrupt

Question asked by Rahul Sanghavi on Oct 25, 2015
Latest reply on Oct 25, 2015 by TomE

Hi, I am using Coldfire 5373 processor in my system.  System is using several MCU interrupts i.e. Serial, External Interrupt, timer , DMA, Ethernet. As per MCU datasheet, they suggest "first write a higher level interrupt mask to the status register, before setting the mask in the IMR or the module’s interrupt mask register. After the mask is set, return the interrupt mask in the status register to its previous value.".

Can any one suggest few sample code suggest as per MCU datasheet ? I tried  to disable interrupt as below but my system is still generating spurious interrupt & behavior isn't predictable when its happen.

 

Func1(void)

{

unsigned short interrupt_save;

 

//Disable Interrupt

interrupt_save = __GETSR();

__SETSR(interrupt_save | 0x0700);

 

Func2();

 

//Restore Interrupt

__SETSR(interrupt_save);

}

 

Thanks.

Outcomes