Mitsubishi Motors DS5000TK User Manual
Page 87
USER’S GUIDE
050396 86/173
87
A code example that initializes the memory map is as
follows. It assumes that the DS5000FP user requires a
Partition of 5800h. A DS5001FP using the same code
would use a Partition of B000h.
MCON EQU
0C6h
Org 00h
SJMP Start
Org 30h
Start :
MOV
TA,
#0AAh
;Timed
MOV
TA,
#55h
; Access
ORL
MCON,
#02h
;Set PAA –
DS5000 ONLY
MOV
MCON,
#0B8h
;Set Partition to 5800 on DS5000, B000h on DS5001
MOV
TA,
#0AAh
;Timed –
DS5000 ONLY
MOV
TA,
#55h
; Access –
DS5000 ONLY
ANL
MCON,
#0FDh
;Clear PAA –
DS5000 ONLY
Another common memory requirement is the initializa-
tion of the Data Pointer. When using NV RAM to store
data, this pointer must be moved to the Partition
address (in a partitionable configuration). Thus if the
Partition is set to 5800h, the DPTR should be set to
5800h to start. Once data has been saved in NV RAM,
the DPTR should be saved in a known, nonvolatile loca-
tion so that is can be restored on a reset.
Interrupts
After a reset, all interrupts are disabled. Therefore the
user must enable individual interrupts that are needed.
The global interrupt enable must also be activated. Any
interrupt needing a higher priority must be selected as
such. The following code example shows the enabling
of individual interrupts. A user would combine the
appropriate bits as needed by the application. In this
application example, the serial port is given a high prior-
ity interrupt.
ORG 00h
SJMP
Start
Org
30h
Start :
ORL
PCON, #08h
;Enable Power–fail Warning by setting EPFW
SETB
PS
;Set Serial Port Interrupt to High Priority
SETB
ES
;Enable Serial Port Interrupt
SETB
ET1
;Enable Timer 1 Interrupt
SETB
EX1
;Enable External Interrupt 1
SETB
ET0
;Enable Timer 0 Interrupt
SETB
EX0
;Enable External Interrupt 0
SETB
EA
; Globally enable interrupts