Change PWM clock in hardware (MUX) for dimming | Cypress Semiconductor
Change PWM clock in hardware (MUX) for dimming
I need to dim a LED on and off (pulsing), however not from 0% to 100% but from 10% to 85% e.g. For the pulsing I use two PWMs with different periods (255 and 254) and connect the outputs with AND (0% to 50%) and OR (50% to 100%) and a MUX. This works really good in hardware.
Now my intention was not to cut the upper and lower limits but speed them up, so the user won't see that the LED is off and fully on for a few milliseconds. To do that in hardware I want to change the clock of the PWM at certain values. I've got the values and would use them to change the clock with a MUX but it did not work. After trying to change the clock I noticed that always the lowest clock rate is used for the PWM, the other (MUX-)clock input will not be used.
Is there a possibility to change the PWM clock in hardware like I did? Or perhaps you have a better solution for my problem. I prefer a hardware solution because I don't want to have to much interrupts (with changing the PWM).
Attached an image of my hardware solution for the pulsing. At 50% the PWMs tc equals zero at the same time and switch the MUX. The clock MUX is only connected to test if it could work.
Thanks for your help.