Hello. I've having difficulty using the on-chip SRAM for the DS5240 and the problem seems to rest in my compiler or linker config rather than my code. Here's my simple test program:
#include <stdio.h> #include <reg5240.h> unsigned char xdata buf[512] _at_ 0x0400; void main(void) { int i; /* setup serial port */ while (1) { printf("Write (%02bx, %02bx).\n", ACON, RAMST); for (i = 0; i < 512; i++) { buf[i] = 0xa5; printf("Wrote byte %d.\n", i); } } }
0x0000-0x03ff : RAM0 : Vector Memory 0x0400-0x07ff : RAM1 : Data Memory 0x0800-0x13ff : RAM2 : MAA Memory
View all questions in Keil forum