Using an MC9S12C64 in place of an MC9S12C32

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using an MC9S12C64 in place of an MC9S12C32

ソリューションへジャンプ
1,005件の閲覧回数
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

ラベル(1)
0 件の賞賛
1 解決策
730件の閲覧回数
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!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

2 返答(返信)
730件の閲覧回数
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 件の賞賛
731件の閲覧回数
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!
-----------------------------------------------------------------------------------------------------------------------