??? 11/04/08 13:36 Read: times |
#159628 - pread and pwrite... Responding to: ???'s previous message |
When writing, you initialize a pwrite variable.
When reading, you once more initialize the pwrite variable - shouldn't you initialize the pread variable? When writing, you end when you get to the zero-termination. When reading, you end when you get to the zero-termination, but did you write any zero-termination in the first place? When reading, you are stepping a pread and a pwrite pointer - but you are not using the pwrite pointer. And you are placing all reach characters at the start of the eedata[] array. After your read test, you have a code line saying: FLSCL &= ~0x40; // disable FLASH writes/erases from // user softwareShouldn't you disable flash writes/erases after the write pass instead of waiting until after the read? Please describe step by step what you have done to verify your code? Have you in your nice IDE checked byte-by-byte what value you read from the flash, and that said value is stored at the exact location where it is expected to be stored? |