197
CHAPTER 9 TIMEBASE TIMER
9.7
Sample Programs of Timebase timer
Sample programs for the timebase timer are shown below.
■
Sample programs of timebase timer
❍
Specifications for processing
Repetitively generate an interval interrupt of 2
12
/HCLK (oscillation clock). The interval time in
this case is approximately 1.0 ms (when operating at 4 MHz).
❍
Sample coding
ICR12 EQU 0000BCH ; Interrupt control register for timebase timer
TBTC EQU 0000A9H ; Timebase timer control register
TBOF EQU TBTC:3 ; Interrupt request flag bit
;---------- Main program -------------------------------------------
CODE CSEG
START:
; : ; Assumption that stack pointer
; (SP), etc., have been initialized
AND CCR, #0BFH ; Disabling interrupts
MOV I:ICR12, #00H ; Interrupt level 0 (highest)
MOV I:TBTC, #10010000B ; Three high-order bits must be fixed
; Permitting interrupts, clearing of TBOF
; Clearing the counter
; Selection for interval time of 2
12
/HCLK
MOV ILM, #07H ; Setting ILM in PS to level 7
OR CCR, #40H ; Enabling interrupts
LOOP: MOV A,#00H ; Infinite loop
MOV A,#01H
BRA LOOP
;---------- Interrupt program --------------------------------------
WARI:
CLR bit BOF ; Clearing the interrupt request flag
; :
; User processing
; :
RETI ; Restoration from interrupt
CODE ENDS
;---------- Specifying vectors -------------------------------------
VECT CSEG ABS=0FFH
ORG 0FF6CH ; Specifying the interrupt vector
DSL WARI
ORG 0FFDCH ; Specifying the reset vector
DSL START
DB 00H ; Setting to the single-chip mode
VECT ENDS
END START
Summary of Contents for MB90480 Series
Page 2: ......
Page 4: ......
Page 10: ...vi ...
Page 128: ...106 CHAPTER 4 RESET ...
Page 174: ...152 CHAPTER 6 LOW POWER CONSUMPTION MODE ...
Page 198: ...176 CHAPTER 7 MODE SETTING ...
Page 220: ...198 CHAPTER 9 TIMEBASE TIMER ...
Page 238: ...216 CHAPTER 11 WATCH TIMER ...
Page 280: ...258 CHAPTER 12 16 BIT INPUT OUTPUT TIMER ...
Page 406: ...384 CHAPTER 17 8 10 BIT A D CONVERTER ...
Page 478: ...456 CHAPTER 20 CHIP SELECTION FACILITY ...
Page 494: ...472 CHAPTER 21 ADDRESS MATCH DETECTION FUNCTION ...
Page 498: ...476 CHAPTER 22 ROM MIRROR FUNCTION SELECTION MODULE ...
Page 526: ...504 CHAPTER 23 2M 3M BIT FLASH MEMORY ...
Page 536: ...514 CHAPTER 24 EXAMPLES OF MB90F481B MB90F482B MB90F488B MB90F489B SERIAL PROGRAMMING ...
Page 570: ...548 CHAPTER 25 PWC TIMER ONLY MB90485 SERIES ...
Page 688: ......