Here's a similar case from a bit over a year ago:
Re: MCF51JM Random ,extra output transition after input capture ISR,
My debugging suggestions in that one and in this thread still apply.
It could still be a hardware problem inside the CPU. The Coldfire chips (courtesy of the 68000 heritage) generate "strange" bus cycles during interrupts.
3.3.3 Exception Processing OverviewFor interrupts, the
processor performs an interrupt-acknowledge (IACK) bus cycle
to obtain the vector number from the interrupt controller.
The IACK cycle is mapped to special locations within the interrupt
controller’s address space with the interrupt level encoded
in the address.
With the 68000, the "address space encoding" was exposed, so it was well documented. In these chips, all the magic happens inside them, so the documentation is sketchy. In the case of the MCF52259 you can get a hint of what is going on by looking at the definitions of the RAMBAR and FLASHBAR registers. Read up on the C/I, SC, SD, UC and UD bits are for. The last four allow you to prevent all combinations of Supervisor/User and Program/Data accesses from working on that memory. So you could prevent code from executing out of the FLASH, or prevent user code or data from working. Apparently this can save power in some cases. The real mystery is the "C/I" bit. When the CPU generates an IACK, the only hardware you could ever want to be able to respond to that cycle is the interrupt controller. But the "C/I" bit seems to allow you to have the RAM of FLASH interfere with that. The MOVEC, WDEBUG and WDDATA instructions probably use the other C/I Address Space encoding too.
Having FLASH or RAM respond to C/I cycles doesn't seem like a good idea, and could be causing problems like the other posters are seeing. The following is in the manual:
These bits are useful for power management as detailed
in Section 12.3.2, “Power Management.”
In most applications, the C/I bit is set .
The take-home message is to make sure you have the "C/I" bit set in RAMBAR and FLASHBAR. If your CPU has a ROMBAR or MBAR (documented in CFPRM.pdf) you may want to check the settings of the C/I bit in these too.
Freescale have had other chips in the past that respond strangely to some combinations of these "control cycles" (MPC860 I think), so it isn't impossible that some "normal" set of bus cycles is generating a glitch in the GPIO module..
Tom
Message was edited by: Tom Evans. Again and again and AGAIN to try and get the "plain text" looking right. It looked OK in the Editor, and then looked nothing like in the post. Around and around again and again.