English
Language : 

TMP89FW24ADFG Datasheet, PDF (445/548 Pages) Toshiba Semiconductor – 8 Bit Microcontroller TLCS-870/C1 Series
TMP89FW24A
.BTConvAdr equ 0x101C
; Address conversion process
.BTCalcUART equ 0x101E
; Calculate the setting value of UART from the timercapture value
.BTErsSP
equ 0x1020
; Disable Security Program
.BTUpdSD equ 0x1022
; Shadow RAM update
main section code abs = 0x1F000
; #### Set a nonmaskable interrupt vector to .BTReset ####
LD
HL,0x01FC
; Set INTUNDEF and INTSWI interrupt vectors
LDW
(HL),.BTReset
LD
HL,0x01F8
; Set INTWDT interrupt vector
LDW
(HL),.BTReset
; #### Allocate RAM in the code area. Switch the vector area to RAM ####
LD
(SYSCR3),0x06
; Set RAREA = 1 and RVCTR = 1
LD
(SYSCR4),0xD4
; Enable Code
; #### Allocate BOOTROM to the data/code area ####
LD
(FLSCR1),0x50
; Set BAREA to "1"
LD
(FLSCR2),0xD5
; #### Disable mapping of shadow RAM in the data area ####
; Reflect the FLSCR1 setting
LD
(SDWCR1),0x60
; #### Sector Erase process (API) ####
LD
A,0x20
LD
C,0xD5
CALL
(.BTEraseSec)
; #### Write process ####
LD
C,0x00
LD
WA,0x8000
LD
DE,0x0100
LD
(SP-),0xD5
CALL
(.BTWrite)
; ####End process ####
LD
(FLSCR1),0x40
LD
(FLSCR2),0xD5
LD
(SYSCR3),0x00
LD
(SYSCR4),0xD4
; #### Enable mapping of shadow RAM in the data area ####
; DADIS=1
; Specify the area to be erased (0x08000 through 0x0FFFF)
; Enable Code
; Execute Sector Erase
; Beginning address of Page (bit16)
; Beginning address of Page (bit 15 to 0)
; Beginning address of RAM to be copied
; Enable Code
; Write data to the flash memory (128bytes)
; Set BAREA to "0"
; Enable Code
; Set RAREA = 0 and RVCTR = 0
; Enable Code
LD
(SDWCR1),0x40
:
:
J
XXXX
; DADIS=0
Note 1: Do not allocate the above program to the address from 0x0000 through 0x17FF in the code area of the
flash memory. If the area is set as 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.
Note 2: It is not necessary to add DI instruction to disable interrupt maskable enable flag (IMF) for above sample pro-
gram, because the support program has it. However, the support program does not include EI instruction. En-
able IMF after finishing all above process, if you use interrupt process.
RA000
Page 429
2012/5/18