English
Language : 

MC68HC912DG128 Datasheet, PDF (437/452 Pages) Motorola, Inc – Microcontrollers
Freescale Semiconductor, Inc.
Appendix: MC68HC912DG128A EEPROM
Programming EEDIVH and EEDIVL Registers
22.7 Programming EEDIVH and EEDIVL Registers
The EEDIVH and EEDIVL registers must be correctly set according to
the oscillator frequency before any EEPROM location can be
programmed or erased.
22.7.1 Normal mode
The EEDIVH and EEDIVL registers are write once in normal mode.
Upon system reset, the application program is required to write correct
divider value to EEDIVH and EEDIVL registers based on the oscillator
frequency. After the first write, the value in the EEDIVH and EEDIVL
registers is locked from been overwritten until the next reset. The
EEPROM is then ready for standard program/erase routines.
CAUTION: Runaway code can possibly corrupt the EEDIVH and EEDIVL registers
if they are not initialized for the write once.
22.7.2 Special mode
If an existing application code with EEPROM program/erase routines is
fixed and the system is already operating at a known oscillator
frequency, it is recommended to initialize the shadow word with the
corresponding EEDIVH and EEDIVL values in special mode. The
shadow word initializes EEDIVH and EEDIVL registers upon system
reset to ensure software compatibility with existing code. Initializing the
EEDIVH and EEDIVL registers in special modes (SMODN=0) is
accomplished by the following steps.
1. Write correct divider value to EEDIVH and EEDIVL registers
based on the oscillator frequency as per Table 22-1.
2. Remove the SHADOW word protection by clearing SHPROT bit in
EEPROT register.
3. Clear NOSHW bit in EEMCR register to make the SHADOW word
visible at $0FC0-$0FC1.
4. Write NOSHW bit in EEMCR register to make the SHADOW word
visible at $0FC0-$0FC1.
MC68HC912DG128 — Rev 3.0
MOTOROLA
Appendix: MC68HC912DG128A EEPROM
For More Information On This Product,
Go to: www.freescale.com
Technical Data
437