Improve Charlieplexing Performance With Interrupts

single_chip_led_matrix

[Dmitry] was shopping for LEDs and accidentally pulled the trigger on the wrong type. Since he didn’t want to be wasteful, he figured he should at least take the time to build something with them.

A LED matrix display was the obvious project choice, but he only had a PIC16F688 at his disposal. Since the micro controller only has 11 output pins, charlieplexing was the only way he would be able to light the entire matrix.

While testing his LED array, he found charlieplexing to be a bit disappointing. The fact that the LEDs can get relatively dim, depending on the number of units lit at any particular time struck him as annoying.

In order to improve the performance of his charlieplexed array, he first decided to scan through all of the LEDs rather than just those that needed to be lit. This ensured that all of his LEDs had the same 1/110 duty cycle and were always as bright as possible. He also chose to use interrupts when lighting the LEDs. This meant that his code does not need to take into consideration any specific timing requirements to maintain persistence of vision. He also double-buffers the display to help reduce flicker.

He says that he ran into certain constraints with the PIC chip he chose, so he used a handful of lookup tables to ensure smooth operation of his display. He was quite satisfied with the results, and we think that the interrupt-driven display looks like it works just fine from where we’re standing as well.

Be sure to stick around for a quick video explaining and demonstrating his single-chip LED matrix.

Continue reading “Improve Charlieplexing Performance With Interrupts”