📄 dsp281x_usdelay.lst
字号:
TMS320C2000 COFF Assembler PC Version 3.09 Mon Apr 14 07:41:46 2008
Tools Copyright (c) 1996-2002 Texas Instruments Incorporated
DSP281x_usDelay.asm PAGE 1
1 ;//###########################################################################
2 ;// FILE: DSP281x_usDelay.asm
3 ;// TITLE: Simple delay function
4 ;// DESCRIPTION:
5 ;// This is a simple delay function that can be used to insert a specified
6 ;// delay into code.
7 ;// This function is only accurate if executed from internal zero-waitstate
8 ;// SARAM. If it is executed from waitstate memory then the delay will be
9 ;// longer then specified.
10 ;// To use this function:
11 ;// 1 - update the CPU clock speed in the DSP281x_Examples.h
12 ;// file. For example:
13 ;// #define CPU_CLOCK_SPEED 6.6667L // for a 150MHz CPU clock speed
14 ;// 2 - Call this function by using the DELAY_US(A) macro
15 ;// that is defined in the DSP28_Device.h file. This macro
16 ;// will convert the number of microseconds specified
17 ;// into a loop count for use with this function.
18 ;// This count will be based on the CPU frequency you specify.
19 ;// 3 - For the most accurate delay
20 ;// - Execute this function in 0 waitstate RAM.
21 ;// - Disable interrupts before calling the function
22 ;// If you do not disable interrupts, then think of
23 ;// this as an "at least" delay function as the actual
24 ;// delay may be longer.
25 ;// The C assembly call from the DELAY_US(time) macro will
26 ;// look as follows:
27 ;// extern void Delay(long LoopCount);
28 ;// MOV AL,#LowLoopCount
29 ;// MOV AH,#HighLoopCount
30 ;// LCR _Delay
31 ;// Or as follows (if count is less then 16-bits):
32 ;//
33 ;// MOV ACC,#LoopCount
34 ;// LCR _Delay
35 ;//###########################################################################
36 ;//
37 ;// Ver | dd mmm yyyy | Who | Description of changes
38 ;// =====|=============|======|===============================================
39 ;// 1.00| 11 Sep 2003 | L.H. | No changes since v.58
40 ;//###########################################################################
41 .def _DSP28x_usDelay
42 00000000 .sect "ramfuncs"
43 .global __DSP28x_usDelay
44 00000000 _DSP28x_usDelay:
45 00000000 1901 SUB ACC,#1
46 00000001 56C3 BF _DSP28x_usDelay,GEQ ;; Loop if ACC >= 0
00000002 FFFF
47 00000003 0006 LRETR
48 ;There is a 9/10 cycle overhead and each loop
49 ;takes five cycles. The LoopCount is given by
50 ;the following formula:
51 ; DELAY_CPU_CYCLES = 9 + 5*LoopCount
52 ; LoopCount = (DELAY_CPU_CYCLES - 9) / 5
53 ; The macro DELAY_US(A) performs this calculation for you
54 ;==================================================
TMS320C2000 COFF Assembler PC Version 3.09 Mon Apr 14 07:41:46 2008
Tools Copyright (c) 1996-2002 Texas Instruments Incorporated
DSP281x_usDelay.asm PAGE 2
No Assembly Errors, No Assembly Warnings
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -