This weekend I successfully developed a coding approach that allowed me to drive the LED strings discussed in previous posts with a PIC microcontroller. My work with the Agilent 33522B ARB gave me enough insight into timing and power supply loading that I could begin work on writing code to get a PIC to generate pulse streams to produce light displays on the LED strings.
In upcoming blog posts I will continue to illustrate how the Agilent ARB was used to characterize the LED devices and the approach I took that enabled full control of the LED strings using a PIC microcontroller. I challenged myself to write the pulse generating routine without resorting to in-line assembly, use of hardware timers or interrupts. The algorithm was devleoped in a really simple high level language - PIC BASIC Pro. A good amount of thought went into getting the algorithm to work so that pulse timing was not violated. To generate well timed 500 ns pulses I used a 10 MHz external resonator and boosted the clock up to 40 MHz using the PIC's high speed PLL clock multiplier.
Writing a function to produce a continuous stream of properly timed pulses in real time was the major hurdle. Once the funciton was working it took mere minutes to develop all sorts of interesting light patterns - light chasers, color changing fades, sparkles. There should be enough time for me to get this project to the point where I can place a few LED light strips on the Christmas tree and remotely control the light pattern.
I hope to have a post up this weekend sharing what I've done so far.
Mark