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.
我尝试在 PWM_OUT_4和5中生成 PWM 输出。 但它不起作用。 代码
您好 Ramesh、
我发现了这个问题、我花了一点时间才弄清楚错误的地方、即使在看示例时也是如此。 只需调整一个小参数! )
在您的代码中、您具有以下内容:
PWMGenPeriodSet (PWM0_BASE、PWM_OUT_4、2500);
但 PWMGenPeriodSet API 不是基于 PWM 输出寄存器、而是基于 GEN 寄存器、因为发生器会影响两个 PWM 通道。 您需要的是:
PWMGenPeriodSet (PWM0_BASE、PWM_GEN_2、2500);
那么它应该像您想要的那样工作。
非常感谢 Ralph。 它发挥了作用。
此致、
Ramesh