
MOTOROLA
4-18
ON-CHIP MEMORY
M68HC11
REFERENCE MANUAL
progress could be redone to assure reliability.
Avoid unnecessary erasures of the CONFIG register EEPROM location. In a normal
system, the CONFIG register is established during the design of an end product and
does not change. In rare cases, the CONFIG register may be repro-grammed after a
gross system failure accidentally corrupts the intended value. One suggested tech-
nique for tolerating such errors involves starting the MCU in special test or special
bootstrap mode after any reset. The CONFIG register can then be evaluated and
changed if necessary. In this scheme, it is not appropriate to routinely erase and re-
program the CONFIG register. Changes should only be made when an error is detect-
ed, which minimizes the possibility of wearing out the CONFIG EEPROM location.
4.4.2 Using EEPROM to Select Product Options
In many applications, it is possible to provide for several product variations with a sin-
gle MCU ROM pattern. This variation allows a user to pay for a single ROM mask
charge and amortize the cost over a higher volume of end products. This variation also
reduces the customer’s inventory requirements by reducing the number of unique cus-
tomized MCUs that have to be stocked. Before the availability of on-chip EEPROM, it
was possible to include multiple program variations in a single ROM pattern. The ROM
program would determine the specific program variation to execute by reading some
unique value on an I/O port or by looking for unique devices in the memory map of the
finished system. An ideal place to store such optional identifiers is in the on-chip EE-
PROM. The on-chip EEPROM has some advantages over the previous methods. The
EEPROM method requires no I/O pins for option selection. The EEPROM method can
accommodate upgrades in the options after the end product is manufactured, and no
hardware changes are necessary. A common software technique is to program the
various tasks for an application as a series of subroutines, which are called in the de-
sired order by a main program loop. The main program loop is usually quite small, con-
sisting of little more than a series of jump to subroutine (JSR) instructions. If this main
loop is programmed into the on-chip EEPROM, it is relatively easy to modify the num-
ber and order of ROM routines to be executed.
4.4.3 Using EEPROM for Setpoint and Calibration Information
Another ideal use for EEPROM is for storage of setpoints or calibration information
that will not change often. In some older systems, this information had to be entered
each time a system was activated. By storing this information in EEPROM, the product
configuration and setup requirements can be simplified for the end user, and this data
can be maintained indefinitely without power.
An example of setpoint data would be the temperature setting of a home thermostat
or the setback schedule for a more sophisticated thermostat. The two alternatives to
storing this information in EEPROM are to require that the information be re-entered
after a power interruption or to provide relatively expensive batteries and power se-
quencing logic. The home thermostat example can also benefit from a calibration table
in EEPROM. There are many types of temperature sensors with various degrees of
accuracy and linearity; however, the most accurate and most linear devices also tend
to be the most expensive. Since the application dictates a minimum degree of accura-