ST10F272B_12 STMICROELECTRONICS [STMicroelectronics], ST10F272B_12 Datasheet - Page 44

no-image

ST10F272B_12

Manufacturer Part Number
ST10F272B_12
Description
16-bit MCU with 256 Kbyte Flash memory and 12/20 Kbyte RAM
Manufacturer
STMICROELECTRONICS [STMicroelectronics]
Datasheet
Internal Flash memory
5.6
Note:
44/188
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 bit 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.
Double Word Program is always performed on the Double Word aligned on a even Word: bit
ADD2 of FARL is ignored.
Sector erase
Example: Sector Erase of sectors B0F1 and B0F0 of Bank 0 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
FDR0H
FDR1L
FDR1H
FCR0H
FCR0H
FCR1L
FCR0H
|= 0x8000;
|= 0x0800;
|= 0x0003;
|= 0x8000;
|= 0x1000;
= 0x5558;
= 0x0003;
= 0x55AA;
= 0x55AA;
= 0xAA55;
= 0xAA55;
Doc ID 11917 Rev 3
/*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*/
/*Load Data in FDR0H*/
/*Load Data in FDR1L*/
/*Load Data in FDR1H*/
/*Operation start*/
/*Set SER in FCR0H*/
/*Set B0F1, B0F0*/
/*Operation start*/
ST10F272B/ST10F272E

Related parts for ST10F272B_12