How to prevent interference between Capsense and PWM

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

cross mob
KeLi_1455086
Level 2
Level 2
First like received First like given Welcome!

I'm trying to build a robot arm with servo motor (SG90) and controlling capsense slider and touch button. Im use  CY8CKIT-145 kit to build this project. but I found the servo is not running stable. looking like the capsense scanning will stop the PWM. anyone can help!

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

我改了一下代码,你试试是否可以正常工作。

View solution in original post

8 Replies
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

The CapSense have no ability to prevent the PWM.

Could you give me a simple project to reproduce the issue?

0 Likes
lock attach
Attachments are accessible only for community members.

project file attached!

Thanks!

0 Likes

从工程看,CapSense 与 PWM 之间不存在相互干扰的情况。问题应该出在你尝试在 PWM 运行过程中直接修改其比较寄存器,这样做很容易导致 PWM 输出 glitch 等于预期不符的波形。建议你使能四个 PWM 的 compare swap 功能,并通过 PWM_1_TriggerCommand() 来触发 switch 动作,这样新的比较值就不会在当前周期中直接覆盖现有比较值,而是在 PWM 接下来一次的 TC 事件发生时将新的比较值拷贝的现有比较寄存器并生效。

0 Likes
lock attach
Attachments are accessible only for community members.

我已修改,但仍然不能正常運作. 請看看!

0 Likes
lock attach
Attachments are accessible only for community members.

我改了一下代码,你试试是否可以正常工作。

Thanks for your help, now I know how it work!

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I briefly read your project and the configuration of PWM might be wrong.

I have posted a sample using SG-90. (I'm sorry it's in Japanese)

TSoC CY8C4146LQI-S433 基板 サーボ SG-90 サンプル

But please take a look at the PWM setting in the project attached.

moto

Thanks for your help, now is working.