2003-08-23 04:51 AM
2003-08-12 09:06 PM
Hello,
My application (running on ST7lite29) generates 3 PWM's at 1kHz. These PWM's drive leds and the 1 kHz seems to be too high. (long cables and high currents, ...) I believe 1kHz is the lowest frequentie the ST7 can generate with an 8MHz crystal (unfortunately this can not be changed). Is there a way to generate lower frequency PWM? Greets.2003-08-13 01:01 AM
The only solution if you cannot change the system clock is software pwm using a timer, this will depend on what frequency/steps you are after.
I presume you are dimming led's. Regards SJO2003-08-13 03:21 AM
I'm generating 3 pwm's so software pwm is more difficult, i think.
2003-08-13 05:21 AM
Not really, depends on the frequency/resolution.
I have done 6 channel pwm @ 500Hz (resolution of 20steps) using the normal 16bit ST7 timer in ouput compare mode. Regards SJO2003-08-23 04:51 AM
Hi Joble,
I suppose You are realizing a RGB color management system using RGB leds. I've already realized a similar product based on ST72C215 controller. To avoid flickering is sufficent a PWM of 100Hz. If you suppose a 1% step control (that means 100 color levels) You can use a 16 bit A o B timer to generate an OVFL interrupt every 100uSec. Use a counter variable to store the desired PWM value between 0 and 100 and a timer interrupt counter per color. incremented at every timer irq. In the interrupt handler routine is sufficient to increment the irqs counters and compare the value with related PWM counter. If irq counter value is >= than the PWM counter, reset the irq counter and set (or reset) the port output pin dedicated to that color and viceversa. Sixtus [ This message was edited by: sixtus on 23-08-2003 17:25 ] [ This message was edited by: sixtus on 23-08-2003 17:26 ]