PWM - separate lighting up and dimming an LED

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

cross mob
DaKo_463136
Level 5
Level 5
10 likes received 10 likes given 5 likes given

Hello,

I have seen the breathing LED example with PSoC4 http://www.cypress.com/documentation/application-notes/ce97634-psoc-4-breathing-led and I wonder whether there is a PSoC way of doing separately just the lighting up and separately dimming action. It is not important whether only one or two PWMs are used, as long as it does what I think of.

The only way I can do this now is changing the PWM period in a for cycle.

Thank you,

David

0 Likes
1 Solution

Well, there is no component yet that does the job.

But:

You could try to learn a HDL (Hardware Definition Languge) named Warp Verilog. Most PSoC4 have got 4 UDBs (Universal Digital Block) which can be programmed to do a lot of different jobs. Refer to the Cypress documentation (already installed on your computer) as Warp Verilog and the Component's Author Guide. I do not say that it can be done easily, not at all. But it is doable.

Bob

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Do not change the period value, but change the compare value. So you can cover a duty cycle from 0 to  100%.

When you use an interrupt for your PWM you will be able to change the LED brightness within the handler. Is this what you are up to?

Bob

0 Likes

Thank you, Bob.

Oh, sorry, I meant the compare value, but accidentally wrote period value.

I just thought whether there is a way of doing this more in hardware, without the need of the changing the compare value. I am asking just out of curiosity.

David

0 Likes

Well, there is no component yet that does the job.

But:

You could try to learn a HDL (Hardware Definition Languge) named Warp Verilog. Most PSoC4 have got 4 UDBs (Universal Digital Block) which can be programmed to do a lot of different jobs. Refer to the Cypress documentation (already installed on your computer) as Warp Verilog and the Component's Author Guide. I do not say that it can be done easily, not at all. But it is doable.

Bob

0 Likes

OK, thank you, I just wanted to make sure I am not missing some basic idea of logic circuits

David

0 Likes