English
Language : 

MC68HC908GP20 Datasheet, PDF (178/406 Pages) Freescale Semiconductor, Inc – M68HC08 Microcontrollers
the location will be read as $FF (1111 1111 binary). (0s cannot be
programmed. 0s only result from the erase operation.)
To program and margin read the FLASH memory, use this procedure:
NOTE:
1. If operating voltage is below 3.6 V, set the PMPSGVLVEN bit in
the CONFIG2 register. (See 8.3 Functional Description.)
2. Set the PGM, FDIV1, and FDIV0 bits in the FLASH control
register. This configures the memory for program operation and
enables the latching of address and data for programming.
3. Read from the FLASH block protect register.
4. Write data to the eight bytes of the page being programmed. This
requires eight separate write operations.
5. Set the HVEN bit.
6. Wait for a time, tPROG.
7. Clear the HVEN bit.
8. Wait for a time, tHVTV.
9. Set the MARGIN bit.
10. Wait for a time, tVTP.
11. Clear the PGM bit.
12. Wait for a time, tHVD.
13. Read back data in margin read mode. This is done in eight
separate read operations which are each stretched by eight
cycles.
14. Clear the MARGIN bit.
15. Repeat steps 2 through 14 for each page until the data verifies.
While these operations must be performed in the order shown, other
unrelated operations may occur between the steps.
This program/margin read sequence is repeated throughout the memory
until all data is programmed. For minimum overall programming time and
least program disturb effect, the smart programming algorithm in Figure
11-2 should be followed.
Advance Information
178
MC68HC908GP20 — Rev 2.1
Freescale Semiconductor