AN2302 Freescale Semiconductor / Motorola, AN2302 Datasheet - Page 5

no-image

AN2302

Manufacturer Part Number
AN2302
Description
EEPROM Emulation for the MC9S12C32
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Program/Erase Time
Interrupts
MOTOROLA
The Flash program/erase state machine is clocked from a signal derived from
the microcontroller oscillator. The value of the Flash clock prescaler must be
chosen so that the frequency of the Flash clock, f
150kHz to 200kHz. The calculation of the prescaler value is performed by a
pre-processor macro in the software accompanying this paper. The time
required by the Flash state machine to program a single word is defined by .
Typical values for t
values for the oscillator frequency and the MCU internal bus frequency.
Whenever a non-volatile data variable is updated, an entire bank is
programmed. Thus if a bank is defined to be 32 words, the programming time
will be approximately 50 s x 32 = 1.6ms. The execution time of the software
controlling the programming process will slightly increase the actual
programming time beyond this value.
The time required by the Flash state machine to erase a sector is defined by
Equation 2.
Typical values for t
From the times calculated for programming and in particular erasing, it is clear
that the update of non-volatile data variables could interfere with the
performance of some time critical real-time applications. However the software
accompanying this paper allows the possibility to service interrupts whilst the
Flash is being erased or programmed. As the interrupt vector addresses
normally reside in Flash and the Flash is unavailable during programming and
erasure, an alternative approach is required. The solution adopted is to re-map
the RAM to the top of the physical address space, so that the interrupt vectors
are now located in RAM. The interrupt vector table is copied into RAM at the
normal vector table address. The interrupt handler routines must also be
executed from RAM and so the interrupt vectors must point to the RAM address
of the interrupt handler routines. As the amount of RAM may be limited, only
the most essential interrupts should remain enabled during programming and
Freescale Semiconductor, Inc.
For More Information On This Product,
EEPROM Emulation for the MC9S12C32
Go to: www.freescale.com
swpgm
era
are around 21ms.
are slightly under 50 s, depending on the selected
t
swpgm
t
Equation 1
Equation 2
era
f
NVMOP
9
f
4000
NVMOP
f
25
bus
NVMOP
is within the range of
Implementation
AN2302/D
5

Related parts for AN2302