Program Example Of Watch Timer - Fujitsu MB90895 Series Hardware Manual

16 bit, controller manual
Table of Contents

Advertisement

CHAPTER 9 Watch timer
9.6

Program Example of Watch Timer

This section gives a program example of the watch timer.
I Program Example of Watch Timer
G
Processing specification
An interval interrupt at 2
approximately 1.0s (when sub clock operates at 8.192 kHz).
G
Coding example
ICR07
EQU
WTC
EQU
WTOF
EQU
;
;---------Main program-------------------------------------
CODE
START:
;
AND
MOV
MOV
MOV
OR
LOOP:
.
User processing
.
BRA
;---------Interrupt program--------------------------------------
WARI:
CLRB
.
User processing
.
RETI
CODE
ENDS
;---------Vector setting------------------------------------------
VECT
CSEG
ORG
DSL
ORG
DSL
DB
VECT
ENDS
END
288
13
/SCLK (SCLK: sub clock) is generated repeatedly.The internal time is
0000B7H
0000AAH
WTC:4
CSEG
CCR,#0BFH
I:ICR07,#00H
I:WTC,#10100101B
ILM,#07H
CCR,#40H
LOOP
I:WTOF
ABS=0FFH
00FF8CH
WARI
00FFDCH
START
00H
START
;Interrupt control register
;Watch timer control register
;Over flow flag bit
;Stack pointer (SP),already initialized
;Interrupt disabled
;Interrupt level 0 (storngest)
;Interrupt enabled,
;Clear over flow flag
;Clear watch timer caunter,
13
;2
/SCLK (approx.1.0s)
;Setting ILM in PS to level 7
;Interrupt enabled
;Clear over flow flag
;Recovery from interrupt processing
;Setting vector to interrupt number #28
;Reset vector setting
;Setting to single chip mode

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lx

Table of Contents