tmp89fm42k TOSHIBA Semiconductor CORPORATION, tmp89fm42k Datasheet - Page 354

no-image

tmp89fm42k

Manufacturer Part Number
tmp89fm42k
Description
8 Bit Microcontroller Tlcs-870/c1 Series
Manufacturer
TOSHIBA Semiconductor CORPORATION
Datasheet
21.5
Access to the Flash Memory Area
RA006
main section code abs = 0xF000
; #### Transfer the program to RAM ####
sRAMLOOP:
; #### Set a nonmaskable interrupt vector inside the RAM area ####
; #### Allocate RAM to the code area. Switch the vector area to RAM ####
; #### Allocate BOOTROM to the data/code area ####
; #### Check the status of the security program ####
; #### Security program enable process (API) ####
Example:
4. Set "0xD5" on FLSCR2<CR1EN> after setting FLSCR1<BAREA> to "1".
5. Set "0xD5" to A register as enable code.
6. Set "0x00" to C register.
7. Call address (0x1016). (After processing, security program state returns to A register.)
8. If A register is not "0xFF", jump to sSKIP because security program is already set.
9. Set "0xD5" to A register as enable code.
10. Set "0x00" to C register.
11. Call address (0x1016). (Security program is performed.)
12. Set "0xD5" to FLSCR2 after setting FLSCR1<BAREA> to "0".
13. Set "0xD4" to SYSCR4 after setting SYSCR3<RAREA, RVCTR> to "0".
Whether the security program is enabled or disabled is checked. If it is disabled, it is enabled.
.BTWrite
.BTEraseSec
.BTEraseChip equ 0x1014
.BTGetRP
.BTSetRP
cRAMStartAdd equ 0x0200
LD
LD
LD
LD
INC
INC
CMP
J
LD
LDW
LD
LDW
LD
LD
LD
LD
LD
LD
CALL
CMP
J
LD
LD
CALL
equ 0x1010
equ 0x1012
equ 0x1016
equ 0x1018
HL,cRAMStartAdd
IX,sRAMprogStart
A,(IX)
(HL),A
HL
IX
IX,sRAMprogEnd
NZ,sRAMLOOP
HL,0x01FC
(HL),sINTSWI - sRAMprogStart + cRAMStartAdd
HL,0x01F8
(HL),sINTWDT - sRAMprogStart + cRAMStartAdd
(SYSCR3),0x06
(SYSCR4),0xD4
(FLSCR1),0x50
(FLSCR2),0xD5
A,0xD5
C,0x00
(.BTGetRP)
A,0xFF
NZ,sSKIP
A,0xD5
C,0x00
(.BTSetRP)
Page 336
; Write data to the flash memory
; Sector Erase
; Chip Erase
; Check the status of the security program
; Enable the security program
; RAM start address
; Transfer the program from sRAMprogStart to
; sRAMprogEnd to cRAMStartAdd.
; Set INTUNDEF and INTSWI interrupt vectors
; Set INTWDT interrupt vector
; Set RAREA and RVCTR to "1"
; Enable Code
; Set BAREA to "1"
; Reflect the FLSCR1 setting
; Enable Code
; Set 0x00 (note 1)
; Check the status of the security program
; Go to sSKIP if the security program is enabled
; Enable Code
; Set 0x00 (note 1)
; Enable the security program
TMP89FM42K

Related parts for tmp89fm42k