IFX_OwenSu 发表于 2025-9-5 14:35

Psoc Control C3不同PWM align模式对比

Psoc Control C3在配置为PWM输出模式的时候还可以选择不同的对齐(align)模式:

- Left Align Mode

- Right Align Mode

- Center Align Mode

- Asymmetric Mode

- Asymmetric CC0&CC1 Mode

- Center Asymmetric CC0&CC1 Mode


基于上面的align模式,我们官方也提供了不同的示例代码.
PWM channels with DT in center-aligned mode:
https://github.com/Infineon/mtb-example-ce240370-pwm-dt-center-aligned-6channels
https://github.com/Infineon/mtb-example-ce240081-pwm-dt-6channels/tree/master

然后配置中发现,示例代码中配置的period =6000, compare 0=3000,为什么在center align模式下出来的PWM不是1:1的比例呢?

这是因为在center align模式下,生效的只有compare 0,但对应的触发事件还有其他选择,上图中的结果是只配置了compare 0 match up触发。
也就是说只有计数上升且达到compare 0的时候才会触发,所以下图中match down中符合的情况并没有触发,而是到第二个cc0 match up的时候才触发,所以才出现比例不是1:1的情况。

正确的配置方法应该是match up & match down都勾选了,参考下图。


小小蚂蚁举千斤 发表于 2025-9-29 16:30

PWM align模式对比

星辰大海不退缩 发表于 2025-9-29 23:07

Psoc Control C3不同PWM align模式对比

szt1993 发表于 2025-9-30 09:54

不同PWM align模式应用是不一样的
页: [1]
查看完整版本: Psoc Control C3不同PWM align模式对比