Jason Cortell

CodeWarrior masking additional interrupts on 56F803

Discussion created by Jason Cortell on Jan 1, 2008
Latest reply on Jan 3, 2008 by Pascal Irrle

I had a surprising (to me) problem with CodeWarrior on the 56F803. While running a slow, low-priority interrupt routine, CW masks all other peripheral interrupts by setting I1 in the status register high. This delays my SPI0 read interrupt sufficiently that I lose incoming serial data. I tried it with version 7.3 and 8.1.1a.

The slow interrupt handler uses #pragma interrupt saveall; the fast ones use #pragma interrupt.

I "fixed" it by putting asm(BFCLR #$0200,SR); at the start of the low-priority interrupt handler, but this seems like a bit of a hack, and I am concerned that there may be more involved.

Why did CW mask the interrupts, and what possible problems am I creating by un-masking them? Is there a compiler setting to change this behaviour?