Sample Programs For The Pwc Timer - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 16 PWC Timer
16.8

Sample Programs for the PWC Timer

This section contains sample programs for the PWC timer.
■ Sample Program for the PWC Timer
Processing
• An output PWO0 of 30.6 Hz is generated with PWC timer 0.
• The PWC is used in reload timer mode to repeatedly generate an overflow interrupt.
2
• EI
OS is not used.
• 16 MHz is used for the machine clock, and 0.25 µs is used for the count clock.
Coding example
ICR01
PWCS0
PWC0
OVIR
;-------Main program------------------------------------------------------------------------------------------------
CODE
START:
;
LOOP:
;-------Interrupt program--------------------------------------------------------------------------------------------
WARI:
;
464
EQU
0000B1H
EQU
000008H
EQU
00000AH
EQU
PWCS0:11
CSEG
:
AND
CCR,#0BFH
MOV
I:ICR01,#00H
MOVW
I:PSC0,#0FF00H
MOVW
I:PWCS0,#4409H
MOV
ILM,#07H
OR
CCR,#40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
CLRB
I:OVIR
:
;Interrupt control register for the PWC timer
;PWC control status register
;PWC data buffer register
;Interrupt request flag bit
;Assumes that stack pointer (SP) has already been
initialized
;Interrupt disable
;Interrupt level 0 (strongest)
;Sets the reload value
;Sets reload timer mode, 0.25µ s clock
;Enable PWC output
;Sets overflow interrupt
;Clears interrupt flag and starts PWC timer
;Sets ILM in PS to level 7
;Interrupt enable
;Endless loop
;
;
;Clears interrupt request flag

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents