TMP92CF30
2009-06-12
92CF30-187
3.9.3
Programming example
The conditions listed in this table apply the following programming examples.
No.
Used as
Memory
Setting
MMU area
Logical
address
Physical
address
(a) Main
Routine
COMMON-Z
C00000H to
FFFFFFH
(b) Character-
ROM
NOR-Flash
(16 MB, 1 pcs)
CSZA
,
32 bit,
1 wait state
Bank 0 in
LOCAL-Z
800000H to
BFFFFFH
000000H to
3FFFFFH
(c) Subroutine
SRAM
(16 MB, 1 pcs)
1
CS
,
16 bit,
0 wait state
Bank 0 in
LOCAL-Y
400000H to
5FFFFFH
000000H to
1FFFFFH
(d) Stack-
RAM
On-chip-RAM
(144KB)
−
(32 bit, 2-1-1-1clk)
Bank 2 in
LOCAL-Y
002000H to
049FFFH
(a) Main Routine (COMMON-Z)
Logical
Address
Physical
Address
Instruction
No.
Instruction Comment
1
org C00000H
;
C00000H
<-(Same)
2
ldw (mamr2),80FFH
; CS2 800000-FFFFFF/8MB
C000xxH
<-
3
ldw (b2csl), C222H
; CS2 32-bit ROM, 1 wait state
4
ldw (mamr1),40FFH
; CS1 400000-7FFFFF/4MB
5
ldw (b1csl), 8111H
; CS1 16-bit RAM, 0 wait state
5.1
ldw (localpz),8000H
; Enable LOCAL-Z bank for program
5.2
ldw (localrz),8000H
; Enable LOCAL-Z bank for read-data
6
ld (p8fc), 02H
; P81:
1
CS
7
ld (p8fc2), 04H
; P82:
9
ld xsp,48000H
; Stack Pointer = 48000H
10
ldw (localpy),8000H
; Bank 0 in LOCAL-Y is configured as the
program bank for subroutines
11
:
;
C000yyH
<-
12
call 400000H
; Call a subroutine
13
:
;
14
:
;
15
:
;
•
The instructions No.2 through No.8 configure external pins and the Memory Controller.
•
The instruction No.9 specifies the stack pointer value. The stack pointer is herein
specified to point to the memory location in on-chip RAM.
•
The instruction No.10 configures the setting used for a subroutine call instruction of
No.12.
•
The instruction No.12 calls a subroutine. When the CPU generates the address 400000H,
the MMU translates it to the physical address 000000H, which is then placed onto the
external address bus: A23 to A0. Since the logical address is within the address range of
the CS1 space,
1
CS
for SRAM is asserted at the same time. By using these instructions,
the program execution of the CPU can be branched to the subroutine.
Note: This example assumes that the subroutine program is already written into SRAM.
Summary of Contents for TLCS-900/H1 Series
Page 652: ...TMP92CF30 2009 06 12 92CF30 650 ...