Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PWM of PWM, dimming RGB leds

Status
Not open for further replies.

Buriedcode

Full Member level 6
Joined
May 6, 2004
Messages
357
Helped
43
Reputation
86
Reaction score
7
Trophy points
1,298
Location
London
Activity points
8,887
Hi,

I've been racking my brains for about two hours now with one problem.
I've successfuly designed/built a simple PIC RGB led controller. Lovely. All nice pretty colours, with just one problem. How can I 'dim' the colour without 'changing' the colour?

For example. Say I have 8-bit resolution for each LED (remember, these are independant of eachother), thats 255 levels per LED, 255^3 total colours available.
If I was to 'dim' the LED by say 20%, I would have to reduce each PWM by 20%, so that they are still in relation to eachother, giving the same colour, but less light output.

Thats fine for dimming slightly, but as the levels reach quite low, we have less to work with. Example 2: 245, 68, 121. Reducing these by 20% is ok. But, for 255, 12, 22 reducing these by 20% is not accurate, because we are dealing with whole numbers. Not only is it complicated in code, but the colour would change as well.

So, apart from somehow digitally controlling the current supply for all LED's (PWM turns them on/off, the current 'dims' them) I've been thinking of PWMing a PWM signal. :D That is, the power supply for all the LED's is, say, a 5Khz PWM signal. And the 'colour PWM' is at 200Hz.

Would this work? I mean, essentially the 'colour PWM' controller does the same job, but the PSU PWM controls the brightness of all LEDs proportionally. It wouldn't have to be fantastic resolution, like 4 bits greyscale or something.

I'm unsure of modulating a PWM with another PWM, but I can't see another way, without bringing in some serious analogue (like a current amplifier/limiter). In theory at least, its sound, lowering the maximum brightness of a PWM'ed LED, whilst keeping the full resolution of the 'colour' PWM controllers.

Any thoughts?

BuriedCode.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top