Hi all,
Have anybody interfaced a Maple with the TLC5490 LED driver?
It's supposed to be reachable via SPI, but I've had no luck so far.
--Nis
Hi all,
Have anybody interfaced a Maple with the TLC5490 LED driver?
It's supposed to be reachable via SPI, but I've had no luck so far.
--Nis
nissarup - if you are having problems, you might want to try 'bit banging' the interface to the TLC5490. Use digitalWrite to generate a clock and data signals.
E.g.:
const byte dataPin = 9; // a random guess
const byte clockPin = 10; // another random guess
void dummySPIwrite(byte b) {
for (byte bitMask=0b10000000; bitMask != 0; bitMask >>= 1) {
digitalWrite(clockPin, LOW);
digitalWrite(dataPin, (b & bitMask)? HIGH : LOW);
delayMicroseconds(1);
digitalWrite(clockPin, HIGH);
delayMicroseconds(1);
}
digitalWrite(clockPin, LOW);
}
This technique may be enough to get you off the ground, and test the electronics.
Have you access to an oscilloscope? You might also have a look at the signals to see that they make sense.
(full disclosure: I am not a member of LeafLabs staff.)
(WARNING: I have not compiled and tested that code.)
That was what I figured last night that I would do today.
Thank you for the snippet.
nissarup - I haven't checked that code at all.
I just wrote it off the top of my head to illustrate the idea, after a quick glance at the TLC5490 datasheet.
It looks okay, but I wouldn't be surprised if I'd missed something.
Also, the call to digitalWrite()
is so slow that delayMicroseconds()
is probably not needed.
I have been doing some work on getting the TLC5940 working with Maple too. As of right now I can shift the data out using SPI, but I am running into a timing problem setting up hardware timers to take care of pulsing the GSCLK and firing an interrupt every 4096 pulses to clock in more data, so the channels are always either on or off no matter the DC or GS value it has set. :(
Finally, after hours and hours of timer issues (and many forcibly removed hairs) I have my Maple Mini interfacing properly with a TLC5940 using SPI and two Hardware Timers. As soon as I get some more testing done, and Clean up the code I will post it.
You must log in to post.