Fujitsu F2MC-8L MB89620 Series Hardware Manual page 148

8-bit microcontroller
Table of Contents

Advertisement

7
5.
Program Example for Timebase Timer
This section gives a program example for the timebase timer.
n Program Example for Timebase Timer
Processing description
l
Generates repeated interval timer interrupts at 2
At this time, the interval time is approximately 52.4 ms (at 10 MHz operation).
Coding example
l
TBTC
TBOF
ILR3
INT_V
IRQA
INT_V
;-----Main program---------------------------------------------------------------------------------------------------------------------------------------
;-----Interrupt program----------------------------------------------------------------------------------------------------------------------------------
WARI
;--------------------------------------------------------------------------------------------------------------------------------------------------------------
MB89620 series
EQU
0000AH
EQU
TBTC:3
EQU
007EH
DSEG
ABS
ORG
0FFE6H
DW
WARI
ENDS
CSEG
:
CLRI
MOV
ILR3,#11011111B
MOV
TBTC,#00010010B
SETI
:
CLRB
TBOF
PUSHW
A
XCHW
A,T
PUSHW
A
:
User processing
:
POPW
A
XCHW
A,T
POPW
A
RETI
ENDS
END
19
/F
(F
: source oscillation) intervals.
C
C
; Address of the timebase timer control register
; Define the interrupt request flag bit.
; Address of the interrupt level setting register 3
; [DATA SEGMENT]
; Set interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
; Set interrupt level (level 1).
; Enable interrupt request output, clear interrupt request flag,
clear timebase timer, and select 2
; Enable interrupts.
; Clear interrupt request flag.
CHAPTER 5 TIMEBASE TIMER
19
/F
.
C
127

Advertisement

Table of Contents
loading

Table of Contents