Keil Logo

C166: USING THE ON-CHIP RAM OF THE INFINEON C167CR


Information in this article applies to:

  • C166 Version 4.10a
  • µVision2 Version 2.10

QUESTION

I have no external RAM on my C167CR target hardware. How do I use only the on-chip RAM of the C167CR for my programs?

ANSWER

In the Target Options dialog in µVision2:

  1. Make sure Use On-chip CAN+XRAM is checked. Note that the range of this memory is 0xE000-0xE7FF.
  2. In External Memory, specify a RAM area with a starting address of 0xE000 and a size of 0x800.
  3. In External Memory, specify a ROM area which matches the amount of ROM your target system has.
  4. The size of the on-chip RAM (0x800 bytes) is only 2 KBytes. This is smaller than the default user stack size of 4 KBytes. You must modify the user stack size in the STARTUP code and make it smaller than 2 KBytes. A value of 0x400 is a good starting point. Note that if you haven't already, you should copy the startup code from the \KEIL\C166\LIB directory into your project directory and work on that copy.
  5. The following C program demonstrates how to access the on-chip memory of the C167CR.
// This variable resides in on-chip XRAM (NDATA is mapped there)
unsigned char table [] = "1234567890";

// This variable resides in on-chip IDATA
unsigned char idata idat_var = 'A';

// This variable resides in on-chip SDATA
unsigned char sdata sdat_var = 'B';

void main (void)
{
volatile unsigned char xxx;

xxx = idat_var;
xxx = sdat_var;
xxx = table [0];
}

Last Reviewed: Saturday, July 9, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.