Very Curious

A project log for Global View

Persistence of vision is awesome

jarrettJarrett 01/04/2019 at 07:394 Comments

So, investigating my unintended blinking problem.

The LED driver I'm using, the TLC5947, has a constant current PWM output, so you only need to hook it up to an LED's cathode, and it will make it run, no current limiting resistor required.

That also means you can't reliably scope the LEDs directly, which is annoying.

So, off an LED comes, and a 500 ohm resistor soldered in place.

The code was then modified to make that position stay "full on". From previous experiments, when the disc is spinning, it's visually apparent that the LED isn't actually on the whole time.

With the following, keep in mind I'm testing on the low-side, so the scope trace is inverted to the "LED on" state.

Here is what I saw:

Yep, that certainly is doing a very bad job of staying on 100% of the time.

So it turns off for about 300ns pulses.

Here's the period:

It's kinda hard to see, but you can see the spikes about every 1.1ms or so.

That's impressive that it's actually visible to the eye, even if it is spinning.

It's a negative duty cycle of 300ns every 1100000ns, or off about 0.027%.

So there are a couple possibilities with what's going on:

Now that I know what I'm looking at on the real hardware, I'll go back to my test devboard and try to recreate it. It's much easier to troubleshoot on that one.


Ted Yapo wrote 01/04/2019 at 11:18 point

I took a look at the datasheet for the TLC5947. I think your code is probably fine, and this is a limitation of the part.

The table on p. 16 says the maximum duty cycle is 4095/4096, or 99.98%, which equates to a 0.024% off-time. Very similar to what you observe. Equation (1) on the same page says the duty cycle is:

On Duty (%) = 100 * GSn/4096

  Are you sure? yes | no

Jarrett wrote 01/04/2019 at 23:12 point

Gah. You are actually totally correct.

  Are you sure? yes | no

Ted Yapo wrote 01/05/2019 at 01:03 point

Can you hack a capacitor (or better yet an R-C combo) in parallel with each LED to keep it lit during the off-time? A small one, so it still turns off when you need it to. There may be a value that could just do the trick.

  Are you sure? yes | no

Jarrett wrote 01/05/2019 at 01:32 point

I wonder. Might give it a shot. Thanks!

  Are you sure? yes | no