?? c54_timer.asm
字號:
;
; _StartTimer sets up the the C54x Timer registers and enable the
; timer interrupts. It must be called after the OSStart(). Therefore
; the best place to call it is in the first user task.
;
.def _StartTimer
.mmregs
TCR_STOP .set 0x001f
TCR_RUN .set 0x002f
*PRD_INIT .set 0x3e7 ; together with TDDR, timer period 0x3e8*0x10/80MHz = 200us
*PRD_INIT .set 0x280 ; together with TDDR, timer period 0x280*0x10/50MHz = 200us
PRD_INIT .set 0x28e ; together with TDDR, timer period 0x28E*0x10/50MHz = 200us
*PRD_INIT .set 0x7d00 ; together with TDDR, timer period 0x28E*0x10/50MHz = 200us
.text
_StartTimer:
;----------------------------------
; Initialize Timer
;----------------------------------
stm #TCR_STOP, TCR
stm #PRD_INIT, PRD
stm #TCR_RUN, TCR
ldm IMR, A ; read the IMR
add #8, A ; turn on the TINT bit
stlm A, IMR ; write it back to IMR
stm #0xffff, IFR ; Writing a 1 to an IFR bit,
; clears the interrupt flag
nop;
nop;
ret;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -