tmp89fm82t TOSHIBA Semiconductor CORPORATION, tmp89fm82t Datasheet - Page 381

no-image

tmp89fm82t

Manufacturer Part Number
tmp89fm82t
Description
8 Bit Microcontroller
Manufacturer
TOSHIBA Semiconductor CORPORATION
Datasheet
RA000
21.5.2.2
perform an erase and a write on the flash memory by using a support program (API) of BOOTROM in MCU
mode. For details, please refere to "21.6 API (Application Programming Interface)".
main section code abs = 0x8000
; #### Transfer the program to RAM ####
sRAMLOOP:
; #### Set a nonmaskable interrupt vector inside the RAM area ####
Example: Case in which a sector erase is performed on Block7 (0xE000 to 0xFFFF) in the data area, and then data at
TMP89FM82T has following support program (API) inside BOOTROM. The following shows how to
Steps 1 through 18 shown below concern the control by a program in the flash memory.
How to write to the flash memory 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 an enable code.
6. Set "0x00" to C register.
7. Call address (0x1016). (to execute Security set up by reading Security Program information. Se-
8. Set A register the address range where the data erase. For example, set "0x38" for address 0xE000
9. Set "0xD5" to C register as an enable code.
10. Call address (0x1012). (to execute Sector erase. Step 8 to 10 is not nessesary in case of obvious
11. Set "0x00" to C register.
12. Set write address A[15:0] to WA resister.
13. Set write data to E resister.
14. Set "0xD5" to (SP-) as an enable code.
15. Call address (0x1010). (to execute Byte Program.)
16. If programing is continued for other address, return to step 11.
17. Set "0xD5" to FLSCR2 after setting FLSCR1<BAREA> to "0".
18. Set "0xD4" to SYSCR4 after setting SYSCR3<RAREA, RVCTR> to "0".
to allocate RAM to the code area, and switch the vector area to the RAM area.
curity Program status is stored in A resister as return value.)
to 0xFFFF erase.
ease.
0x0100 through 0x01FF is written to 0xE000 through 0xE0FF in the data area.
If nonmaskable interrupts (INTSWI, INTUNDEF or INTWDT) occur during erase or writing data, system clock
reset is generated. For this example, Security Program setting is assumed to be off.
.BTWrite
.BTEraseSec
.BTEraseChip equ 0x1014
.BTGetRP
.BTSetRP
cRAMStartAdd equ 0x0200
LD
LD
LD
LD
INC
INC
CMP
J
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
Page 365
; Write data to the flash memory
; Sector Erase
; Chip Erase
; Check the status of the security program
; Configure the security program
; RAM start address
; Transfer the program from sRAMprogStart to
; sRAMprogEnd to cRAMStartAdd.
; Set INTUNDEF and INTSWI interrupt vectors
TMP89FM82T

Related parts for tmp89fm82t