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.

[参考译文] LP-MSP430FR2476:微秒延迟

Guru**** 2387080 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1079380/lp-msp430fr2476-microsecond-delay

部件号:LP-MSP430FR2476

我一直在使用__delay_cycles,它以毫秒为单位运行良好。 我有一个16 MHz MCLK。 产生微秒延迟的精确方法是什么?

谢谢

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    __delay_cycles 将创建精确的周期延迟,因此在您的案例中,16的参数将导致1 us 延迟。 当然,在这之前或之后的指令不受控制。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    实际上,如果您有这种倒退,计时器在毫秒延迟方面要好得多,而__delay_cycles()在微秒方面则好得多。 请注意,__delay_cycles()实际上是一个 nop,只会浪费时间。

    如果您使用带有合理参数的__delay_cycles()获得了毫秒的延迟,则可能没有16 MHz 的时钟。