访问电脑版页面

导航:老古开发网手机版其他

C2000例程连载3

导读:
关键字:

S320F2812的延时程序

作者不详

.def _DSP28x_usDelay

;====================================================
;Delay Function 
;The C assembly call will look as follows: 
;
;  extern void Delay(long time);                

;        MOV   AL,#LowLoopCount
;        MOV   AH,#HighLoopCount
;        LCR   _Delay
;
;Or as follows (if count is less then 16-bits):
;
;        MOV   ACC,#LoopCount
;        LCR   _Delay


        .global  __DSP28x_usDelay
_DSP28x_usDelay:
        SUB    ACC,#1
        NOP
        NOP
        BF     _DSP28x_usDelay,GEQ    ;; Loop if ACC >= 0
        LRETR 

;There is a 9/10 cycle overhead and each loop
;takes five cycles. The LoopCount is given by
;the following formula:

;  DELAY_CPU_CYLES = 9 + 5*LoopCount

; LoopCount = (DELAY_CPU_CYCLES - 9) / 5

;==================================================

来源:   作者:  2006/9/25 16:50:53
栏目: [ ]

相关阅读

安森美推出新的高功率图腾柱PFC控制器,满足具挑战的能效标准

动态功耗低至60μA/MHz!助力设备超长续航,首选国民技术低功耗MCU!