I am kind of green with Freescale micros. I have two somewhat related questions.
(1) My experience with Flash memory from other sources is that you are allowed to program a byte multiple times after erase. Each attempt cannot change any bit from 0 into 1. But you can leave any bit unchanged or change 1 into 0. An erased byte is $FF. For example, you can program it into $FE and subsequently, program the $FE into $FC. But you cannot change $FE into $FF or $FD without first erasing (the page containing) that byte.
Freescale “MC9S08QG8 and MC9S08QG4 Data Sheet, Rev. 1.01” Section 4.5.3 “Program and Erase Command Execution” (on age 45) says”
“NOTE
“Do not program any byte in the FLASH more than once after a successful erase operation. Reprogramming bits to a byte that is already programmed is not allowed without first erasing the page in which the byte resides or mass erasing the entire FLASH memory. Programming without first erasing may disturb data stored in the FLASH.”
Is this a Freescale canonical rule?
(2) When my code does not specify a value for NVOPT, CW5.1/P&E automatically programs the value $FE to Flash byte at $FFBF (NVOPT). When my code specifically sets NVOPT to be DC.B $FC, CW5.1/P&E programs that value correctly too. However, if my code sets NVOPT to be DC.B $FF or $FD, CW5.1/P&E always reports a “Programming and Verifying Address $FFBF Error”.
This seems to indicate that after erase, CW5.1/P&E always program $FFBF into $FE. If my code specifies a value for NVOPT, CW5.1/P&E tries to program the same byte again without erasing it first.
Is my deduction correct? Is CW5.1/P&E violating the rule: “Do not program any byte in the FLASH more than once after a successful erase operation”? Will CW5.1/P&E “disturb data stored in the FLASH”?
Message Edited by peg on 2007-01-2209:04 PM
Hi,
First, I think I need to stress again that P&E Microcomputer Systems is not owned or ran by Freescale Semiconductor.
CodeWarrior is owned and made by Freescale and include third party software.
If you think the third party package is not suitable for you, feel free to change it.
But before doing this, the user needs to think about the risk of maybe corrupting ONE bit in ONE byte READ only ONCE after reset, compared to WRITE EIGHT times in ONE byte that is read/WRITTEN HUNDRED times in the application.
On one hand, worse come to the worse, the part would still be secured. On the other hand, you just have a application crash/fire and/or injury/death of the user.
And, before someone comes with the "yeah, but when my car is broken, I bring it to the dealer and I don't care about what part fail"... If you add a DVD player/Phone holder/CB, the dealer won't have much power.
Warm Regards,
Alban.
Message Edited by mke_et on 2007-01-2206:51 PM
“Each time a single bit, byte, or word is programmed, a complete row of 64-byte flash cells sees the high voltage necessary for programming. This high voltage generates some stress to the complete row of flash cells, and this stress must be time limited to avoid damage. The next erase cycle resets this stress time to zero, and the cumulative program time restarts again from the beginning. According to the data sheet, as shown in Table 3 (omitted), this high-voltage stress must be limited to 10 ms between two erase cycles. See the data sheets for the correct values for each MSP430 derivative.
“The same 16-bit flash word cannot be programmed more than twice before the next erase cycle. Writing to one 16-bit word with two byte-wise programming cycles counts as two programming cycles. Single-bit over programming is possible only once, if the flash cell previously has been programmed 16-bit word wise.
“Writing to the same row too many times may result in write disturb, and erased bits will be programmed as well. This produces no physical damage and, after erase, the disturbed bits are programmable as before. No long-term effects are known.”