As a sidenote, this is how you place variables in banked flash:
For HCS12 you need to do the following (I assume the same applies to HCS12X):
- Add compiler switch -Mb for banked memory.
- Add compiler switch -CpPPAGE=0x30 to tell where PPAGE is located.
- Add the annoying file datapage.c to your project. It is located at something like
C:\Program\Metrowerks\CodeWarrior\lib\HC12c\src\datapage.c
- Manually set PPAGE_ADDR in this file to 0x30 or you are risking that Codewarrior suddenly goes bananas and treats the target as 68HC12 or whatever it is that has got PPAGE at address 0x35. It has happend to me several times. It ignores the value -CpPPAGE=0x30 and takes the value in datapage.c instead.
Not so fun to debug when the code starts to write random values to REFDV and there is a PLL filter present on the board...
- Use "far" when accessing the banked variables.
Message Edited by Lundin on 2006-09-2604:19 PM