CX51: LOCATING CODE IN PHILIPS MX INTERNAL CODE MEMORY
Information in this article applies to:
I am using the Philips MB2 that provides up to 8MB code space. My application requires that the program code reside in on-chip Flash ROM (64KB) and the application constants (in this case fonts and bitmap images) reside in external Flash ROM (256KB).
I have read Application Note 160 that explains programming of the Philips 80C51MX devices. The memory class table under 80C51MX Address Space lists that variables defined in memory space far const go to the HCONST memory class. HCONST can be anywhere in the 8MB ROM space. I have also seen that implicit text strings go to far const when the CX51 directive STRING (far) is used (this directive can be specified in µVision under Project - Options for Target - CX51 - Misc Controls). Therefore, I have defined all fonts and bitmaps with the memory type far const.
I have entered all available memory in µVision under Project - Options for Target - Target and have selected Code ROM Size: Large: 64KB program. However, the linker MAP file tells me that the tools still locate far const into the on-chip Flash ROM space. How can I ensure that on-chip ROM is not used for far const variables?
In this case you cannot use the µVision Memory Wizard that converts the available memory ranges specified under Project - Options for Target - Target into Linker/Locater Memory Classes. This wizard defines all available ROM space for far const including the on-chip Flash ROM.
Instead, specify the memory regions of your application directly as memory classes in the µVision dialog page Project - Options for Target - LX51 Locate as described below:
Disable: Use Memory Layout from Target Dialog User Classes: EDATA (0x7F0000-0x7F04FF), /* on-chip RAM */ HCONST (0x810000-0x84FFFF) /* off-chip Flash for 'const far' */
Tip: You may copy the C classes created by the memory wizard as User classes and modify the address ranges.
Last Reviewed: Monday, July 18, 2005
of your data.