USING THE ON-CHIP RAM OF THE INFINEON C167CR
Applies to: C166 C Compiler
Information in this article applies to:
- C166 Version 4.10a
- uVision2 Version 2.10
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?
In the Target Options dialog in uVision2:
Make sure Use On-chip CAN+XRAM is checked. Note that the
range of this memory is 0xE000-0xE7FF.
In External Memory, specify a RAM area with a starting address
of 0xE000 and a size of 0x800.
In External Memory, specify a ROM area which matches the amount
of ROM your target system has.
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.
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 ;
Article last edited on: 2005-07-09 11:00:08
Rate this article
Disagree? Move your mouse over the bar and click