Sample Programs For The 16-Bit Reload Timer - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

12.8

Sample Programs for the 16-bit Reload Timer

This section contains sample programs for the 16-bit reload timer in internal clock
mode and event count mode.
■ Sample Program in Internal Clock Mode
Processing
• A 25 ms interval timer interrupt is generated with 16-bit reload timer 0.
• The timer is used in reload mode to repeatedly generate an interrupt.
• The timer is started with a software trigger. External trigger input is not used.
2
• EI
OS is not used.
• 16 MHz is used for the machine clock, and 2 µs is used for the count clock.
Coding example
ICR09
TMCSR
TMR
TMRD
UF
CNTE
TRG
;-------Main program------------------------------------------------------------------------------------------------
CODE
START:
;
EQU
0000B9H
EQU
000082H
EQU
000084H
EQU
000084H
EQU
TMCSR:2
EQU
TMCSR:1
EQU
TMCSR:
CSEG
:
AND
CCR,#0BFH
MOV
I:ICR09,#00H
CLRB
I:CNTE
MOVW
I:TMRD,#30D3H
MOVW
I:TMCSR,#00001000000011011B
MOV
ILM,#07H
OR
CCR,#40H
CHAPTER 12 16-BIT RELOAD TIMER
;Interrupt control register for the 16-bit reload timer
;Timer control status register
;16-bit timer register
;16-bit reload register
;Interrupt request flag bit
;Counter operation enable bit
;Software trigger bit
;Assumes that stack pointer (SP) has already been
initialized
;Interrupt disable
;Interrupt level 0 (strongest)
;Temporary stopping of counter
;Sets data for 25-ms timer
;Interval timer operation, 2 µs clock
;Disables external trigger and external output
;Selects reload mode, and enables interrupts
;Clears interrupt flag, and starts counter
;Sets ILM in PS to level 7
; Interrupt enable
253

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents