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”
“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”?