Using an MC9S12C64 in place of an MC9S12C32

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

Using an MC9S12C64 in place of an MC9S12C32

Jump to solution
988 Views
bpaehr
Contributor IV

One of the projects that I worked on several years ago used an MC9S12C32 device.  I remember that I was running into a memory issue where I was overrunning the available Flash memory (0xC000-0xFFFF) by just a little bit.  I got around the problem at the time by consolidating some of the routines that handled sending text to my LCD, and that worked OK at the time.

 

Now I'm faced with making new changes to that code, which will certainly put me over the 16K requirement.  I'm not sure if I should try using 16K Paged memory at 0x8000 to 0xBFFF in the C32 device, or try replacing the C32 device with a C64 device.

 

1) If I were to replace my C32 device with a C64 device, will CodeWarrior automatically use the extra memory bank at 0x4000-0x7FFF without me having to do anything with any special Page registers?  How does the compiler know which device is the target MCU? (Sorry, it's been awhile...)

 

2) Would it be just as easy (no involvement or special definitions by me) to stick with the C32 device and use the Paged memory at 0x8000-0xBFFF?  If this is more desirable, what do I have to do in my C-Code to let the CodeWarrior compiler use this Paged memory? (I would just want to use one extra 16K Page, not worry about Page-Switching that bank of memory).

 

Thanks in advance for your help.

Bob P

Labels (1)
0 Kudos
1 Solution
713 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi BOB,

According to the datasheet 0x4000-0x7FFF is on chip 16k fixed Flash EEPROM for C64. this range of memory doesn't exist in C32.

pastedImage_1.png

If you need port a C32 project to C64. Basically we need at least:

1. replace prm file with a C64 prm file (create a new C64 project with wizard can generate a correct prm file )

2. replace header file with a C64 header file.

3. when launch hiwave debugger, change chip to C64 (debugger menu "HC12MultilinkCyclonePro", "Set derivative")

If you use banked memory model, the code can access page or non-paged memory with default access.

prm file is to define the memory allocation. User can modify prm file for own requirement

for example

pastedImage_2.png

in this prm file, the default code is allocated in PAGE_3A, PAGE_3B,PAGE_3C, PAGE_3D in order.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
713 Views
bpaehr
Contributor IV

Jennie:

Thanks!  That helps a lot.  I will probably go with the C64 route since there is little change in price between the C32 and C64.

Bob

0 Kudos
714 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi BOB,

According to the datasheet 0x4000-0x7FFF is on chip 16k fixed Flash EEPROM for C64. this range of memory doesn't exist in C32.

pastedImage_1.png

If you need port a C32 project to C64. Basically we need at least:

1. replace prm file with a C64 prm file (create a new C64 project with wizard can generate a correct prm file )

2. replace header file with a C64 header file.

3. when launch hiwave debugger, change chip to C64 (debugger menu "HC12MultilinkCyclonePro", "Set derivative")

If you use banked memory model, the code can access page or non-paged memory with default access.

prm file is to define the memory allocation. User can modify prm file for own requirement

for example

pastedImage_2.png

in this prm file, the default code is allocated in PAGE_3A, PAGE_3B,PAGE_3C, PAGE_3D in order.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------