HCS12XDP512: Global EEPORM Adressing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

HCS12XDP512: Global EEPORM Adressing

跳至解决方案
3,597 次查看
Pitsch
Contributor I

I’m porting code from HC12D60A to HCS12XDP512 (banked memory model).

 

By HC12 I could read addresses in the EEPROM using the global address modifier (@adress).

e.g. unsigned char ChannelID_EEPROM@0x0C00;

 

Using the global address modifier for accessing the EEPROM by the HCS12X (e.g. unsigned char ChannelID_EEPROM@0x13F000) don’t work.

 

 

How can I read absolute addresses in the EEPROM?

 

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
2,363 次查看
CrasyCat
Specialist III
Hello
 
constant addresses specified in the ANSI C source code are considered as logical addresses for the compiler.
Rather that defining the variable as:
  unsigned char ChannelID_EEPROM@0x13f000;
you have to use the corresponding logical address:
  unsigned char ChannelID_EEPROM@0xFC0800;
If you are uncertain on how to convert global into logical addresses, there is a tool
    {Install}\prog\hcs12xadrmap.exe which can help you to evaluate the corresponding logical address.
 
Just put the Global address in Global field and the corresponding address will be displayed in the Logical and XGATE edit box.
CrasyCat

在原帖中查看解决方案

0 项奖励
回复
2 回复数
2,364 次查看
CrasyCat
Specialist III
Hello
 
constant addresses specified in the ANSI C source code are considered as logical addresses for the compiler.
Rather that defining the variable as:
  unsigned char ChannelID_EEPROM@0x13f000;
you have to use the corresponding logical address:
  unsigned char ChannelID_EEPROM@0xFC0800;
If you are uncertain on how to convert global into logical addresses, there is a tool
    {Install}\prog\hcs12xadrmap.exe which can help you to evaluate the corresponding logical address.
 
Just put the Global address in Global field and the corresponding address will be displayed in the Logical and XGATE edit box.
CrasyCat
0 项奖励
回复
2,363 次查看
Alban
Senior Contributor II
Hi Pitsch,
 
Global Addressing require the use of "FAR" in C language to take into account the long address.
 
Cheers,
Alban.