I would like to use one PIC to control the PWM for let's say around 200 LEDs.
The PIC should be able to adjust the brightness/PWM of each LED alltough time is not critical. All I want to do is to "dim led no. 63 5% somewhere around 5:00pm. If it gets 5:10pm thats fine too" No hurry.
I dont think that I can find a PIC with that many PWM outputs so I need something else. I am looking for some kind of external IC that will provide the PWM to the connected LED. I would like the PIC to send a command (or set a voltage) on this external IC and have this IC deliver the correct PWM to the LED until it is told to otherwise.
I don't think that would work with 200 LEDs. It would have to be a very very fast microcontroller...
---------- Post added at 11:14 ---------- Previous post was at 10:50 ----------
@Keith
I'm looking at maxim's site, but I am not sure what I am looking for...
The driver should be able to maintain the correct PWM on its own and it should be controllable from the microcontroller so it needs some kind of interface/control pins.
Does such a driver have a special name ? Are there any keywords I can google to learn more about such a driver ?
Thanks klug, this was very interesting.
I'll need to google Binary Code Modulation a bit more and find some schematics, I don't quite get the theory/concept yet.
For example, if you need to get brightness 0x2F (0b00101111), then you will switch off the LED on period of 128 and 64 of tacts, switch on for period of 32 tacts, switch off for period of 16 tacts, on for periods of 8, 4, 2, 1.
If you will try to make 8 bits shiftPWM, then you will need 256 interrupts for 1 period of PWM. But BAM will need only 8 interrupts of controller.
Next advantage, that the frequency of blinking will be higher on BAM (except brightness 0x80 - where they will be equal)
Yes, that make sense, that's clever. Very clever. I got it.
In the links you provided there was also a discussion on controlling A LOT of leds using shift registers and BAM.
I'm a bit confused about the shift registers....
The shift registers has nothing to do with the BAM-concept, right ?
Controlling that many channels with BAM and a 8mhz microcontroller (Think it was 700+ channels) is doable because the BAM method is that much faster Right ? (Not spending so much time in interrupts I guess...)
Shift registers are the output stage of BAM there. You are loading the state of every LED in interrupt by these shift registers. So, you can independently controll brightness of every LED.
For example, you have 8 LEDs, you need to load brigtness 0x80 for first 4 LEDs and brightness 0x0 for last 4 LEDs. So, in the first interrupt you are loading 0x0F to shift registers. On the next interrupts (2-8) you will load 0x0 to shift registers.
For example, you have 8 LEDs, you need to load brigtness 0x80 for first 4 LEDs and brightness 0x0 for last 4 LEDs. So, in the first interrupt you are loading 0x0F to shift registers. On the next interrupts (2-8) you will load 0x0 to shift registers.
- And the data pins will remain in their high/low state as long as the !OE is low.
- So:
1. The microcontroller shifts in 11110000 and just holds !OE low for one half cycle (4 leds is on, 4 leds is off)
2. Now it shifts in 00000000 and holds the !OE low for one half of a half cycle (all leds is off)
3. and so on... Result: Led 1-4 have been lit for half a cycle = 50% = 0x80 (If a 8bit resolution is used)
If I want to dim led 8 to 25%, led 7 to 12.5%, I'll shift in:
00000000
10000000
01000000
and 5 times 00000000