EBI with S12Xep100. how to declare a variable in the external memory

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

EBI with S12Xep100. how to declare a variable in the external memory

1,545 Views
vijay_v
Contributor I
Hi,
 
I am trying to get a Epson Display controller s1d13a05 interfaced to the s12xep100 chip (normal expanded mode operation). The 256K epson display controller's RAM is mapped to the CS0 range (starting at 0x400000)
 
I am using Codewarrior compiler and PE micro debugger
 
I am able to read and write to the display controller through a pointer (see below).
#define BASE_ADDRESS 0x400000
#define Display_Buffer (*(volatile unsigned char* far)(0x40000 + BASE_ADDRESS))
 
 
My question is how to declare a  variable in the mapped  external location. Below is the code which i am using. Please suggest me if there is any right way of doing this. Else should i change any compiler settings in the codewarrior.

#pragma DATA_SEG DISPLAY_RAM  //DISPLAY_RAM is defined in the linker .prm file for CS0 area
unsigned char far Display_Buffer[10][10];

the above code does not generate the GPAGE data properly.

Please help me.

Vijay V

 

 

 

 

Labels (1)
0 Kudos
2 Replies

451 Views
CompilerGuru
NXP Employee
NXP Employee
Use the __GPAGE_SEG qualifier in the segment pragma:


Code:
#pragma DATA_SEG __GPAGE_SEG DISPLAY_RAM

 
Also: search for __GPAGE_SEG in this forum and there is also a good
technical note on the subject (don't know the number by heart)

If you do not want the compiler to zero out the DISPLAY_RAM,
place it in a NO_INIT segment in the prm.
In the prm you may have to use 0x400000'G as address, to explicitly state
the address is global.

Daniel



0 Kudos

451 Views
vijay_v
Contributor I
Daniel,
 
Thanks for your timely help. Really solved my problem Great :smileyhappy:
 
Also thanks for the NO_INIT hint.
 
Thanks again
 
Vijay
0 Kudos