ARM Technical Support Knowledge Articles

USING THE ON-CHIP RAM OF THE INFINEON C167CR

Applies to: C166 C Compiler

Answer


Information in this article applies to:


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 uVision2:

  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 KEILC166LIB 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];
}

Article last edited on: 2005-07-09 11:00:08

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential