Tuesday, October 4, 2011

LEDs working together!

My progress this week can be summed up in a few photos and a video.

We had gotten our parts in late in the week, so my goal was to begin down the path of software work by getting a couple of TLC's working 10 RGB LEDs. The schematic used is remarkably similar to this schematic found at theArduino Playground for TLC5940's. The only difference now that I will incorporate is that I didn't use the pull-up resistor on the BLANK signal. This now seems remarkably useful, since the chipKIT Max32 seems to write out random data on start-up, and has about a 3 second bootloader before it becomes usable.

This programming did not come along without its share of problems. First off, since I just wanted to get something going, I had to use unsigned ints, as opposed to unsigned 12 bit numbers for storing the RGB values of each pixel. It appears like I will need to overload the assignment operator, something I could not take care of in the short time span that I had.  The software is fairly crude and is actually fairly slow. I was aiming for a proof of concept right now, which was exactly what I managed to achieve.

There was another head-scratcher of a problem that I was having for a while, and probably cursing TI for not more clearly stating, but I was wondering why when I would write out data, latch it in, and try to taggle the GSCLK pin for about 20,000 times for some birghtness level testing, the LEDs would flash and then shut off until the next write. I poured through the datasheet until I finally found this part of a paragraph explaining how the PWM clock actually works: " A BLANK=H signal after 4096 GSCLK pulses resets the grayscale counter to zero and completes the grayscale PWM cycle. When the counter reaches a count of FFFh, the counter stops counting and all outputs turn off. Pulling BLANK high before the counter reaches FFFh immediately resets the counter to zero. " This essentially interprets down to the fact that the TLC5940 features no reset on overflow feature. Fixing the above code to toggle an entire PWM clock cycle (4096 times) and repeating that for the desired timespan fixed the problem. 

Once this was fixed, I was able to then adjust values for each brightness level to show a nice progression, and hopefully I have white balanced it (according to a couple of artist friends I have at the school). My goal over the next week is shift my attention towards finishing out the schematics, getting our bending guides in so we can start assembling panels, and to create a full mockup in Autodesk Inventor for the cube itself. My biggest focus will be the PCBs and final circuit design for the cube, so that we can get these sent out to a fab house to print out for us, and get these back before the end of the term.

Below is a video explanation and demonstration of the progress made this week.

No comments:

Post a Comment