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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

1,659 Views
szabolcsszekely
Contributor I

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:

Screen Shot 2017-07-03 at 02.55.34.png

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

Tags (2)
0 Kudos
3 Replies

638 Views
EliTheIceMan
Contributor I

I'm also seeing this issue.  OP mentions "when OFF is updated" so I tried (off)setting all the OFFs just once then only changing the ONs.  (This requires "change on STOP" and each pair of registers has to be addressed)  I still see the issue anyway.  Setting the highest possible PWM frequency (1.5 kHz) does not fully solve the issue.  I can still see flicker when doing any kind of fade or change.

0 Kudos

1,225 Views
guoweisun
NXP TechSupport
NXP TechSupport

Hi,

I try to understand you but some doubt.

Issue happened conditions:

1:LEDn_ON > LEDn_OFF and LEDn_ON =2048,so you can recurrence this issue on LEDn_ON =2048 and LEDn_ON > LEDn_OFF,right?

2: On condition item1 above you can see empty cycle,empty cycle means LED turn off,right?

Thanks!

0 Kudos

1,225 Views
paul-pce
Contributor I

I have exactly this issue right now, did you ever find a solution? I can turn off load balancing and the problem goes away: what are the likely side effects of this?  I presume it's just greater instantaneous power draw on each rising edge, presumably leading to increased EMI? Is there anything else that needs consideration?

0 Kudos