怎么设置PWM发送脉冲的数量?比如固定发10个脉冲

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
zhji_4006061
Level 3
Level 3
25 replies posted 50 sign-ins First solution authored

hi all:

    目前我用TCPWM来生成PWM脉冲,通过延时可以控制发送脉冲的个数,如下:

Cy_TCPWM_TriggerStart(TCPWM0, PWM_I_CNT_MASK);
Cy_SysLib_DelayUs(8);
Cy_TCPWM_TriggerStopOrKill(TCPWM0, PWM_I_CNT_MASK);

但这种方式不太精确。我想实现PWM固定发送10个脉冲,这个有其他方式实现吗?谢谢

0 点赞
1 解答
yangyong
Level 5
Level 5
Distributor - Jingchuan(GC)
5 comments on blog First comment on blog 50 questions asked

可以在周期中断里计数8次后停止。

在原帖中查看解决方案

0 点赞
1 回复
yangyong
Level 5
Level 5
Distributor - Jingchuan(GC)
5 comments on blog First comment on blog 50 questions asked

可以在周期中断里计数8次后停止。

0 点赞