"Fooling" constant-current control loops in LED driving?

dhenry:

so not very special hardware would be required

You probably want your pwm sessions to end fairly quickly. Say 50hz, or 20ms.

Each tick of a 32-bit pwm train would be then 20ms / 2^32 = 5e-6 us. or about 200Ghz.

Good luck with that.

I think the 80 MHz clock signal provided by the 32-bit timers of Uno32 (chipKIT32/chipKIT-core · Discussions · GitHub) should be enough for my purposes at this point. So the duty cycle resolution does not have to be necessarily 32-bit and I can compromise duty cycle resolution for temporal resolution and vice versa.

So I was thinking of combining 16 bit for constant current control and then another 8-16 bits for PWM duty cycle resolution to increase the already 16-bit resolution of the DC (unswitched current). So I did not really get the requirement for a 200 GHz frequency?

[edit] So if I did not quite misunderstood the PIC32 tutorial there: PIC32MX: PWM Motor Control - Northwestern Mechatronics Wiki with 80 MHz you can have a PWM frequency of 20 kHz with 4000 duty cycle steps?

// init Timer2 mode and period (PR2) (frequency of 1 / 20 kHz = (3999 + 1) / 80MHz * 1
OpenTimer2( T2_ON | T2_PS_1_1 | T2_SOURCE_INT, MAX_DUTY);