Content originally posted in LPCWare by amrbekhit on Sat Oct 23 15:35:26 MST 2010
Hello all,
I've been using the IAP routines on the LPC11C14 and have some questions regarding its operation.
- According to the user manual, the IAP routines use the top 32 bytes of RAM. By "top" do they mean they use RAM locations 0x1000 1FE0 to 0x1000 1FFF, or do they mean 0x1000 0000 to 0x1000 001F?
- I have previously been using the IAP routines without any delays and have found that sometimes when calling the routines in quick succession, the processor will completely crash. I have since found that the erase time is 100ms and write time is 1ms. Adding a 1ms delay after a "Copy RAM To Flash" has solved the problem, but interestingly enough, no delay was needed after an erase. However, I was wondering whether the IAP routines provide any mechanism to determine whether they are busy or not? According to the user manual, the IAP routines can return BUSY (11), but I have never managed to get any of the IAP routines to return busy. I'd much rather use that rather than a delay.
- Even with the delays in place, I could still cause the processor to crash if I was overwriting the same 256-byte block without erasing between writes. What I was doing was initially erasing the sector, then filling a 256-byte RAM buffer with 0xFF, copying my data to the correct location and then writing the whole buffer. I would end up overwriting the same 256 byte block 32 times before I move onto the next block. However, if I fill my buffer entirely and then write it once, it all works fine. Why is this? I was under the impression that writing 0xFF to erased bytes is equivalent to doing nothing.
Thanks
--Amr