AN2690 Freescale Semiconductor / Motorola, AN2690 Datasheet - Page 13

no-image

AN2690

Manufacturer Part Number
AN2690
Description
Low Frequency EEPROM Emulation on the MC68HLC908QY4
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Main Flow Diagram
MOTOROLA
NOTE:
Low Frequency EEPROM Emulation on the MC68HLC908QY4
The code checks the PROG_EEPROM_FLAG at the start of the each iteration
of the loop. If this bit is set, it forces a reset, starts up from the internal oscillator,
programs EEPROM, switches back to the external crystal, and resumes
execution from the start of the loop. If the application is powered down and then
switched back on, the last saved pattern is restored. This demonstrates that
data was actually stored to emulated EEPROM. If the power was removed
before the switch was pressed, the code starts by switching on the first LED
(D8). The application has been implemented such that any other reset returns
the LED sequence to the start (LED D8 on).
The following sections list the code, which has been written in assembly
language for the HC08, and provide flow diagrams for each function. The flow
diagrams are shown first to help the reader understand the software.
The main function starts operating from the internal oscillator and performs
general initialization of registers, checks the source of reset and, depending on
the source, provides additional specific configuration. It then switches the clock
source to the external crystal, initializes the timers, enables the global interrupt
before entering an indefinite loop. The loop is timed by a 100 Hz timer overflow.
During each iteration of the loop, the status of the program EEPROM switch is
checked and, if a valid signal is detected, the PROG_EEPROM_FLAG is set
and a reset is forced using the STOP command. In addition, the LEDs are
updated every second to demonstrate that the program is running properly.
This flow diagram shows a specific implementation of the general flow diagram
shown in
Freescale Semiconductor, Inc.
For More Information On This Product,
Figure
Go to: www.freescale.com
1.
Appendix A: Sample Application
AN2690
13

Related parts for AN2690