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.

MSP430F5529有延时函数吗?



在TI给出的例程里面有关于延时的函数吗?eg:__delay_cycles这种的函数

  • #define CPU_F                               ((double)8000000)
    #define delay_us(x)                       __delay_cycles((long)(CPU_F*(double)x/1000000.0))
    #define delay_ms(x)                      __delay_cycles((long)(CPU_F*(double)x/1000.0))

    在 #define CPU_F           ((double)8000000) 语句里 8000000  当前MSP430 CPU的主频频率,即CPU的MCLK ,8000000为MCLK=8MHZ 的意思。

  • 楼主你好!

    延迟函数

    _delay_cycles(n);  n必须为常量。这是又编译器完成的内联函数,不需要头文件支持。