TC1784
Program Memory Unit (PMU)
User´s Manual
5-86
V1.1, 2011-05
PMU, V1.47
5.6.6.5
Application Hints and Guidelines
Every command execution is started with the last command cycle of the command
sequence, and it is indicated by the busy bit of Program Flash or Data Flash in the status
register FSR. Depending on the specific operation additionally one of the following status
bits may be set:
•
PROG indicating a requested, running or just finished program operation (page, User
Configuration Page),
•
ERASE indicating a requested, running or just finished erase execution (sector, User
Configuration Block)
The status bits have to be cleared by SW. It is thus possible to qualify the BUSY bits and
the OPER bits with the two status bits PROG and ERASE (see FSR description in
). Polling the BUSY bits show directly the termination of the specific
operation. The termination is additionally reported to the CPU by an end-of-busy
interrupt (if enabled in the FCON register). Because the termination could have been
also caused by a fault condition, the error flags shall be sampled after each command
sequence and after the termination of its execution. All error conditions are additionally
indicated to the CPU by an error interrupt, if enabled in the FCON register.
In summary a flash operation shall be controlled by the following process:
•
Write command sequence to Flash
•
Check for correct command sequence by sampling the SQER and PROER bits in
status register FSR, or install a proper error interrupt reaction.
•
In case of an indicated fault condition: clear the error flag with a Clear Status or a
Reset to Read command and start a specific SW reaction, for example a retry
operation. If no error:
•
In case of a Flash array operation: check, if the command has been correctly
requested by polling the PROG or ERASE bit in status register
•
Check, if the command is in operation by sampling the BUSY bit
•
When the execution of the command is finished (reported per interrupt or noticed per
polling the busy flag) check the VER and OPER flags; if one flag is set: see
for proper reaction; else: clear PROG or ERASE flag and continue
user program execution.
The status flags PROG and ERASE are cleared only with a power-on reset. It is therefore
possible to detect, if a program or erase operation has been interrupted by a warm reset.
Assumption: These flags are normally cleared by SW (with the Clear Status command)
immediately after termination of the operation.
In the following, some additional application hints and guidelines are presented, to be
considered by the user (some of them are already noted in other sections of the chapter):
•
User code, that writes command sequences to the Program Flash, should not be
executed from the same internal Flash module (because the Flash takes the busy
state with last command cycle); it shall be located in other internal or external
Содержание TC1784
Страница 1: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 3: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 950: ...TC1784 Direct Memory Access Controller DMA User s Manual 11 132 V1 1 2011 05 DMA V3 03 ...
Страница 1949: ...TC1784 General Purpose Timer Array GPTA v5 User s Manual 21 297 V1 1 2011 05 GPTA v5 V1 14 ...
Страница 2350: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG Doc_Number ...