Program Example For Time-Base Timer; Programming Examples For Time-Base Timer - Fujitsu F2MC-8L F202RA Hardware Manual

F2mc-8l 8-bit microcontroller
Hide thumbs Also See for F2MC-8L F202RA:
Table of Contents

Advertisement

5.7

Program Example for Time-base Timer

Programming examples for the time-base timer are shown below.

Programming Examples for Time-base Timer

● Processing specification
Repeatedly generate an interval timer interrupt at intervals of 2
time interval is approximately 21.0 ms (operating at 12.5 MHz).
● Coding examples
TBTC
TBOF
ILR2
INT_V
IRQ7
INT_V
;------------------------Main program---------------------------------------------------------------------------------
;------------------------Interrupt processing routine------------------------------------------------------------------
WARI
EQU
0000AH
EQU
TBTC:7
EQU
007CH
DSEG
ABS
ORG
0FFECH
DW
WARI
ENDS
CSEG
:
CLRI
MOV
ILR2,#01111111B
MOV
TBTC,#01000100B
SETI
:
CLRB
TBOF
PUSHW A
XCHW
A,T
PUSHW A
:
User processing:
:
POPW
A
XCHW
A, T
CHAPTER 5 TIME-BASE TIMER
18
/F
(F
CH
; Address of time-base timer control register
; Definition of interrupt request flag bit
; Address of interrupt level setting register 2
; [DATA SEGMENT]
; Setting interrupt vector
; [CODE SEGMENT]
; Stack pointer (SP) or other registers are assumed to
have been initialized.
; Interrupt disable
; Setting interrupt level (level 1)
; Clearing interrupt request flag, enabling interrupt
request output, selecting 2
time-base timer
; Interrupt enable
; Clearing interrupt request flag
: oscillation frequency). The
CH
18
/F
, and clearing
CH
125

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents