Program Example Of 16-Bit Reload Timer - Fujitsu MB90895 Series Hardware Manual

16 bit, controller manual
Table of Contents

Advertisement

8.7

Program Example of 16-bit Reload Timer

This section gives a program example of the 16-bit reload timer operated in the internal
clock mode and the event count mode are given below:
I Program Example in Internal Clock Mode
G
Processing specification
• The 25-ms interval timer interrupt is generated by the 16-bit reload timer 0.
• The repeated interrupts are generated in the reload mode.
• The timer is started using the software trigger instead of the external trigger input.
2
• EI
OS is not used.
• The machine clock is 16 MHz; the count clock is 2
G
Coding example
ICR03
EQU
TMCSR0 EQU
TMR0
EQU
TMRLR0 EQU
UF0
EQU
CNTE0
EQU
TRG0
EQU
;--------Main program------------------------------------
CODE
;
:
AND
MOV
CLRB I:CNTE0
MOVW I:TMRLR0,#30D4H ;Setting of data in 25ms timer
MOVW I:TMCSR0,#0000100000011011B
MOV
OR
LOOP:
User processing
BRA
0000B3H
;For 16-bit reload timer
;Interrupt control register
000066H
;Timer control status register
003900H
;16-bit timer register
003900H
;16-bit reload register
TMCSR0:2
;Interrupt request flag bit
TMCSR0:1
;Counter operation enable bit
TMCSR0:0
;Software trigger bit
CSEG
;Stack pointer (sp),already initialized
CCR,#0BFH
;Interrupt disabled
I:ICR03,#00H
;Interrupt level 0 (storongest)
;Temporary stop of counter
;Interval timer operation, clock 2ms
;External triger disabled,
External output disabled,
;Reload mode selection, interrupt enabled
;Clear interrupt flag, count start
ILM,#07H
;Setting ILM in PS to level7
CCR,#40H
;Interrupt enaled
LOOP
;
CHAPTER 8 16-bit reload timer
µ
s.
273

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lx

Table of Contents