Announcement

Collapse
No announcement yet.

Using the SN171 and TI TLC59108F to control LEDs

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using the SN171 and TI TLC59108F to control LEDs

    I am very new to programming and am attempting my first try at programming an LED using I2C. I’ve been asked to use the TI TLC59108F LED driver to control a Clear 'Piranha' Super-flux RGB (tri-color) LED - Common Anode from Adafruit. I am working with a student electrical/mechanical engineer and we are not getting results. I am hoping someone can point us in the right direction. I have attached a copy of my code and the datasheet for the driver. We can load the script onto the SN171 and get an I2C_SUCCESS status back from each function but cannot make the LED light. My question concerns my code; can someone please look it over and tell me if the problem is with the code or if we should be looking at the hardware. We’ve tried to hook the SN171 directly to an oscilloscope and my engineer is telling me that we are not getting expected results. Whatever signal that is coming out is too small to read. The DC voltage cannot be detected and you can only see a small amount of AC. The SCL is connected to GPIO_18 and the SDA is connected to GPIO_17.

    I understand that I may be entirely off base but I would appreciate ANY help anyone is willing to give. I am completely new to programming and am self-taught. Thank you.
    Attached Files

  • #2
    Do you have pull-up resistors on the SDA/SCL lines? Their lack would explain why you're seeing no signal activity.

    It looks like all of your various functions send a single byte of data, which has no possibility of doing anything at all. The minimum I2C transaction for this device would be three bytes:
    1. The device address.
    2. A register address within the device (this also includes some other flags in the high bits.)
    3. At least one byte of data to be written at that address.
    (The SWRST function is an exception to this format, but it requires three specific bytes to be written in a single transaction, to prevent accidental resets.)

    Comment


    • #3
      The engineer tells me that there are no resisters. How would he determine what value resistor to use? He was aware the resistors were needed but was trying to detect a signal first to determine how he needed to adjust the signals to get the timing right.

      As far as the code is concerned: In the preloaded examples, the byteString is built using a series of +=

      def buildPrefix(chipAddress, isRead):
      """internal helper routine"""
      slaveAddress = EEPROM_ADDRESS + chipAddress
      slaveAddress <<= 1
      if isRead:
      slaveAddress |= 1 # read

      cmd = ""
      cmd += chr( slaveAddress )

      return cmd

      Is this the method I need to use to concatenate the addresses?

      Thank you, very much, for your help.
      Last edited by Cathy_Hanna; 11-19-2015, 11:09 AM. Reason: additional question

      Comment


      • #4
        Anything from about 1.8K to 5K should work for the pull-up resistors; 4.7K is probably the most common that I've seen. The required value decreases with increasing speed, increasing number of devices on the bus, or increasing length of the bus wiring.

        You could certainly concatenate the i2c command string together like that. Or, since you appear to be dealing with a single device at a known address, you could simply put the required values in a string literal - i2cWrite("\x96\xA5\x5A") would be the SWRST command, for example.

        Comment


        • #5
          This has been extremely helpful. Thank you very much.

          Comment

          X