--- In , "David Rick" <davidlrick@y...> wrote: Thanks to everyone who replied, including several who sent me private email. It seems that the problem is DSP/BIOS breaking the C calling conventions for save-on-entry registers. I found and fixed the problem by changing my interrupt routine to save more registers before making a BIOS call. The difference is in the first argument passed to HWI_enter and HWI_exit. C55_AR_DR_BIOS_CONTEXT_MASK (defined in C55.h55) should save the ARn and Tn regs that BIOS might modify, but it doesn't do the job. Apparently BIOS is not saving the context of some registers that aren't in this mask. Here's the original routine: CWadcHalf: ; ADC half buffer full ISR ; Hooked to HWI_INT18 in HWI module of GUI ; This calls the first decimation filter via SWI HWI_enter C55_AR_DR_BIOS_CONTEXT_MASK, C55_ACC_BIOS_CONTEXT_MASK, C55_MISC1_BIOS_CONTEXT_MASK, C55_MISC2_BIOS_CONTEXT_MASK, C55_MISC3_BIOS_CONTEXT_MASK, IER0DISABLEMASK, IER1DISABLEMASK AR1 = DMA_CSR0_IOPORT ; read DMA status to acknowledge XAR0 = #CWdecimate1 SWI_inc HWI_exit C55_AR_DR_BIOS_CONTEXT_MASK, C55_ACC_BIOS_CONTEXT_MASK, C55_MISC1_BIOS_CONTEXT_MASK, C55_MISC2_BIOS_CONTEXT_MASK, C55_MISC3_BIOS_CONTEXT_MASK, IER0RESTOREMASK, IER1RESTPREMASK Now here's how I changed it: CWadcHalf: ; ADC half buffer full ISR ; Hooked to HWI_INT18 in HWI module of GUI ; This calls the first decimation filter via SWI HWI_enter C55_ALL_AR_DR_REGS, C55_ACC_BIOS_CONTEXT_MASK, C55_MISC1_BIOS_CONTEXT_MASK, C55_MISC2_BIOS_CONTEXT_MASK, C55_MISC3_BIOS_CONTEXT_MASK, IER0DISABLEMASK, IER1DISABLEMASK AR1 = DMA_CSR0_IOPORT ; read DMA status to acknowledge XAR0 = #CWdecimate1 SWI_inc HWI_exit C55_ALL_AR_DR_REGS, C55_ACC_BIOS_CONTEXT_MASK, C55_MISC1_BIOS_CONTEXT_MASK, C55_MISC2_BIOS_CONTEXT_MASK, C55_MISC3_BIOS_CONTEXT_MASK, IER0RESTOREMASK, IER1RESTPREMASK Note that it is certainly DSP/BIOS screwing up, not my code. This HWI is the highest priority in my system, and the SWI that it posts can't run until the interrupt routine returns. Thanks again for the help. David L. Rick Hach Company |