Program Example For Timebase Timer - Fujitsu F2MC-8L Series Hardware Manual

8-bit microcontroller
Hide thumbs Also See for F2MC-8L Series:
Table of Contents

Advertisement

5.7

Program Example for Timebase Timer

This section gives a program example for the timebase timer.
Program Example for Timebase Timer
Processing description
Generates repeated interval timer interrupts at 2
intervals.
At this time, the interval time is approximately 62.4 ms (at 4.2 MHz operation).
Coding example
TBTC
EQU
TBOF
EQU
ILR2
EQU
INT_V
DSEG
ORG
IRQ6
DW
INT_V
ENDS
;-----Main program---------------------------------------------------------------------------------------------------------------------------------------
CSEG
:
CLRI
MOV
MOV
SETI
:
;-----Interrupt program----------------------------------------------------------------------------------------------------------------------------------
WARI
CLRB
PUSHW
0000AH
; Address of the timebase timer control register
TBTC:7
; Define the interrupt request flag bit.
007DH
; Address of the interrupt level setting register
ABS
; [DATA SEGMENT]
0FFEEH
WARI
; Set interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
ILR2,#11011111B
; Set interrupt level (level 1).
TBTC,#01000100B
; Clear interrupt request flag, enable interrupt request output,
; Enable interrupts.
TBOF
; Clear interrupt request flag.
A
5.7 Program Example for Timebase Timer
18
/F
18
select 2
/F
and clear timebase timer .
CH
(F
: main clock source oscillation)
CH
CH
143

Advertisement

Table of Contents
loading

Table of Contents