Saturday, March 29, 2014

More LED Matrix shenanigans!

It's been about two weeks since my last post.   It took a few nights to wire the sparkfun button pads, and a few more days for various parts, but "we have lift-off"!!   The wiring really got stupid, fortunately I had a ton of leftover cuttoff wire from 3d printers! I used some protoboard which connects to the button pads via header / connector, then i wired up R/G/B/Row/Button connectors.   This literally took me 3 sessions of 2-3 hours each.    be patient, tin EVERY wire and double check each joint!



After wiring it all up, I realized I didn't have anything to connect this to my breadboard!  So i ordered some pre-wired 8 pin connectors, and after a few hours of tinkering (mostly trying different wiring schemes mentioned in the code), I had a few blinky lights!













I'd originally encountered the "Demystifying the TLC5940" ebook and code which got me pretty close, but my row scanning setup was slightly different.   A little more googling lead me to nearly exactly what i needed!
https://github.com/jblang/tlc5940demystified

This guy is using a similar shift register setup to select rows.   He's using a shift register / transistor in one combo device.   I'm using 74HC164 which allows you to shift out w/out the use of a latch pin, and that powers TLC59213 to source the current for the LED's.     I ran the clock of the 164 to the clock of the 59213, adjusted some pins in the code and got what you see above!

Now, this is certainly progress, but its not entirely correct. First off, he's only using a Red/Green matrix, I need one more color!   From what I can tell, in his wiring, he's doing R-G-R-G, etc.   He's also only using 1 TLC5940.  On mine, I'm doing 1-TLC5940 for each color - RRRRRRRRRRRRRRRGGGGGGGGGGGGGGGBBBBBBBBBBBBBB..   I found getting this sorted was just a matter of changing some of the math that selects the pins.   A few more quick changes, and I had both his Plasma and Scoll functions working well!

I've made a fork of the above project on GitHub which can be found here:
https://github.com/billieblaze/tlc5940demystified

Next, I'll be adding some of the Adafruit GFX library functionality and integrating my button row scanning!

No comments: