110
CHAPTER 5 TIMEBASE TIMER
5.7
Program Example for Timebase Timer
This section gives a program example for the timebase timer.
■
Program example for timebase timer
●
Processing description
•
Generates repeated interval timer interrupts at 2
19
/F
CH
(F
CH
: Main clock oscillation frequency)
intervals. At this time, the interval time is approximately 104.86 ms (at 5 MHz operation).
●
Coding example
TBTC EQU 0000AH ; Address of the timebase timer control register
TBIF EQU TBTC:3 ; Define the interrupt request flag bit.
ILR2 EQU 007DH ; Address of the interrupt level setting register 2
INT_V DSEG ABS ; [DATA SEGMENT]
ORG 0FFEEH
IRQ6 DW WARI ; Set interrupt vector.
INT_V ENDS
;-----Main program---------------------------------------------------------------
CSEG ; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
:
CLRI ; Disable interrupts.
MOV ILR2,#11011111B ; Set interrupt level (level 1).
MOV TBTC,#00010010B ; Clear interrupt request flag, enable interrupt
request output, select 2
19
/F
CH
, and clear timebase
timer.
SETI ; Enable interrupts.
:
;-----Interrupt program----------------------------------------------------------
WARI CLRB TBOF ; Clear interrupt request flag.
PUSHW A
XCHW A,T
PUSHW A
:
User processing
:
POPW A
XCHW A,T
POPW A
RETI
ENDS
;--------------------------------------------------------------------------------
END
Summary of Contents for MB89950 Series
Page 2: ......
Page 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Page 4: ......
Page 10: ...vi ...
Page 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Page 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Page 236: ...222 CHAPTER 10 UART ...
Page 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Page 310: ...296 APPENDIX ...
Page 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 316: ...302 INDEX ...
Page 318: ......