cancel
Showing results for 
Search instead for 
Did you mean: 

PWM frequency

bleumers_j
Associate II
Posted on August 23, 2003 at 13:51

PWM frequency

5 REPLIES 5
bleumers_j
Associate II
Posted on August 13, 2003 at 06:06

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.
sjo
Associate II
Posted on August 13, 2003 at 10:01

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

SJO
bleumers_j
Associate II
Posted on August 13, 2003 at 12:21

I'm generating 3 pwm's so software pwm is more difficult, i think.

sjo
Associate II
Posted on August 13, 2003 at 14:21

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

SJO
sisto
Associate II
Posted on August 23, 2003 at 13:51

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 ]