This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Strange Interrupt leads to Abort Mode

I've got a unexpected problem with Interrupts.
Would be nice to discuss it.

I use Timer0 to have about 16000 fast interrupts (FIQ) per second.
There is a AD-Conversation and a few lines of long long int aritmetic to compute. Inside this FIQ-routine there is a static counter. When it reaches 16000 it is reseted and a Software interrupt (SWI) is generated every second.

The SWI-routine has do to some computations and then to display it all on a special three wire conected display.

The programm does not work with 16000 Timer0 Interrupts per second.
It is terminated by Abort-Mode. This comes a little unexpected to my. The effect is gone if i turn down FIQ frequency downto 100Hz. Is it possible that interrupts create a stack overflow?

Should i post my code?

Parents
  • George,
    You are probably generating the SWI in the FIQ to speed up the handling of the results. But, at the same time you have the following instruction in the FIQ handler:

    while (!ADCSTA){}               // wait for end of conversion
    

    Have you measured the duration of the loop?

    In addition, if your FIQ handler generates a SWI, and the SWI generates an IRQ as you asserted (probably by setting the IRQ flag, then returning immediately?), then the FIQ and IRQ handling are asynchronous - how can you guarantee the integrity of the displayed results without a buffer?

Reply
  • George,
    You are probably generating the SWI in the FIQ to speed up the handling of the results. But, at the same time you have the following instruction in the FIQ handler:

    while (!ADCSTA){}               // wait for end of conversion
    

    Have you measured the duration of the loop?

    In addition, if your FIQ handler generates a SWI, and the SWI generates an IRQ as you asserted (probably by setting the IRQ flag, then returning immediately?), then the FIQ and IRQ handling are asynchronous - how can you guarantee the integrity of the displayed results without a buffer?

Children
No data