Kamikaze47
- 24th September 2009, 07:17
I've got a 40-pin PIC that I would like to use 30 of the i/o pins as pwm outputs in order to drive 10 RGB LEDs. I would be using a frequency 60Hz for all and an 8-bit resolution on the duty cycle.
My thought is to use a timer interrupt of 60*256=15360Hz and have the interrupt for it set each output according to its individual duty cycle value.
I realise that this will be processor intensive, but I am planning on having 6 of these for a total of 180 PWM outputs all controlled by a main master PIC which will do most of the processing and simply send the duty cycle values to the other PICs.
Can anyone see any problems with this?
One thing I have thought of is the current - unless i have a transistor on each output i will only be able to draw about 6.7mA per output due to the PIC's max current sink/source of 200mA.
Alternately, does anyone have any better ideas on how to drive 60 RGB LEDs?
My thought is to use a timer interrupt of 60*256=15360Hz and have the interrupt for it set each output according to its individual duty cycle value.
I realise that this will be processor intensive, but I am planning on having 6 of these for a total of 180 PWM outputs all controlled by a main master PIC which will do most of the processing and simply send the duty cycle values to the other PICs.
Can anyone see any problems with this?
One thing I have thought of is the current - unless i have a transistor on each output i will only be able to draw about 6.7mA per output due to the PIC's max current sink/source of 200mA.
Alternately, does anyone have any better ideas on how to drive 60 RGB LEDs?