TLC5947 Programming

Discussion in 'The Projects Forum' started by 88sfms, Mar 31, 2014.

  1. 88sfms

    Thread Starter New Member

    Mar 31, 2014
    2
    0
    I'm very new to microcontrollers and relatively new to circuits all together. I've been working on a side project, trying to teach myself a little bit about each. I have a TLC5947 that I am trying to program to do some simple tasks with RGB LEDs. So far, most forums or tutorials only involve programming the chip with an Arduino board. I already have a PIC18 that I have used on a few other small projects and would like to program without the Arduino.

    So far, I have it set up to where SCLK, SOUT, BLANK, and XLAT are connected between the two, but I'm having trouble deciding what functions I need just to write basic colors to the LEDs. I can do this when I have the LED connected directly to the PIC by using #define red PORTBbits.RB0 = 1; PORTBbits.RB1 = 0; PORTBbits.RB2 = 0;. I would like to be able to connect multiple LEDs, each with the possibility of a different color. This was my main reason for choosing the TLC5947 due to its 24 channels. Can anybody help me find a place to start?

    Thanks.
     
  2. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,131
    267
    The TLC5947 is not the simplest chip to interface with.
    Your are going to need an oscilloscope to verify what is going on, otherwise this will be very frustrating to debug.

    Best to use the SPI serial engine in the PIC to send the serial data, you can also bit-bang the serial data, but it will be slower.

    Read the part data sheet VERY CAREFULLY to be sure you understand what the chip needs, then write your code.
     
  3. 88sfms

    Thread Starter New Member

    Mar 31, 2014
    2
    0
    So the Serial IN pin on the TLC should be connected with SPI Out on the pic? I'm not even sure if I fully understand how XLAT works. I know that it's the PWM and that when it is low, the outputs are on. But past that, I'm lost.
     
  4. Sensacell

    Well-Known Member

    Jun 19, 2012
    1,131
    267
    Read up on the SPI interface first, then read the datasheet for the part.
    It will all make more sense when you grasp the basics of SPI.
     
Loading...