tmp89fm82t TOSHIBA Semiconductor CORPORATION, tmp89fm82t Datasheet - Page 383

no-image

tmp89fm82t

Manufacturer Part Number
tmp89fm82t
Description
8 Bit Microcontroller
Manufacturer
TOSHIBA Semiconductor CORPORATION
Datasheet
RA000
21.5.2.3
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 ####
Note 1: It is not necessary to add DI instruction for above example program, because the support program include it.
Example:
How to set the security program by using a support program (API) of BOOTROM
1. Transfer the subroutine program of nonmaskable interrupt (INTSWI, INTWDT) to RAM.
2. Establish the nonmaskable interrupt vector in the RAM area.
3. After setting both SYSCR3<RAREA> and SYSCR3<RVCTR> to "1", set "0xD4" on SYSCR4.
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".
However, the support program does not include EI instruction. Therefore, if interrupt process is used, enable IMF
after finishing all above process.
Then allocate RAM to the code area, and switch the vector area to the RAM area.
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
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
Page 367
; 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
TMP89FM82T

Related parts for tmp89fm82t