HCS12XDP512: Global EEPORM Adressing

cancel
Showing results for 
Search instead for 
Did you mean: 

HCS12XDP512: Global EEPORM Adressing

Jump to solution
1,287 Views
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?

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
53 Views
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

View solution in original post

0 Kudos
2 Replies
54 Views
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

View solution in original post

0 Kudos
53 Views
Senior Contributor II
Hi Pitsch,
 
Global Addressing require the use of "FAR" in C language to take into account the long address.
 
Cheers,
Alban.