Having trouble with interrupt priority level

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Having trouble with interrupt priority level

1,990 Views
mbrown
Contributor I
I'm trying to enable and disable interrupts on my MCF5282.  I'm doing:
 
void
interrupt_enable()
{
 printf("interrupt enable\n");
 asm {
  move.l #0x00002000,d0
  move.w d0,SR
 }
}
void
interrupt_disable()
{
 printf("interrupt disable\n");
 asm {
  move.l #0x00002700,d0
  move.w d0,SR
 }
}
 
When I call these functions manually, everything is OK.  However, when I go into an interrupt (from the FEC) and attempt to disable further interrupts, I call the disable function but interrupts never stop.
Does anyone know what is happening here?
Labels (1)
0 Kudos
Reply
3 Replies

604 Views
rocco
Senior Contributor II
Hi, mbrown:

Are you sure they "never" stop? Could they be stopping for the duration of the ISR, but then being re-enabled when the ISR exits?

The SR is stacked by the interrupt, and will be restored by the interrupt-return. If you changed it within the ISR, it will still be restored to what it was prior to the interrupt, upon the completion of the ISR.

If you want to change the value that the SR will be when the interrupt exits, you can modify the value that was pushed onto the stack.
0 Kudos
Reply

604 Views
mbrown
Contributor I
rocco, I think you're right.  I was not realizing that the SR gets pushed to the stack and then restored after the interrupt.  So the effect is that interrupts are only being disabled for the time the coldfire is processing the interrupt. 
Thanks for the help.
0 Kudos
Reply

604 Views
PaoloRenzo
Contributor V
Maybe your Ethernet's interrupts are configured as interrupt level 7 (unmaskable). Only guessing
0 Kudos
Reply