TLC 5940NT and Ethernet Shield on same arduino

http://vimeo.com/22679194

TLC  is a demultiplexor wich allows to pilot more entries and outputs than a single arduino.
Arduino UNO allows only 6 PWM, 6 "analogic" output..
TLC enables 14 outputs graduated..
TLC is easely daisy chainable. Wich enables you to pilot a lot of channels from the same arduino.

Ethernet Shield enables communication with arduino thruth ethernet cable. You can have good distances and use cheaps ethernet usbto make some complex installation.
Sketch furnished here allows to receive DMX signal in Art-Net protocole and pilot outputs of TLC.

Trouble is that TLC and Ethernet Shield are using same pins and have conflict.
This page is a quick synthesis of the great hack by Tofe86, who has improved uses of TLC and Ethernet shield for various Arduino. http://arduino.cc/forum/index.php/topic,22111.0.html

This hack concerns libs ethernet, tlc, and part of the core headers of the arduino software.

It is recommanded to duplicate the folder containing your arduino software, rename it clearly ( arduino_22_hack_for_tcl ).
Use only the hacked version to program your project based on an ethernet/TLC combination.
If you want to program your arduino classicaly, use the untouched software.

What to do:


1-Open folder Hack. Copy its content inside arduino software folder. Overwrite following files: pins_arduino.h , w5100.h.
The hack folder contains already the hacked  TLC5940 library wich will be pasted inside the libraries folder.

2-Do wiring job as following ( 14 leds not all represented )

All the pins are connected between ethernet shield and arduino except pin 10 !

3- plug usb of the arduino, open the sketch artnet_et_tlc.pde

4- you may perhaps want to edit IP values :

   byte ip[] = {   192,168,1,177 };

MAC adress:
It will be very usefull to edit MAC adress if you have many ethernet shields on same network.
To convert the adress wrotten in hexa on the shield ( sticker) you may use this online converter, from hexa to decimal:
http://www.frankdevelopper.com/outils/convertisseur.php


5- if you want that TCL will listen to other circuits than 1 to 14, edit at the end of the sketch:

 for (int channel = 0; channel < NUM_TLCS * 16; channel ++)
  {   
    Tlc.set(channel,(int) (buffer_dmx[channel]*16) );
    Tlc.update();
  }:


            - changing 0  by first channel number desired
            - ading in front of NUM_TLCS*16  :          ( first channel number desired) + NUM_TLCS*16    

So if first channel to be used with TLC is desired at 56:

 for (int channel = 56; channel <56+ NUM_TLCS * 16; channel ++)

6- in case of you have some TLC daisy chained, edit manually in tlc_config.h NUM_TLCS. Where NUM_TLCS is the number of TLC daisy chained...



Thanks to Patrick Raddatz, who founded an old post on VVVV where i was talking about 12v dimmers....
Patrick is preparing a lighting installation/performance, and was searching for a cheap way to work with mosfets and 12v dichroics.
I have finally worked on this art-net and TLC issue because of him ! Thanks Patrick.


christoph guillermet
karistouf@yahoo.fr