전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

PM0054 데이터시트(PDF) 20 Page - STMicroelectronics

부품명 PM0054
상세설명  How to program STM8L and STM8AL Flash program memory and data EEPROM
PDF  28 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  STMICROELECTRONICS [STMicroelectronics]
홈페이지  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

PM0054 데이터시트(HTML) 20 Page - STMicroelectronics

Back Button PM0054 Datasheet HTML 16Page - STMicroelectronics PM0054 Datasheet HTML 17Page - STMicroelectronics PM0054 Datasheet HTML 18Page - STMicroelectronics PM0054 Datasheet HTML 19Page - STMicroelectronics PM0054 Datasheet HTML 20Page - STMicroelectronics PM0054 Datasheet HTML 21Page - STMicroelectronics PM0054 Datasheet HTML 22Page - STMicroelectronics PM0054 Datasheet HTML 23Page - STMicroelectronics PM0054 Datasheet HTML 24Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 20 / 28 page
background image
Programming STM8 Flash microcontrollers
PM0054
20/28
Doc ID 15433 Rev 9
5.3
Word programming
Both main program memory and data EEPROM can be programmed and erased at word
level. Word operations are performed in the same way as block operations. They can be
executed either from program memory or from RAM.
When a new word program operation starts, EOP and WR_PG_DIS bits of FLASH_IAPSR
register are automatically cleared.
Contrary to word programming of the Flash program memory, the word programming of data
EEPROM with RWW feature (when available) does not stop program execution. The EOP
bit can then indicate if the previous operation has completed. This bit is automatically reset
when reading FLASH_IAPSR.
The following sequence is required to perform a word programming operation:
1.
Unlock the memory if not already done. The UBC option byte can be read to check if
the word you want to program is not in the UBC area. If necessary, reprogram it to allow
programming the targeted word.
2.
Write 0x40 in FLASH_CR2 (WP bit active).
3.
Write 4 data bytes to memory starting with the first address of the word to be
programmed. The program cycle starts automatically when 4 bytes have been written.
4.
Check the WR_PG_DIS bit in FLASH_IAPSR to verify if the word 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
register. EOP is set to ‘1’ when the word program operation has completed. To avoid
polling the EOP bit, an interrupt can be generated when EOP is set.
Caution:
EOP and WR_PG_DIS bits are cleared by reading the FLASH_IAPSR register. It is
consequently strongly recommended to perform one single read operation to the
FLASH_IAPSR register to check the values of these bits.
Caution:
If a word program operation is interrupted by reset, data programmed in memory may be
corrupt.
5.4
Byte programming
Both main program memory and data EEPROM can be programmed / erased at byte level.
Byte programming is performed by executing a write instruction (ld, mov...) to an address in
main program memory when the memory is unlocked. The write instruction initiates the
erase/program cycle and any core access to the memory is blocked until the cycle has
completed. This means that program execution from the Flash program memory is stopped
until the end of the erase/program cycle.
When a new byte program operation starts, EOP and WR_PG_DIS bits of FLASH_IAPSR
register are automatically cleared. At the end of the program operation, the EOP bit in the
FLASH_IAPSR register is set and the program execution restarts from the instruction
following the write/erase instruction.
Contrary to byte programming of Flash program memory, byte programming of data
EEPROM with RWW feature (when available) does not stop program execution. The EOP
bit can then be used to know if the previous operation completed. To avoid polling the EOP
bit, an interrupt can be generated when EOP is set. This bit is automatically reset when
reading FLASH_IAPSR.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28


데이터시트 다운로드

Go To PDF Page


링크 URL



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