ST10F272M-4Q3 STMICROELECTRONICS [STMicroelectronics], ST10F272M-4Q3 Datasheet - Page 39

no-image

ST10F272M-4Q3

Manufacturer Part Number
ST10F272M-4Q3
Description
16-bit MCU with 256 Kbyte Flash memory and 20 Kbyte RAM
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
ST10F272M
5.6
Note:
To restore the write protection bits it is necessary to reset the microcontroller or to execute a
Set Protection operation and write 0 into the desired bits.
In reality, when a temporary write unprotection operation is executed, the corresponding
volatile register is written to 1, while the non-volatile registers bits previously written to 0 (for
a protection set operation), will continue to maintain the 0. For this reason, the User
software must be in charge to track the current write protection status (for instance using a
specific RAM area), it is not possible to deduce it by reading the non-volatile register content
(a temporary unprotection cannot be detected).
To temporarily unprotect the Flash when the Access Protection is active, it is necessary to
set to ‘1’ the bit TAUB in XFVTAUR0. This bit can be set to ‘1’ only while executing from
Flash: In this way only an instruction executed from Flash can unprotect the Flash itself.
To restore the Access Protection, it is necessary to reset the microcontroller or to write at 0
the bit TAUB in XFVTAUR0.
Write operation examples
In the following, examples for each kind of Flash write operation are presented.
The write operation commands must be executed from another memory (internal RAM or
external memory), as in ST10F269 device. In fact, due to IBus characteristics, it is not
possible to perform write operation in Flash while fetching code from Flash.
Moreover, direct addressing is not allowed for write accesses to IFlash control registers.
This means that both address and data for a writing operation must be loaded in one of
ST10 GPR register (R0...R15).
Write operation on IBus registers is 16 bits wide.
Example of indirect addressing mode
Word program
Example: 32-bit Word Program of data 0xAAAAAAAA at address 0x025554
Double word program
Example: Double Word Program (64-bit) of data 0x55AA55AA at address 0x035558 and
data 0xAA55AA55 at address 0x03555C in IFlash Module.
MOV RWm, #ADDRESS;
MOV RWn, #DATA;
MOV [RWm], RWn;
FCR0H|= 0x2000;
FARL = 0x5554;
FARH = 0x0002;
FDR0L = 0xAAAA;
FDR0H = 0xAAAA;
FCR0H|= 0x8000;
FCR0H
FARL
FARH
FDR0L
|= 0x1000;
= 0x5558;
= 0x0003;
= 0x55AA;
/*Load Add in RWm*/
/*Load Data in RWn*/
/*Indirect addressing*/
/*Set WPG in FCR0H*/
/*Load Add in FARL*/
/*Load Add in FARH*/
/*Load Data in FDR0L*/
/*Load Data in FDR0H*/
/*Operation start*/
/*Set DWPG/
/*Load Add in FARL*/
/*Load Add in FARH*/
/*Load Data in FDR0L*/
Internal Flash memory
39/176

Related parts for ST10F272M-4Q3