I'm converting a previous well-tested production design to banked memory (MC9S08DZ128 - CW 6.3) for the first time and I'm not sure what I must do with interrupts. My banked version is running but an uninvolved RAM variable is sometimes changed when executing a series of interrupts. I have the interrupt handlers non-banked, but is there any restriction on calling banked functions from the interrupt handlers?
Solved! Go to Solution.
Like Yong Li said, there's no restrictions calling banked functions from ISRs, provided you don't do in ISR anything smart like interrupt nesting or task switching (like in preemptive RTOS). In such smart cases you may need to save and restore PPAGE by hand. Failure to do so will most likely lead to runaway. "variable sometimes changes" could be caused by higher stack space requirement of banked application. Try increasing stack size.
Like Yong Li said, there's no restrictions calling banked functions from ISRs, provided you don't do in ISR anything smart like interrupt nesting or task switching (like in preemptive RTOS). In such smart cases you may need to save and restore PPAGE by hand. Failure to do so will most likely lead to runaway. "variable sometimes changes" could be caused by higher stack space requirement of banked application. Try increasing stack size.
Hi video_man,
There is no restriction on calling a banked functions from the interrupt handlers.
But, there are some work to do to place functions on a banked memory.
could you please refer to AN3730 which is available at:
http://cache.freescale.com/files/microcontrollers/doc/app_note/AN3730.pdf
Hope it helps!