Sample Programs Of Timebase Timer - Fujitsu MB90480 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

9.7

Sample Programs of Timebase timer

Sample programs for the timebase timer are shown below.
Sample programs of timebase timer
❍ Specifications for processing
Repetitively generate an interval interrupt of 2
this case is approximately 1.0 ms (when operating at 4 MHz).
❍ Sample coding
ICR12
TBTC
TBOF
;---------- Main program -------------------------------------------
CODE
START:
;
LOOP:
;---------- Interrupt program --------------------------------------
WARI:
;
;
;
CODE
;---------- Specifying vectors -------------------------------------
VECT
VECT
EQU
0000BCH
EQU
0000A9H
EQU
TBTC:3
CSEG
:
AND
CCR, #0BFH
MOV
I:ICR12, #00H
MOV
I:TBTC, #10010000B
MOV
ILM, #07H
OR
CCR, #40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
CLR bit BOF
:
User processing
:
RETI
ENDS
CSEG
ABS=0FFH
ORG
0FF6CH
DSL
WARI
ORG
0FFDCH
DSL
START
DB
00H
ENDS
END
START
CHAPTER 9 TIMEBASE TIMER
12
/HCLK (oscillation clock). The interval time in
; Interrupt control register for timebase timer
; Timebase timer control register
; Interrupt request flag bit
; Assumption that stack pointer
; (SP), etc., have been initialized
; Disabling interrupts
; Interrupt level 0 (highest)
; Three high-order bits must be fixed
; Permitting interrupts, clearing of TBOF
; Clearing the counter
; Selection for interval time of 2
; Setting ILM in PS to level 7
; Enabling interrupts
; Infinite loop
; Clearing the interrupt request flag
; Restoration from interrupt
; Specifying the interrupt vector
; Specifying the reset vector
; Setting to the single-chip mode
12
/HCLK
197

Advertisement

Table of Contents
loading

Table of Contents