Hello,
The following program stores the string "This text..." in Flash EPROM.
It is copied into the RAM based string YourData[].
What is required is the word "const" ahead of the declaration.
#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */
char unsigned x;
char YourData[10];
const unsigned char MyData[] = {"This text is stored in Flash EPROM"};
void main(void) {
EnableInterrupts; /* enable interrupts */
for(;
{
for ( x = 0;x< 10;x++) YourData[x] = MyData[x];
__RESET_WATCHDOG(); /* feeds the dog */
} /* loop forever */
}
Was this what you were looking for?
Regards,
Ake