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.

[参考译文] TM4C1294NCPDT:是否可以在1至2微秒的周期内运行 PWM 外设

Guru**** 2535780 points


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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1246895/tm4c1294ncpdt-is-it-possible-to-run-the-pwm-peripheral-at-a-period-between-1-and-2-microseconds

器件型号:TM4C1294NCPDT

您好!

我将使用 TIRTOS 2.16和 TivaWare 2.1.4。 似乎我可以通过 PWM_OPEN 将周期设置为1微秒的最低值。 我正在驱动响应时间为1.2微秒的 LED。 我想知道是否可以通过某种方法将周期设置为1.2微秒、或者将周期设置为基于时钟周期而不是基于时间?

谢谢。

最大值

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

    我尝试实现的时间:  

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

    如果我似乎将 PWMTiva.h 中的 PWMGenPeriodSet (hwAttrs->baseAddr、pwmGenerator、(tempPeriod / prescalar));更改为  PWMGenPeriodSet (hwAttrs->baseAddr、pwmGenerator、144);在程序运行时、我可以获得这些结果。 是否有办法从更高层次上做到这一点?

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

    您好、Max:

    Unknown 说:
    看来我能将 PWM_open 设置为1微秒的周期是最低的。 我正在驱动响应时间为1.2微秒的 LED。 我想知道是否可以将周期设置为1.2微秒、或者将周期设置为基于时钟周期而不是基于时间?

     TI-RTOS PWM 驱动器 不把时钟节拍作为计数器的装载值、而是像您尝试的那样、只采用微秒增量的绝对时间。 输入的周期(以微秒为单位)将转换为 PMWLOAD 寄存器的周期、并且还会针对 PWMDIV 寄存器中的时钟分频器进行调整。  

    typedef struct PWM_Params {
        uint32_t     period;         /*!< PWM period in microseconds */
        PWM_DutyMode dutyMode;       /*!< Units which duty is specified */
        PWM_Polarity polarity;       /*!< Set duty active high or active low */
        uintptr_t    custom;         /*!< Custom argument used by driver
                                          implementation */
    } PWM_Params;

    似乎如果我更改了 PWMGenPeriodSet (hwAttrs->baseAddr、pwmGenerator、(tempPeriod / prescalar);在 PWMTiva.h 中将  PWMGenPeriodSet (hwAttrs->baseAddr、pwmGenerator、144)、我可以在程序运行时获得这些结果。 是否有办法从更高级别执行此操作?

    是的、如果 您使用 TivaWare API、它将为您提供更多的控制并能够微调 PWM 周期。 我没有办法在 TI-RTOS 驱动程序级别做到这一点。