Fujitsu Semiconductor Controller MB89950/950A Hardware Manual page 182

F2mc-8l 8-bit microcontroller
Table of Contents

Advertisement

CHAPTER 8 PULSE WIDTH COUNT TIMER (PWC)
G
Coding example
PCR1
PCR2
RLBR
EN
IE
UF
BF
ILR1
INT_V
IRQ3
INT_V
;-----Main program----------------------------------------------------------------
;-----Interrupt processing routine------------------------------------------------
WARI
;---------------------------------------------------------------------------------
168
EQU
0014H
EQU
0015H
EQU
0016H
EQU
PCR1:7
EQU
PCR1:5
EQU
PCR1:2
EQU
PCR1:0
EQU
007CH
DSEG
ABS
ORG
0FFF4H
DW
WARI
ENDS
CSEG
:
CLRI
CLRB
EN
CLRB
IE
CLRB
BF
MOV
ILR1,#0111111B
MOV
RLBR,#075H
MOV
PCR2,#01101000B ; Select interval timer function, one-shot timer
MOV
PCR1,#10100000B ; Start counter operation, enable interrupt request
SETI
:
CLRB
UF
PUSHW
A
XCHW
A,T
PUSHW
A
:
User processing
:
POPW
A
XCHW
A,T
POPW
A
RETI
ENDS
END
; Address of the PWC pulse width control register 1
; Address of the PWC pulse width control register 2
; Address of the PWC reload buffer register
; Define the counter operation enable bit.
; Define the interrupt request enable bit.
; Define the underflow (01H
request flag bit.
; Define the buffer full flag
; Address of the interrupt level setting register 1
; [DATA SEGMENT]
; Set interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
; Stop counter operation.
; Disable interrupt request output.
; Clear buffer full flag (PCR1: bit 0).
; Set interrupt level (level 1).
; Counter reload value (interval time)
mode, initial output value of the TO, and
32 tinst.
output, clear underflow (01H
request flag, clear measurement complete
interrupt request flag (bit 1).
; Enable interrupts.
; Clear interrupt request flag.
00H) interrupt
00H) interrupt

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb89950 seriesMb89950a series

Table of Contents