TLC59711 and Raspberry Pi troubleshooting

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
aneel
 
Posts: 6
Joined: Fri Aug 09, 2013 7:29 pm

TLC59711 and Raspberry Pi troubleshooting

Post by aneel »

I'm having some trouble getting the TLC59711 ( http://www.adafruit.com/products/1455 ) to do anything. Any thoughts on what I can do to troubleshoot?

I have the TLC59711 hooked up to a Raspberry Pi and a 12V power source:
GND = shared ground between RPi and 12V source
V+ = 12V source
CI = RPi CLK
DI = RPi MOSI
The Green LED on the TLC59711 board is on and the VCC pin gives 3.3V, as expected.

I've hooked up an LED to each of R0, G0, and B0. If I connect the LED to the adjacent V+ pin (with a current-limiting resistor) instead of the output pin, it lights as expected. [Aside: I shouldn't need a resistor using the output pins, right? The TLC59711 with your 3.3k resistor should limit the current to 15mA. I've tried it both with and without.]

I'm using this Python library to do SPI: https://github.com/lthiery/SPI-Py
I've confirmed that if I connect the RPi's MOSI and MISO pins, I get back whatever I send out, so the data appears to be being sent properly.

Based on the Arduino sample that you supply ( https://github.com/adafruit/Adafruit_TL ... C59711.cpp ), I'm sending:
0x96 0xDF 0xFF 0xFF, followed by 24 bytes of data (16 bits * 12 outputs).
Those first four bytes translate to the same thing the Arduino code sends:

Code: Select all

100101 10110 1111111 1111111 1111111
0x25   0x16  0x7F    0x7F    0x7F
As far as I can see, this should make the TLC59711 light each LED with the value given in the data, but it doesn't.

Here's the python I'm using...

Code: Select all

>>> import spi
>>> spi.openSPI()
{'delay': 0, 'speed': 500000, 'bits': 8, 'mode': 0}
>>> data = (0x96, 0xDF, 0xFF, 0xFF) + tuple([0xFF for i in range(24)])
>>> len(data) * 8
224
>>> resp = spi.transfer(data)
>>> print " ".join([hex(x) for x in resp])
0x96 0xdf 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TLC59711 and Raspberry Pi troubleshooting

Post by adafruit_support_mike »

Everything you've done sounds right.

The only variation I can think of would be to try SPI mode 3 rather than mode 0. That will drop the clock to 0 before sending the first bit, which might be an important detail since the chip doesn't have a CS line.

BTW, you're correct that you can connect an LED directly to the output pins. The chips limits the current, so no resistor is necessary.

aneel
 
Posts: 6
Joined: Fri Aug 09, 2013 7:29 pm

Re: TLC59711 and Raspberry Pi troubleshooting

Post by aneel »

Thanks. I tried mode 3, but it doesn't make a difference. I'm going to try testing the unit with a friend's Arduino.

I haven't gotten this to actually work, but maybe my python code for controlling the PWM driver will be useful to someone: https://github.com/WanderingStar/rpi/bl ... lc59711.py

User avatar
megatechbuddy
 
Posts: 1
Joined: Thu Sep 11, 2014 10:46 pm

Re: TLC59711 and Raspberry Pi troubleshooting

Post by megatechbuddy »

I just wrote code for it in python on the raspberry pi but i checked everything over and over, it still does not work. Python is too slow! So it won't work if it is too slow.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TLC59711 and Raspberry Pi troubleshooting

Post by adafruit_support_mike »

Good point.. Python, like all interpreted languages, will always be slower than compiled machine code.

Thanks for adding to what we know about the TLS59711 though.

User avatar
Herbie8334
 
Posts: 1
Joined: Wed Apr 22, 2015 11:06 pm

Re: TLC59711 and Raspberry Pi troubleshooting

Post by Herbie8334 »

Hi - I just came across this post. I've been using this part with my Rev 2 Pi and the WiringPi C library. Seems to work just fine using the byte pattern in the original post. My code doesn't configure the SPI mode, so I guess it's whatever's default for that library.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”