What am I doing wrong on the PCA9685 PMW controller?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Leonarnhy
Posts: 4
Joined: Sat Aug 20, 2016 10:03 am
Contact:

What am I doing wrong on the PCA9685 PMW controller?

Post by Leonarnhy »

I'm hoping someone here has some experience with the PCA 9685 PWM controller (16 channel, I2c interface). So far everything is working pretty well after getting the circuit connected properly. I'm using a Picobuck LED driver to drive this high power RGB LED.
PCA 9685 datasheet: http://www.kynix.com/uploadfiles/pdf659 ... 658254.pdf
The PCA9685 allowed for a PWM frequency of between 40Hz and about 1500Hz. The default is 200Hz. After setting this frequency, I can choose the pulse on and pulse off interval anywhere from 0-4096 (which is the pulse resolution). So if I want the LED on full brightness, I can set On=0 and Off=4095. This works fine and I get a nice solid LED.

However if I start to dim one of the LEDs to say 25% of it's brightness, I'll set the On=0, Off=1000. This dims the LED but sometimes it starts to flicker. I've tried a lot of different combinations of On/Off times and PWM frequencies. Even at 1000Hz it is flickering, and it gets worse when I start to use all 3 RGB components.

I'm driving the Picobuck with a seperate 12V DC source, and it has a heatsink. Do I need a resistor or a capacitor somewhere in the circuit to stop the flickering? All I'm trying to do is get the LED dimmable from 0-100% without any flicker, so I can combine the red, green and blue colors.

Here is a picture of the setup, there are no extra components - just PCA9685 board, Picobuck and the RGB LED. The red/black wires off the Picobuck are going to a seperate 12V DC supply.

Image

What am I doing wrong here?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: What am I doing wrong on the PCA9685 PMW controller?

Post by Benj »

Hello,
However if I start to dim one of the LEDs to say 25% of it's brightness, I'll set the On=0, Off=1000. This dims the LED but sometimes it starts to flicker.
Are you setting the brightness just once or over and over again in a loop. If in a loop then you may be resetting the LED duty over and over again.

Simply store the last duty value you sent and compare to the new value you want, if they are the same then don't bother sending to the LED driver to avoid resetting the period.

Post Reply