用的是DSP2833x_usDelay.asm里面这个延时函数,声明在DSP2833x_Examples.h里,
根据里面的注释,- ;// 1 - update the CPU clock speed in the DSP2833x_Examples.h
- ;// file. For example:
- ;// #define CPU_RATE 6.667L // for a 150MHz CPU clock speed
- ;// or #define CPU_RATE 10.000L // for a 100MHz CPU clock speed
复制代码
因为我的开发板上是30M的外部晶振,所以DSP2833x_Examples.h里我改成了- //#define CPU_RATE 6.667L // for a 150MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 7.143L // for a 140MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 8.333L // for a 120MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 10.000L // for a 100MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 13.330L // for a 75MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 20.000L // for a 50MHz CPU clock speed (SYSCLKOUT)
- #define CPU_RATE 33.333L // for a 30MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 41.667L // for a 24MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 50.000L // for a 20MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 66.667L // for a 15MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 100.000L // for a 10MHz CPU clock speed (SYSCLKOUT)
复制代码但是延时相当不准 ,DSP28x_usDelay(1)测得的20个时钟周期,用DSP28x_usDelay(2)确实25个周期,不是两倍关系 - -
请问我哪里错了呢。是不是 CPU clock speed 不是指外部晶振的频率呢?
此帖出自
小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
- -----------------------------------------------------------------------------*/
- //#define CPU_RATE 6.667L // for a 150MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 7.143L // for a 140MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 8.333L // for a 120MHz CPU clock speed (SYSCLKOUT)
- #define CPU_RATE 10.000L // for a 100MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 13.330L // for a 75MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 20.000L // for a 50MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 33.333L // for a 30MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 41.667L // for a 24MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 50.000L // for a 20MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 66.667L // for a 15MHz CPU clock speed (SYSCLKOUT)
- //#define CPU_RATE 100.000L // for a 10MHz CPU clock speed (SYSCLKOUT)
复制代码延时的clock都没变
一周热门 更多>