Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing the BS2 to a TLC5940 — Parallax Forums

Interfacing the BS2 to a TLC5940

billiambilliam Posts: 12
edited 2008-08-05 03:57 in BASIC Stamp
My eventual plan is to have my BS2-SX work as a controller for 16 RGB LEDs. I recently bought 3 TLC5940s to drive the LEDs. Since the LEDs aren't in as of yet, I am testing the chips out with a 5x6 red LED matrix that I whipped up last night.

So far, using the datasheet and programming flowchart, I've wrote a program that will turn all 30 LEDs on, but I am confused on a few points.

I've attached my code and here is the programming flowchart www.ti.com/litv/pdf/slvc106 that my code is based on. My code is peppered with little comments about what I was thinking / trouble I had at the time of writing. (I'm new so be nice haha)

So, anyways, I assumed when I first looked at these chips that there would be a way that I could set and forget the LEDs. I'd like to end up with a procedure set_led or something like that which would set a certain LED to a certain brightness, and that would hold until I set it differently.

According to the flowchart, there's the GSCLK which is to be pulsed 4096 times. Why 4096, and why does it constantly need to be pulsed? How could I achieve my set and forget procedure?

Also, 4096 clock pulses seems to take about a half second on the stamp. Having to pulse GSCLK 4096 times for every grayscale change would render fades impossible.

There has to be something that I am not seeing here, help!

Thanks!

Comments

  • billiambilliam Posts: 12
    edited 2008-08-03 18:24
    Anyone? I'm completely lost.
  • billiambilliam Posts: 12
    edited 2008-08-04 02:53
    Hm, now I'm not exactly sure that the Stamp will even be able to do this. There's documentation from people who have driven this chip with the Arduino; maybe I'll give that a try.
  • billiambilliam Posts: 12
    edited 2008-08-05 03:48
    Well, I think I just blew the chips [noparse]:([/noparse] So much for that
  • Mike GreenMike Green Posts: 23,101
    edited 2008-08-05 03:57
    Condolences.

    It looked like more work to interface than I'd like to get involved with. The GSCLK looked like a PWM clock with a 12-bit counter that wrapped around every 4096 clocks. You'd probably drive this from some kind of external oscillator, maybe a 555 timer in asynchronous mode.
Sign In or Register to comment.