数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

PM0212 数据表(PDF) 13 Page - STMicroelectronics

部件名 PM0212
功能描述  How to program the STM8TL5xxx Flash program memory and data EEPROM
PDF  22 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

PM0212 数据表(HTML) 13 Page - STMicroelectronics

Back Button PM0212 Datasheet HTML 9Page - STMicroelectronics PM0212 Datasheet HTML 10Page - STMicroelectronics PM0212 Datasheet HTML 11Page - STMicroelectronics PM0212 Datasheet HTML 12Page - STMicroelectronics PM0212 Datasheet HTML 13Page - STMicroelectronics PM0212 Datasheet HTML 14Page - STMicroelectronics PM0212 Datasheet HTML 15Page - STMicroelectronics PM0212 Datasheet HTML 16Page - STMicroelectronics PM0212 Datasheet HTML 17Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 13 / 22 page
background image
PM0212
Programming STM8 Flash microcontrollers
Doc ID 022351 Rev 2
13/22
Block program operations can be performed both to main program memory and DATA area:.
Programming a block of main program memory:
The block program operation has to be executed totally from RAM.
The program execution continues from RAM. If the program goes back to main program
memory, it is stalled until the block program operation is complete. The DMA controller
can be programmed to perform a block transfer to Flash program memory, and put the
CPU in Wait mode.
Programming a block of data EEPROM:
The block program operation must be executed totally from RAM.
The programming can also be performed directly through the SWIM interface. In this case, it
is recommended to stall the device in order to prevent the core from accessing the Flash
program memory during the block program or erase operation. This can be done by setting
the STALL bit in the DM_CSR2 debug module register. Refer to the STM8 SWIM
communication protocol and debug module (UM0470) for more information.
Caution:
During a block program or erase operation, it is recommended to avoid executing
instructions performing a read access to program memory.
Caution:
If the number of written memory locations is higher than what is required in the block
program/erase sequence, the additional locations are handled as redundant byte write
operations.
If the number of written memory locations is lower than what is specified in the block
program/erase sequence, the block program/erase process does not start and the CPU
stalls waiting for the remaining operations to be performed.
Caution:
EOP and WR_PG_DIS bits of FLASH_IAPSR register are automatically cleared when a
program/erase operation starts.
Caution:
If a block program or erase sequence is interrupted by a reset, the data programmed in the
memory may be corrupted.
Standard block programming
The following sequence is required to perform a standard block program sequence (block
erased and programmed):
1.
Unlock the memory if not already done.
The UBC option byte can be read to check if the block to program is not in the UBC
area. If necessary, reprogram it to allow erasing and programming the targeted block.
2.
Write 0x01 in FLASH_CR2 (PRG bit active).
3.
Write all the data bytes of the block you want to program starting with the very first
address of the block. No read or write access to the program memory is allowed during
these load operations as they might corrupt the values to be programmed.
The programming cycle starts automatically when all the data in the block have been
written.
4.
Check the WR_PG_DIS bit in FLASH_IAPSR to verify if the block you attempted to
program was not write protected (optional)
5.
To check if the program operation is complete, poll the EOP bit in FLASH_IAPSR from
program memory. EOP is set to ‘1’ when the standard block program operation has
completed. To avoid polling the EOP bit, an interrupt can be generated when EOP is
set.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com