Program Example Of Timebase Timer - Fujitsu F2MCTM-16LX Hardware Manual

16-bit microcontroller
Table of Contents

Advertisement

11.7

Program Example of Timebase Timer

Programming examples for the timebase timer are shown below.
Program Example of Timebase Timer
Processing specification
12
The 2
/HCLK (HCLK: oscillation clock) interval interrupt is generated repeatedly. In this case, the
interval time is approximately 1.0 ms (at 4-MHz operation).
Coding example
ICR07
TBTC
TBOF
TBIE
;-------Main program---------------------------------------
CODE
START:
LOOP:
;-------Interrupt program------------------------------------
WARI:
CODE
;-------Vector setting----------------------------------------
VECT
EQU
0000B7H
EQU
0000A9H
EQU
TBTC:3
EQU
TBTC:2
CSEG
AND
CCR,#0BFH
MOV
I:ICR07 #00H
MOV
I:TBTC,#10000000B
SETB
I:TBIE
MOV
ILM,#07H
OR
CCR,#40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
CLRB
I:TBIE
CLRB
I:TBOF
:
User processing
:
SETB
I:TBIE
RETI
ENDS
CSEG
ABS=0FFH
ORG
0FF98H
CHAPTER 11 TIMEBASE TIMER
;Timebase timer interrupt control register
;Timebase timer control register
;Interrupt request flag bit
;Interrupt enable bit
;Stack pointer(SP), already initialized
;Interrupt disable
;Interrupt level 0(highest)
;Upper 3 bis are fixed
;TBOF clear,
;Counter clear interval time
12
;2
/HCLK selection
;Interrupt enable
;Setting ILM in PS to level 7
;Interrupt enable
;No limit loop
;Clear interrupt enable bit
;Clear interrupt request flag
;Interrupt enable
;Recovery from interrupt processing
;Vector setting to interrupt number
#25(19
)
H
193

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90360 series

Table of Contents