Writing variables to nonvolitile memory using xdata
My MCU is ADuC841 it had (working with SDK)
62 kBytes on-chip Flash/EE program memory 4 kBytes on-chip Flash/EE data memory
I want to store variable that i get from the serial port and write them to the EEPROM then turn off, turn on the MCU and read them some how (print the stored variable to screen = Hyperterminal) or using interrupt that prints it to screen.
my code is working on the the simulator of keil i see the memory window but on then target MCU it doesn't work
My code:
unsigned char xdata large_array[20] _at_ 1500; unsigned int xdata timer_tick; void INT_EX0() interrupt 0 { puts(large_array); } void main (void) { while(1) { T3CON = 0x87; // 4800 T3FD = 0x08; SCON = 0x52; IT0 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2) EX0 = 1; // Enable EX0 Interrupt EA = 1; puts("\nEnter string :"); getline(large_array); // get string from serial port puts(large_array); // read from memory and output to serial port } }
the output of the MCU on Hyperterminal is something like all the char in ascii - "abcdefg...!@#$%^&*()..."
WHAT IS THE PROBLEM ??
Thanks in advance !!!
Mayer
My question is that - can i do wiritng to the EEPROM without all this registers by using XDATA or i must use those register
those amazing designers of chips just add all those SFRs because they think it is fun to do so.
Do you REALLY ASS U ME that all that is there "just to confuse you"?
Anyhow, there is, somewhere, a "manhandled" banking routine that makes an EE appear as a (painfully slow) bank of XRAM. Since I do not use it, my recollection is a bit fuzzy, but I think it is for an external EE so you will have to modify it to use and thus you must "use those registers".
Now I brought the subject up, I guess someone using it will locate it for you and, maybe, have some comments on it.
Erik