下载

© Motorol
AN2400/D
Rev. 3, 07/2003
HCS12 NVM Guidelines
by Stuart Robb
Applications Engineering
Freescale, East Kilbride
Introduction
The HCS12 is the next generation of the industry standard 68HC12 16-bit
microcontrollers. The HCS12 is built around a high performance CPU with bus
frequencies of up to 25MHz, and is complemented by on-chip peripherals such
as timers, analogue-to-digital converters and advanced serial communications
modules such as CAN, SPI, SCI and IIC.
HCS12 microcontrollers incorporate advanced, third generation, non-volatile
Flash EEPROM memory that is used to store the application program code and
constant data. The Flash memory can be erased and reprogrammed many
times over and is ideally suited to the development phase of a product. Flash
memory is also suitable for the production phase as product inventories can be
reduced by having a common microcontroller for similar products. Any software
changes, upgrades or fixes can be implemented immediately during
production, without the delay and costs associated with a new ROM mask.
Furthermore, products in the field can be reprogrammed as required without
having to replace the microcontroller. Over the product lifespan, Flash offers
significant potential cost savings when compared to ROM.
Various sizes of Flash memory are available, from 32k bytes to 512k bytes, to
suit the requirements of different applications.
Most HCS12 microcontrollers also incorporate EEPROM that may be used to
store data variables. The EEPROM on HCS12 microcontrollers is constructed
using the same basic technology as the Flash memory.
This paper is intended to give the reader an understanding of how the non-
volatile memory (NVM) on the HCS12 works and guidelines on how best to
make use of it. Code snippets for all NVM user commands are included, in both
‘C’ and assembly language.
Freescale Semiconductor, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc
.
..
© Freescale Semiconductor, Inc., 2004. All rights reserved.