EEPROMFLASH.pdf

(125 KB) Pobierz
Rev. 0, 9/03
56F83xx Lends
Hybrid
Applications
EEPROM
Capability
FlashEE
White Paper
Motorola 56F8300
Hybrid Controller
Family
MOTOROLA.COM/SEMICONDUCTORS
© Motorola, Inc., 2003
806750769.031.png 806750769.032.png 806750769.033.png 806750769.034.png 806750769.001.png 806750769.002.png 806750769.003.png 806750769.004.png 806750769.005.png 806750769.006.png 806750769.007.png 806750769.008.png 806750769.009.png 806750769.010.png 806750769.011.png 806750769.012.png 806750769.013.png 806750769.014.png 806750769.015.png 806750769.016.png 806750769.017.png
 
56F83xx Lends Hybrid
Applications EEPROM
Capability -- FlashEE
John L. Winters
Contents
Introduction ........................................1
1.1 Overview .........................................1
1.2 The Keys to FlashEE....................... 2
1.3 How the Keys Open the Way.......... 2
Using the Keys -- FlashEE on a 56F3xx
Device ....................................... 2
2.1 A Program Illustrates the Concept .. 2
2.2 The Program Explained .................. 4
Conclusion .........................................8
References ..........................................8
1. Introduction
1.1 Overview
Motorola has introduced a new class of hybrid MCU/DSP
devices addressing the needs associated with automotive,
industrial, consumer, motor control and other system control
applications requiring Flash memory and EEPROM
capability. These devices are the 56F8322, 56F8323,
56F8345, 56F8346, 56F8356, and 56F8357 parts,
collectively referred to as the 56F83xx family.
This report presents the architectural advantage offered by
the 56F83xx family of devices with respect to using its
on-chip Flash as EEPROM. It also recounts the method used
to demonstrate this capability and displays some of the source
code.
Why use on-chip Flash as EEPROM?
A control system may be required to store a variety of
information, including control information, calibration data,
phone numbers, data logs, temperature exteme data,
maximum velocity data, boundry GPS coordinates, and many
other types of data. This data may need to be updated by the
control system autonomously, perhaps in the field of
deployment, and may be required for the system’s self-
calibration. The information stored may need to be retained,
even when power is not supplied to the device. In many
applications, an EEPROM is required to store non-volatile
data; it could be eliminated if the 56F83xx’s on-board Flash
could be used to store all of this data. Using Flash to replace
EEPROM has been named “FlashEE in a previous Motorola
Application Note (please see Reference 1).
© Motorola, Inc., 2003
806750769.018.png 806750769.019.png 806750769.020.png 806750769.021.png 806750769.022.png
 
Using the Keys -- FlashEE on a 56F3xx Device
1.2 The Keys to FlashEE
The keys to unlock FlashEE reside within the Flash memory subsystem of the 56F83xx family:
A minimum of up to 10K write/erase cycles across temperature range; up to 100K is typical
A data Flash Memory Page size of only 256 words
No special voltages are required for Flash programming
1.3 How the Keys Open the Way
The Motorola 56F83xx family includes all three keys. But what if just one of these keys is omitted?
• Omit the first key and it will wear out the Flash before the normal life cycle of the product
• Omit the second key and the number of data words used up each time any parameter must be
updated will soon cycle through all available memory, resulting in a linear decrease of product
life
For example, if the page size was 8K and only 256 words needed to be written at once, then
most of the 8K words would be wasted and the product life would decrease by a factor of 16 ,
assuming equal memory sizes.
• Omit the last key and special voltages would be needed just to update data in FlashEE
There’s no need to do without any of these keys, since they are all built into the Flash Memory
subsystem of the Motorola 56F83xx family of devices.
2. Using the Keys -- FlashEE on a 56F3xx Device
2.1 A Program Illustrates the Concept
The tested, working C program at the end of this section has been used to train engineers using
FlashEE on a 56F83xx controller. Section 2.2 discusses the operation of this program in detail.
By writing such a simple program, it’s easy to use as a seed for more complex applications requiring
FlashEE. It can be cut/pasted into an application, tested, then scaled up to the data structure to be
saved. Integration would then meld the FlashEE technique into the application. This is a stand-alone
example which uses simple subroutines.
This simple example just writes one 16-bit word to the Data FLASH using the FlashEE technique.
When a page finally fills up, it is not used again until it is erased. This example then shows how to save
the value of a 16-bit word in a non-volatile manner using the FlashEE technique.
Why FlashEE 16 bits and not just one bit at a time? Since both the row size and the word size are 16
bits, each word may be written only once prior to erasing. Thus, if only one bit is be stored, it would
have to be stored in a 16-bit word. Repeated writes to a word without an erase can damage the Flash,
since the specifications would be exceeded.
Code Example 1 is a part of a larger program, which is available with all source code, including
subroutines. See Reference 3.
2
Best of DSP and MCU Worlds
Motorola
806750769.023.png 806750769.024.png 806750769.025.png 806750769.026.png
Using the Keys -- FlashEE on a 56F3xx Device
Code Example 1.
/* Using Flash as EEPROM on 56F836 -- Training Module */
#include "ssd_types.h"
#include "ssd_hfm.h"
#include "ssd_hfm_config.h"
#include "ssd_demo.h"
#include "ssd_hfm_clk.h"
#include "clock.h"
#include <stdio.h>
#include <stdlib.h>
// Flash configuration stucture
FlashConfig flashConfig =
{
HFM_BASE,
HFM_CONFIG_BASE,
FLASH_CLOCK_DIVIDER,
false
};
UWord16 buffer[SOURCE_DATA_BUFFER_SIZE];
UWord16 main(void)
{
UWord16 Flash_bits; // as read from flash
UWord16 i; // Index
FLASH_TYPE flashType; // The type of flash block
UWord32 flashBaseAddr, // The base address of flash block
flashSize; // The size of flash block
UWord32 eraseBlkStartAddr; // The start address of flash block
UWord16 number; // Flash page number operation applicable
UWord32 source; // Source address for program and verify
UWord32 dest, // Flash start address operation applicable
size; // Flash size operation applicable
UWord32 Flash_p ; // Pointer to flash
// Set the vector base address
REG_WRITE(INTC_BASE_ADDRESS + INTC_VBA, 0x300);
// Set the PLL
SetPLL(PLL_PRESCALER, PLL_POSTSCALER, PLL_MULTIPLIER);
//=========================== Initialize HFM Module for Data Flash
===========================
FlashInit((UWord32)(&flashConfig));
flashType = FLASH_TYPE_D;
flashBaseAddr = DATA_FLASH_START_ADDR;
flashSize = DATA_FLASH_SIZE;
number = DATA_FLASH_SIZE / FLASH_PAGE_SIZE_D;
// Clear the all protect bits
FlashSetProtection((UWord32)(&flashConfig), flashType, 0x0000);
//=========================== Find unused flash word (=1)
===========================
for (Flash_p = DATA_FLASH_START_ADDR;
Flash_p < DATA_FLASH_START_ADDR + DATA_FLASH_SIZE;
Flash_p ++
) // if word is 0xfff it must be errased already:
MOTOROLA
Best of DSP and MCU Worlds
3
806750769.027.png 806750769.028.png 806750769.029.png 806750769.030.png
 
Zgłoś jeśli naruszono regulamin