您好!
我将使用 TIRTOS 2.16和 TivaWare 2.1.4。 似乎我可以通过 PWM_OPEN 将周期设置为1微秒的最低值。 我正在驱动响应时间为1.2微秒的 LED。 我想知道是否可以通过某种方法将周期设置为1.2微秒、或者将周期设置为基于时钟周期而不是基于时间?
谢谢。
最大值
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.
您好!
我将使用 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 驱动程序级别做到这一点。