This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

28027 DSP28x_usDelay延时的问题

使用芯片28027,主频配置60M
添加了从flash复制到ram里运行。
我使用DSP28x_usDelay(1200L);
最后测出来延时是98us
DSP28x_usDelay(1000L);
测出来是84u
不知道什么原因

查看了一下.map文件

 output                                  attributes/
section   page    origin      length       input sections
--------  ----  ----------  ----------   ----------------
ramfuncs   0    003f6000    00000562     RUN ADDR = 00008000
                  003f6000    00000543     main.obj (ramfuncs:retain)
                  003f6543    0000001b     f2802x_sysctrl.obj (ramfuncs)
                  003f655e    00000004     f2802x_usdelay.obj (ramfuncs)

也没看出问题啊。。。求救

  • 感觉是你分配好cmd地址之后,代码&数据写进去的时候出了问题。你先参考一下内存映射表,看看你指定的区域是否合法

  • 你测试的时间是对的。只是你应该调用DELAY_US(x);

    因为:

    #define DELAY_US(A) DSP28x_usDelay(((((long double) A * 1000.0L) / (long double)CPU_RATE) - 9.0L) / 5.0L)

    算一下,根据((a*1000 / 16.67) - 9) / 5 = 1200; a确实是98左右。