MOTOROLA
4-20
ON-CHIP MEMORY
M68HC11
REFERENCE MANUAL
also an implication that the data is not accessible to the end user for modification (i.e.,
the end user cannot erase the data by simply removing a battery or unplugging the
unit). The on-chip EEPROM of the MC68HC11A8 provides a convenient electronic
medium for nonvolatile storage of logged data.
4.4.6 Self-Adjusting Systems using EEPROM
One of the most interesting uses for EEPROM in an MCU system is to implement self-
adjusting or self-adapting systems. A fairly simple form of self-adaptation would be a
system that can calibrate or recalibrate a sensor as it ages. A more sophisticated form
of self-adaptation would be a system that can modify its behavior to perform a desired
task more efficiently as operating conditions change. The adaptation would be semi-
permanent so the modified behavior would be in effect the next time the system was
activated (as if the system had originally been programmed that way).
Any process-control algorithm that includes a feedback mechanism for monitoring re-
sults could potentially be programmed to improve itself through self-adaptation. Tradi-
tionally, process-control programs followed a fixed procedure, which was the result of
experimentation and development by engineers. The MCU is an excellent tool for such
work because it can quickly repeat complex sets of instructions, including precise tim-
ing, with flawless accuracy. Unfortunately, this type system often requires tight toler-
ances on other system components such as sensors and valves. Cheaper (less
precise) components could be used if the system provides for calibration, but calibra-
tion is often time-consuming and expensive. As technology advanced, some systems
were designed to automate the calibration process, thus making it practical to use less
precise system components. For these automated systems, the calibration step was
still performed outside the context of actual system use. With the M68HC11, it is prac-
tical to consider systems that systematically make small adjustments while monitoring
end results. Depending upon the application, the MCU could either suggest changes
to a human operator or directly modify process-control parameters to maintain opti-
mum end results. The nonvolatile EEPROM is a critical element in such adaptive al-
gorithms because it can save what has been learned over a period of time, even if
power is lost.
Consider using an adaptive algorithm in a system consisting of many tasks. High-pri-
ority tasks are executed quickly; whereas, low-priority tasks are delayed. One problem
is to decide which tasks are most important, which can be accomplished by noting how
many times a task was actually needed over some period of time. A second problem
is to find some nonvolatile way to maintain the list of high- and low-priority tasks. The
main loop could be programmed into EEPROM, or the main program could call tasks
indirectly through a list of task addresses in the EEPROM. A background program
could monitor the activity and demands of various tasks and rearrange the priorities to
match real application demands. As a task requests more frequent service, it could be
elevated in priority, and as a high-priority task reduces its frequency of requests, it
could be lowered in priority. In this manner, the tasks requiring the most frequent ser-
vice would become the set of tasks that are serviced on every main loop pass. Al-
though both the fixed priority and the dynamically adaptive priority schemes would
accomplish the same amount of work, the adaptive scheme is more responsive. Be-