📄 initc5402.asm
字号:
.include MMRegs.h
.global _InitC5402
_InitC5402:
NOP
NOP
NOP
LD #0, DP ; reset data-page pointer
******* Disable All Interrupts *******
SSBX INTM ; disable (mask) global(CPU) intrpts
STM #0x0000, IMR ; disable peripheral interrupts
STM #0xFFFF, IFR ; clear the intrupts' flags
******* Configure C5402 System Registers *******
STM #0x3FE1,PMST
STM #0x7FFF, SWWSR ; 7 wait cycle for IO space &
; data&prog spaces
STM #0x0001,SWCR ; SWSM = 1 Wait states in SWWSR are multiplied by 2
STM #0x7000,BSCR ; 0=RES BH=0 The bus holder is disabled.
; HBH = 0 hpi bus holder is disabled.
;IACKOFF = 0 The IACK signal output off function is disabled
;DIVFCT = 11 CLKOUT is divided by 4 from the DSP clock
;CONSEC = 0 Bank-switching on 32K bank boundaries only.
STM #0x1800,ST0 ; ST0 at default setting
STM #0x2900,ST1 ; ST1 at default (note:INTX=1)
; MC mode&OVLY=1, vectors at 3F80h
;DROM=1 OVLY=1
****** Set up Timer Control Registers *******
STM #0x0010, TCR ; stop on-chip timer0
nop
nop
nop
stm #0H, CLKMD
stm #0H, CLKMD
nop
nop
nop ;switch to DIV mode clkout= 1/2 clkin
stm #0F007h, CLKMD ;switch to PLL X 5 mode
statu:
ldm CLKMD, A
and #01b, A ;poll STATUS bit
bc statu, AEQ
STM #0FFFFH,IFR
STM #0x0000, IMR ; able MCBSP0 RX TX INTERRUPT
NOP
NOP
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -