Go Down

Topic: Arduino - LEONARDO with TLC5940NT (Read 1 time) previous topic - next topic

xsentius

Hi all,

I have been working with arduino for couple of years, but this is the first time to program another chip (TLC5940NT) with using first time LEONARDO.

My main goal is to program, control, the TLC5940 via SPI using LEONARDO. I have been seeing lots of resources about How to program TCL5940NT however i can't see any particular link regarding to using LEONARDO ICSP pins to PROGRAM TLC5940 or similar.

Closes links that i found:

http://openenergymonitor.blogspot.ca/2012/06/arduino-leonardo-atmega32u4-and-rfm12b.html
http://sweetlilmre.blogspot.ca/2012_07_01_archive.html
http://provideyourown.com/2012/arduino-leonardo-versus-uno-whats-new/

My problems is to USE LEONARDO ICSP pins to program TLC5940. Using prebuild libraries are great however, LEONARDO has issues with PIN17 regarding to SS. I have already hard wire the RX-LED.

In order to get back with a good motivation, i am looking forward to see some signals from my TLC5940 output.

Thank you all for your support

pylon

Quote
LEONARDO has issues with PIN17 regarding to SS


What's pin 17 for you? Usually it's equal to A3 but I never heard that A3 was used as SS by the hardware. Pin 17 of the ATmega32U4 is used for the crystal so I guess that's not what you meant.

If you want to use the Leonardo to drive a TLC5940 you probably won't find a library for it because all the libraries I'm aware of are made for the UNO using PWM pins. The good news is that the Leonardo has one additional timer compared to the UNO, so other libraries may be integrated more easily. Nevertheless you might have to make significant changes to the TLC5940 library before you can use it on the Leonardo. The TLC5940 is not really an SPI device (it doesn't have a chip select pin) but the libraries I know use the SPI hardware to send data to it.

xsentius

I understand. I think my problem is to developing a simple SPI interface code with Leonardo...

I can't seem to find any tutorial or source... sigh...

pylon

Quote
I think my problem is to developing a simple SPI interface code with Leonardo...


No, I don't think so. The Leonardo has a simple SPI library, it's called SPI and available for all Arduinos. Your problem is, that the TCL5940 doesn't use SPI but some similar serial interface and it needs a lot more than just SPI (that's why so many pins are used on an Arduino connected to a TLC5940). You can start with the existing TCL5940 library for the UNO and try to emulate the functionality on the Leonardo. Do you really need a Leonardo for your project? It's much easier to just by an UNO and do the TLC stuff there. If you need some other functionality of the Leonardo you may connect the two by p.e. I2C.

xsentius

Hi there,

I don't really have to use Leonardo, but i have already started a research and got some codes to work on with... sigh...

My problem is i can't even get a simple pwm signal from my TCL5940.

// MOSI (Leo outter center ICSP pin) -> SIN (TLC pin 26)
// SCK (Leo inner center ICSP pin) -> SCLK (TLC pin 25)
// SS (Leo RX LED)
// OC1A (Leo pin 9) -> XLAT (TLC pin 24)
// OC1B (Leo pin 10) -> BLANK (TLC pin 23) ->via 2.2K ->5V+
// OC3A (Leo pin 5) -> GSCLK (TLC pin 18)

This is my wiring as above, in addition to TLC pin 22 GND, TLC pin 21 5V+, TLC pin 20 via 2.2K->GND   

In addition, I followed this Code fix...

Still there is no response. Any luck?

pylon

Quote
// SS (Leo RX LED)


This means you ensured that this pin is not used by the USB firmware? So you don't have any reference to Serial in your code? I'm not sure if that's enough BTW because the serial code is active for code uploading anyway and it may be not so easy to deactivate this.

Go Up