timer1init.s

来自「用Freescale半导体公司HC08系列单片机制作了电子时钟,具有整点报时、闹」· S 代码 · 共 27 行

S
27
字号
	.module Timer1init.c
	.area text
_Timer1init::
; #include"gp32c.h"
; #define TSTOPBit   5      //定时器计数停止位
; void Timer1init(void)
;  {
;      //允许溢出中断、不启动计数、分频因子=64
;      T1SC=0b01100110;
	lda #102
	sta 0x20
;      //计数寄存器初值=0x0000
;      T1CNTH=0x00; T1CNTL=0x00;           
	clr 0x21
	clr 0x22
;      //1秒产生1次溢出中断,计数寄存器=1×(2457600/64)=9600
;      T1MODH=0x96; T1MODL=0x00;
	lda #-106
	sta 0x23
	clr 0x24
;      //允许定时器1计数寄存器计数
;      T1SC&=~(1<<TSTOPBit);
	bclr #5,0x20
L1:
	.dbline 0 ; func end
	rts

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?