Hi all, I'm using an MSC1210 microcontroller (8052 based) and I've written a little test program for testing an external RAM. Normally it writes in every Kilobyte of memory the same number. For example, in the first Kilobyte its 0, in the second Kilobyte its 2 etc. The external memory is 64K, so normally it goes from 0 to 64 but when I read the memory it goes up to 32. After that things become messy. This is the software I've wrote:
#include<reg1210.h> #include<stdio.h> #include<stdlib.h> #include <string.h> extern void autobaud(void); xdata unsigned char test[65535] _at_ 0x0000; void main(void) { long int g, t,x; int i=0; MCON=0x00; CKCON=0x07; P3DDRL=0x55; P3DDRH=0x55; P3=P3|0x10; P3=P3&0xDF; autobaud(); for(g=0;g<=65535;g) // write to memory { test[g]=i/1000; i++; g++; } printf("ready\n"); for(t=0;t<100000;t++) { } for(g=0;g<=65535;g) // read from memory { x=test[g]; printf("%ld\n",x); g++; } while(1); }