| ??? 11/05/08 09:33 Read: times |
#159720 - i correct my code Responding to: ???'s previous message |
Hello,
- When reading, you once more initialize the pwrite variable - shouldn't you initialize the pread variable? (1)
// PART C -- read test string to FLASH memory at address 0x1000 and copy in tab eedata
EA_save = EA;
EA = 0;
pread = 0x1000; (1)
FLSCL |= 0x40;
PSCTL = 0x00;
while (*pread !=' ') {
*eedata = *pread; // copy byte
pread++; // advance pointers
// pwrite++; (2)
}
PSCTL = 0x00; // MOVX writes target XRAM
FLSCL &= ~0x40; // disable FLASH writes/erases from
// user software
EA = EA_save; // re-enable interrupts
When reading, you are stepping a pread and a pwrite pointer - but you are not using the pwrite pointer.(2) - When writing data into the eedata[] array, you are not stepping forward in the array, but are always storing all data in the first entry, i.e. multiple writes to *eedata is the same as multiple writes to eedata[0]. How i do for put my value in eedata[0],eedata[1], .... ? I do not know how to do this Shouldn't you disable flash writes/erases after the write pass instead of waiting until after the read? I do not understand what you mean by that comment Thanks Regards |



