8 pwm-channels with a 74HC595 ?

Is it possible to create 8 separate controled pwm-channels with a 74HC595 and a Arduino Duemilanove ?

This two things:

http://www.youtube.com/watch?v=XciBYUlwxls&feature=search

http://www.youtube.com/watch?v=EG_XiZwam-w&feature=related

Yes, now !

The state of each Led should be defined in a pattern.

10,20,30,40,50,50,40,30,20,10 - Values are in %

For 11 different possible brightness states.

If i can set the 8 74HC595 shift register 200 times a second.
4 X 50 times.
Then i can do it 4 times a second like the pwm it does !

40% means = 10 - 4 = 6.
This makes 5 * 4 times high and 5 * 6 times low.
In a 1/4 second:
4 X H, 6 X L, 4 X H, 6 X L, 4 X H, 6 X L, 4 X H, 6 X L, 4 X H, 6 X L

With an interupt.

200 times a second to show 4 different patterns a second.

To handle 32 Led’s i must use 4 74HC595.

Int LedBrightness[32]; // To store the led brightness

Int PWM_Step; // Count the pwm steps. Values are 1 - 50

Int Do_PWM_High[32]; // Number of HIGH steps. Values are 1 - 10

Int Do_PWM_Low[32]; // Number of LOW steps. Values are 1 - 10

All 4 are global variables.

Do_PWM_Low must be 10 - Do_PWM_HIGH !

Your main concern should be this:

You have to uphold the PWM @ >50Hz (better: 90Hz), you have 11 brightness levels , that gives you a needed refresh for how many ever shift registers of 1kHz = 1000us.

In other threads there had been discussions of the time needed for shifting things out, which is around 15us per bit.

Not considering the processing involved (mind your data representation!), you can succeed in addressing 64 LEDs.

Yes, i don't use the six pwm channels from the Atmega328.

I think i do one with 32 white leds and one with 8 rgb-leds !