Converting to banked memory (DZ128) - Interrupt question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Converting to banked memory (DZ128) - Interrupt question

Jump to solution
1,391 Views
video_man
Contributor III

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?

Labels (1)
0 Kudos
Reply
1 Solution
1,297 Views
kef2
Senior Contributor V

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.

View solution in original post

0 Kudos
Reply
2 Replies
1,298 Views
kef2
Senior Contributor V

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.

0 Kudos
Reply
1,297 Views
Rick_Li
NXP Employee
NXP Employee

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!

0 Kudos
Reply