You are here

PSOC4 PWM Interrupt with On-board Button | Cypress Semiconductor

PSOC4 PWM Interrupt with On-board Button

Summary: 2 Replies, Latest post by danaaknight on 31 Oct 2014 05:05 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
JErryW's picture
1 post

 Hi everyone. 

How would I implement an interrupt that changes the duty cycle of an PWM output with the rising edge of the on-board button?


user_1377889's picture
9284 posts

Can be rather simple or a bit more complicated. Just connect an isr-component to the pin and write an interrupt handler. Have a look into the "System Reference Guide" for CY_ISR and CY_ISR_PROTO and use isr_StartEx(YourHandler).

To be more complicated: Switches use to bounce, so a de-glitcher would be better.

And have a look into the schematics of your board, most switches connect to Gnd, so you'll have to look for a falling edge, not a rising one.



user_14586677's picture
7646 posts

For debounce routines take a look at attached for SW solutions. HW is

precious on PSOC 4.


To change the PWM DC you use its PWM_WriteCompare function API,

see component datasheet for PWM.


Regards, Dana.

Log in to post new comments.