Tlc5940 chaing pinouts to work with other shield

Hi all,
recently on my project i need to use the nu-electronics ethernet shield + an tlc 5940.

Since the ethernet shield takes the entire pins from 8 to 13, i need to reconfigure the tlc 5940 library to use the pin from 2 to 7.

Is it possibile? if yes, wich file i should change of the tlc5940 official library to fit this change of pins on an atm 328?

tnx a lot

I don’t think this is possible because the TLC5940 drivers assume special hardware attached to those pins (timer outputs, SPI signals and so on). To do all that “by hand” would require a major rewrite.
However, some of the earlier versions of this library were a lot freer with their allocation of pins although I seem to recall some were still tied to hardware specific pins, have a look through past posts for links to earlier libraries.
My own project Mini Monome hacked an earlier library to make the chip multiplex, have a look at that software, it might help.

i download the zip from your site, and find the file to configure the pinouts. but still have 2 pinouts on the 8-13 range...

the file also include this comment

// !!! --- The pins below cannot be changed because they're driven by timers --- !!!

// XLAT = TLC pin 24


define XLAT_PIN PB1


// BLANK = TLC pin 23


define BLANK_PIN PB2


so looks like i can't be change it, even if i don't get what "DRIVEN BY TIMERS" means

i don't get what "DRIVEN BY TIMERS" means

It means that the internal timers change these pins automatically (without ant extra software intervention) once they are set up. In this case they put a clock of a defined frequency out. Rather in the same way a PWM output constantly changes from high to low without having to have code putting them high and then low. It looks like both peripherals need the same processor resource. Sorry

oh ok, now i got it!

whell since it dosn’t work with one arduino… i’m going to use two. or better, two atmega, one for let the ethernet working that send data to the second that will provide the management for the tlc…

other idea ?

I have the same problem and ask in the dev forum but no answer.

I didn't test it but the Ethernet shield use only 4 pin of the arduino (10 to 13) the other pins are for the sdcard I think but in my case the Ethernet shield doesn't have it.

The tlc5940 has to be in bit bang mode so it doesn't use the pin 10 to 13.

This should work, I am going to test it soon.

I think you right, there is problem...Doing the schematics now and there are some pin overlapping

I was looking the code and really there is only the blank signal which give a problem as the xerr is optional. I think we can change BLANK from timer1 to timer0, the only difference should be the precision of the timer. I am going to try this. If you have anymore ideas...

It doesn't work :(

A small update

I modify the ethernet shield following this : Arduino Ethernet Shield MEGA hack « MCUKITS
to free the pwm of pin 9 and 10.
Look at my comment at the end of the page as the beginning is for the arduino mega.
I load a sketch with the ethernet library (modified) and the tlc5940 library (modified to be in bit bang mode) and I still have the etherent working.
I am in the process to test with the tlc.
I will post result later

So , it is working , the ethernet shield together with the tlc 5940.
The ethernet shield with the previous modification and the tlc5940 in bit bang mode (XERR is not use as it must be change to another pin, this will be next step)
If somebody can test it and confirm it.

hola toffe sorry for the long delay!

actually i'm using the ethernet shield form nu electronics, and i'm not at all sure about it was similar to the ethernet you are using, if yes, i will very happy to help you in the test... have you got a skype account ?

hola snick sorry for the long delay too ! (vacation and a lot of work...)

My project is almost finished. I already test the 2 libraries together but I am designing a board and I should finish it this week. If it is working , I will make a simplified version as this one is really specific. It will be an arduino with ethernet and without usb, and direct interface for tlc5940 Keep looking.

I have a skype account but never use it. You can reach me on the IRC , I am connected all day (USA time)