julio2020 / tlc5940arduino

Automatically exported from code.google.com/p/tlc5940arduino
0 stars 0 forks source link

I2C/Wire Library doesn't work with TLC Library #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Include <Wire.h>
2. Add Wire.Begin() and Wire.OnRecieve() handler to Setup() loop
3. Add the OnRecieve function
(all copied from the Wire Library Slave demo)

What is the expected output? What do you see instead?
With another Arduino acting as the Master, I anticipated the slave to 
print the received integers via Serial. The slave is the chip controlling 
the TLC.

I confirmed that my I2C setup was correct by commenting out all of the TLC-
related code, and the receive handler worked perfectly.

I began adding the TLC code back, one piece at a time. Including the 
libraries didn't break I2C, but once I uncommented Tlc.init(); it stopped 
working. I tried placing the init function before and after the Wiring 
setup functions to see if that made a difference, but there was no change.

What version of the product are you using? On what operating system?
I am using an Arduino Diecimila, ATMega168, Arduino IDE 0016, and it's on 
an amd64 Ubuntu box. My TLC version is r014.

Programming at this level isn't my forte, but from what I can tell, the 
TLC5940 uses serial communication to control it. I'm guessing it's 
something similar to I2C, but the data sheet doesn't mention it. I'm 
pretty sure that the TLC's serial requirements are what's breaking the I2C 
stuff....but how do we get around it? Since the ultimate goal is to get my 
slave Arduino to be a standalone device, I would like to avoid having the 
added bulk of the USB or Serial connections.

Thanks!

Original issue reported on code.google.com by njphill...@gmail.com on 31 Dec 2009 at 2:38

GoogleCodeExporter commented 8 years ago
I just started doing some digging into the TLC files, and I'm wondering if 
changing 
DATA_TRANSFER_MODE to TLC_BITBANG would make a difference?

Original comment by njphill...@gmail.com on 31 Dec 2009 at 4:39

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm having a similar issue when utilizing the Arduino LiquidCrystal Library.  
Everything works fine with the LCD until I call Tlc.init(), then gibberish is 
sent to the LCD when I print out to it?

Original comment by sharpem...@gmail.com on 19 Feb 2011 at 6:56

GoogleCodeExporter commented 8 years ago
TLC + LCD. I did connect both to Arduino Uno and it works. You have to connect 
it that way:
Pins LCD an Arduino
4 - 8D IN
6 - 7D IN
12 - 5D IN
13 - 4D IN
11 - 6D IN
14 - 2D IN

//so you have to initialize the LCD like this:
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 7, 5, 4, 6, 2);

Pins TLC5940 an Arduino
26 - 11D IN
25 - 13D IN
24 - 9D IN
23 - 10D IN
18 - 3D IN

I hope that helps

Original comment by bue...@am3d.de on 12 Mar 2011 at 5:14

GoogleCodeExporter commented 8 years ago
Has this issue been resolved? Can the Wire library be used with the TLC library?

Original comment by scottall...@gmail.com on 2 Dec 2013 at 6:10

GoogleCodeExporter commented 8 years ago
To follow up, the two libraries do work together fine. I have successfully 
driven 11 daisy-chained TLC5940s using this TLC library while also using I2C 
(Wire/TWI) communication, all on an Uno.

Original comment by scottall...@gmail.com on 5 Dec 2013 at 1:03