PWM with 50Khz | Cypress Semiconductor
PWM with 50Khz
i need to create a PWM-Signal with 50 KHz to control a LED that expects a PWM-Signal with 50 KHz and TTL=5V.
I´ve set the System Clock to 24 MHz and use the following Dividers VC1=6, VC2= 4, VC3=20 to create the 50KHz.
Can I use an 8bit PWM-Module or do i need to use an 16bit PWM-Module? What value do i have to put in as "Period" ? I used 50000 on a 16 Bit Module, but i guess thats wrong.
So far i´ve written the following Code:
int i = 0;
M8C_EnableGInt ; // Turn on interrupts
SleepTimer_SetInterval(SleepTimer_1_HZ); // Set interrupt to a
for (i=0; i<=65535; i++)
for (i=65535; i>=0; i--)
But the LED that i need to dimm shows no Reaction, the LED on the Eval-Board flickers in different Brightnesses, but not at 50 KHz, i can see it with my bare eye.
hopefully you get the problem i am describing,
Greetings from Germany, Patrick