One Shot PWM

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

cross mob
EdHa_4455331
Level 5
Level 5
25 replies posted 25 sign-ins 10 replies posted

I really wanted to use a PWM block running in one-shot mode and using an overflow interrupt from that block so that I can retrigger it in software. But I am having problems making it work.

If I flip the mode to continuous, I get the output I expect on the output pin (and the interrupts). But if I JUST flip the mode to one-shot, the PWM output from the block appears to be disabled. The interrupt still seems to be working and hitting at the expected time, and I can retrigger the block after each interrupt to keep the system running, but no PWM-like output appears on the output pin.

Can anybody confirm or deny that the outputs from the PWM block should still be generated in one-shot mode?

Thanks,

Ed H.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello EdHa_4455331

For PWM with One shot configuration, you need to connect an external trigger component or toggle the reset pin of the PWM component. You cannot use an API to drive the PWM again. I have attached an example showing a PWM in one shot configuration in CY8CKIT-042. Please have a look.

Thanks,
Hari

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello EdHa_4455331

For PWM with One shot configuration, you need to connect an external trigger component or toggle the reset pin of the PWM component. You cannot use an API to drive the PWM again. I have attached an example showing a PWM in one shot configuration in CY8CKIT-042. Please have a look.

Thanks,
Hari

0 Likes

Thanks, AH+96. That did the trick.

But one follow up question - This restriction is not immediately obvious in any of the PMW documentation that I read through. Is this mentioned in the documentation and I just missed it?

Thanks,

Ed H.

0 Likes
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi EdHa_4455331

This is mentioned in the component datasheet.

pastedImage_0.png

Thanks,
Hari

0 Likes