Sample Program For The Time-Base Timer Program - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 10 TIME-BASE TIMER
10.7

Sample Program for the Time-base Timer Program

This section contains a sample program for the time-base timer.
■ Sample Program for the Time-base Timer
Processing
An interval interrupt of 2
becomes approx. 1.0 ms (during 4 MHz operation).
Coding example
ICR12
TBTC
TBOF
;-------Main program------------------------------------------------------------------------------------------------
CODE
START:
;
LOOP:
;-------Interrupt program---------------------------------------------------------------------------------------------
WARI:
;
;
;
CODE
216
12
/ HCLK (HCLK: oscillation clock) is repeatedly generated. The interval
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
CLRB
I:TBOF
:
User handling
:
RETI
ENDS
;Time-base timer interrupt control register
;Time-base timer control register
;Interrupt request flag bit
;Assumes that stack pointer (SP) has already
been initialized
;Disables interrupts
;Interrupt level 0 (highest)
;Fixes upper 3 bits
;Enables interrupts and clears TBOF
;Clears counter
12
;Selects interval 2
/HCLK
;Sets PS ILM to level 7
;Enables interrupts
;Endless loop
;Clears interrupt request flag
;Returns from interrupt

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents