📄 initial.asm.bak
字号:
;***********************************************
;Name :PortInitial
;Function:
;Input :
;Output :
;Register Used:
;***********************************************
PortInitial:
mov a,#0fh
b0mov p0,a
b0mov p0m,a
mov a,#18h
b0mov p5,a
b0mov p5m,a
mov a,#07h
b0mov p4,a
b0mov p1m,a
bset com_p
RET
;**********************************************
;Name :SysInitial
;Function:
;Input :
;Output :
;Register Used:
;***********************************************
SysInitial:
mov a,#0h
b0mov intrq,a
b0bclr FGIE ;//disable Interrupt gain
clr PFLAG ;pflag = x,x,x,x,x,c,dc,z
clr inten
mov A,#0h ;Clear watchdog timer and initial system mode
b0mov OSCM,A
;---set tc1 overtime : 10ms
mov A,#01010100B ;disable tc1,fcpu/8,auto-reload,Disable the PWM output
b0mov TC1M,A
mov A,#216 ;1ms interrupt
b0mov TC1R,A ;T=(256-n)*(1/(32k/4/2))=10ms,n=216
b0mov TC1C,A
clr intrq ; CLEAR INTERRUPT FLAG
b0bset FTC1ENB ; Enable TC0
b0bset ftc1ien
ret
;**********************************************
;Name :RAMInitial
;Function: clr 64byte ram
;Input :
;Output :
;Register Used:
;***********************************************
RAMInitial:
ClrBank0:
clr Y ;Select bank 0
mov A,#64
b0mov Z,A ;Set @YZ address from 7fh
ClrRAM10:
clr @YZ ;Clear @YZ content
decms Z ;z = z - 1 , skip next if z=0
jmp ClrRAM10
clr @YZ ;Clear address 0x00
ret
;**********************************************
;Name : VariableInitial
;Function: 变量初始化
;Input :
;Output :
;Register Used:
;***********************************************
VariableInitial:
ret
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -