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
Содержание MB89950 Series
Страница 2: ......
Страница 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Страница 4: ......
Страница 10: ...vi ...
Страница 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Страница 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Страница 236: ...222 CHAPTER 10 UART ...
Страница 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Страница 310: ...296 APPENDIX ...
Страница 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 316: ...302 INDEX ...
Страница 318: ......