AnsweredAssumed Answered

How to avoid PCA9685 flickering at high values when LEDn_ON > 0

Question asked by Szabolcs Szekelyi on Jul 2, 2017
Latest reply on Apr 13, 2018 by G.w. Sun

Hello,

 

I just found out that an LED attached to an PCA9685 output start to flicker when LEDn_ON > LEDn_OFF and LEDn_OFF is updated regularly. To reproduce, set LEDn_ON to 2048 (register 0x06 = 0x00, 0x07 = 0x08), then ramp LEDn_OFF from 2048 to 4095 then from 0 to 2048). This should produce a nice smooth increase in brightness from minimum to maximum, but practically when it reaches half the brightness, it starts to flicker.

 

Looking at the datasheet (http://www.nxp.com/docs/en/data-sheet/PCA9685.pdf) fig. 11 on page 20 this looks according to design, the problem is whenever LEDn_ON > LEDn_OFF and the LEDn_OFF register is updated, the device skips one whole output phase, switching the output off regardless of the registers -- look at the empty cycle between "register(s) updated in this cycle" and "output(s) updated in this cycle". There's no empty cycle when LEDn_ON < LEDn_OFF as seen on fig. 10 on the preceding page.

 

This is how it looks like with a logic analyzer:

PCA9685 anomaly

This is a smooth ramp up of the LEDn_OFF register from 0 to 4095 with LEDn_ON set to 2048. The empty cycles after each register update cause a dropout resulting in a double period length and thus a duty cycle of 25% instead of 50%.

 

Is there a way to avoid this kind of behavior and still benefit from output load balancing?

 

Thanks,

--

Szabolcs

Outcomes