| Electronic Components Datasheet Search |
|
TMP89FS60 Datasheet(PDF) 338 Page - Toshiba Semiconductor |
|
|
|||||||||||||||||||||||||||||
TMP89FS60 Datasheet(HTML) 338 Page - Toshiba Semiconductor |
|
338 / 410 page ![]() Page 324 21. Flash Memory 21.4 Toggle Bit (D6) TMP89FS60 RA003 21.5.2.2 How to write to the flash memory by using a support program (API) of BOOTROM This section describes how to perform an erase and a write on the flash memory by using a support pro- gram (API) of BOOTROM in MCU mode. Note: Do not allocate the above program to 0x1000 through 0x17FF in the code area in the flash memory. If this area is set to BAREA="1", it changes from the flash memory area to the BOOTROM area so that the program will not function properly and the microcontroller may malfunction. Example: Case in which a sector erase is performed on 0xE000 through 0xEFFF in the data area, and then data at 0x0100 through 0x01FF is written to 0xE000 through 0xE0FF in the data area. .BTWrite equ 0x1010 ; Write data to the flash memory .BTEraseSec equ 0x1012 ; Sector Erase .BTEraseChip equ 0x1014 ; Chip Erase .BTGetRP equ 0x1016 ; Check the status of the security program .BTSetRP equ 0x1018 ; Configure the security program main section code abs = 0xF000 ; Initial setting LD (FLSCR1),0x50 ; Set BAREA to "1" (note) LD (FLSCR2),0xD5 ; Reflect the FLSCR1 setting ; Sector erase process (API) LD A,0x0E ; Specify the area to be erased (0xE000 through 0xEFFF) LD C,0xD5 ; Enable Code CALL (.BTEraseSec) ; Execute sector erase ; Write process LD HL,0xE000 ; Flash start address (address where data is written) LD IY,0x0100 ; RAM start address sLOOP1: LD C,0x00 ; Address where data is written (bit 16) LD WA,HL ; Address where data is written (bits 15 to 0) LD E,(IY) ; Data to be written LD (SP-),0xD5 ; Enable Code CALL (.BTWrite) ; Write data to the flash memory (1 byte) INC IY ; Increment flash address INC HL ; Increment RAM address CMP L,0x00 ; Finish 256-byte write? J NZ,sLOOP1 ; Return to sLOOP1 if the number of bytes is less than 256 ; End process LD (FLSCR1),0x40 ; Set BAREA to "0" LD (FLSCR2),0xD5 Example: Whether the security program is enabled or disabled is checked. If it is disabled, it is enabled. .BTWrite equ 0x1010 ; Write data to the flash memory .BTEraseSec equ 0x1012 ; Sector Erase .BTEraseChip equ 0x1014 ; Chip Erase .BTGetRP equ 0x1016 ; Check the status of the security program .BTSetRP equ 0x1018 ; Enable the security program main section code abs = 0xF000 ; Initial setting LD (FLSCR1),0x50 ; Set BAREA to "1" (note 2) LD (FLSCR2),0xD5 ; Reflect the FLSCR1 setting ; Check the status of the security program LD A,0xD5 ; Enable Code LD C,0x00 ; Set 0x00 (note 1) CALL (.BTGetRP) ; Check the status of the security program CMP A,0xFF J NZ,sSKIP ; Go to sSKIP if the security program is enabled ; Security program enable process (API) |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| 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 |