??? 11/05/08 08:12 Read: times |
#159707 - reading flash problem Responding to: ???'s previous message |
Hello,
when you set the SFR bit (whatever the bit is in your processor) the flash becomes xdata. thus to write flash from xdata you must read the xdata storing the result in RAM (NOT xram) with the bit off, switch the bit on and then move the local value to flash. That's for writing value to flash ? not for reading ? My problem is for the part of code for reading value from flash. Part of code for reading : PART C -- read test string to FLASH memory at address 0x1000 and copy in tab eedata EA_save = EA; EA = 0; pwrite = 0x1000; FLSCL |= 0x40; PSCTL = 0x00; while (*pread !=' ') { *eedata = *pread; // copy byte pread++; // advance pointers pwrite++; } PSCTL = 0x00; // MOVX writes target XRAM FLSCL &= ~0x40; // disable FLASH writes/erases from // user software EA = EA_save; // re-enable interrupts Thanks Regards |