Hello Xiangjun Rong,
many thanks for your answer.
- it is possible that the 56F8322 and 56F8335 has the same problem but in my case it possibly has not appeared (because of code alignment --> NOPs in the example above)
- no, if the fast interrupt is disabled everything is o.k!
- the problem described in "EB813.pdf" is another problem and has nothing to do with my problem. I dont' use the "INTERRUPT_SAVEALL" and "INTERRUPT_RESTOREALL"-pragmas and the fast-IRQ is not interrupting another IRQ (there is no other IRQ aktiv, it is only one fast-IRQ aktiv, so the fast-IRQ is not interrupting another IRQ). And it is not a initialisation-problem!
- saving the LC register is no option for me because the fast IRQ should be as fast as possible (this is the reason why i'm using a fast IRQ. In my case, only the fast IRQ produces a CPU load from about 11,5%)
- what is the reason for your solution i should save the LC-register to the stack in the fast-IRQ? The fast-IRQ don't change or uses the LC-Register and the fast-IRQ is not interrupting another IRQ. Apart fom this saving LC-register is not possible because at the end of the fast-IRQ you have to restore the LC-Register back from the SP but after the "FRTID"-instruction it is not permitted to do something like this: "move.l x:(sp)-,lc" in the delay-slot of the FRTID-instruction.
I think it's a Problem with the "FRTID" instruction in association with an hardware-DO-loop (when an fast-IRQ is interrupting an hardware-DO-loop at the beginning or ending of the DO-loop and the fast-IRQ is executing the FRTID-instruction) and so, it is a bug in the chip. Maybe you would be able to inform the development department about the problem.
For me it means: Never use DO-Loops together with fast IRQs
I solved the Problem so:
- in time critical areas i duplicated the code with the "DUP" and "ENDM" preprocessor macro instead of using a hardware DO-loop. So the code execution is as fast as possible, but the code size is bigger. But code size is no problem for me because the flash is big enough.
- in no time critical areas i'm using a normal Loop instead of using a hardware DO-loop
Best regards
Ulrich Neumayer