2 - A new approach

Now that three out of four possible solutions for driving leds seemed not to works within the scope of the "design goals", I headed for the fourth, which means using special ics to handle the leds. Some quick searching revealed, that the most common and most versatile is the TLC5940, manufactured and designed by Texas Instruments. This chip can drive 16 leds at a constant current. It features an 8bit dot correction to compensate for differences between the leds (if necessary) and can create PWM with 4096 steps at very high frequencies (in ranges of kHz). All in all, this is a good chip that can be found for just 3€ when ordering at big companies. Smaller shops sell it for about 6€.

Using just 4 of these chips for one wheel seems an easy solution, but is quite expensive. So my idea was to reduce the number of TLC5940s to just one per wheel. How does that work?

Now, the TLC5940 expects you to supply it with a clock for its PWM generation. Because you know exactly after how many clock pulses one PWM cycle is over, this allows you to merge this chip with the idea of led matrixes. Here is the circuit that results from this idea:


Basically, you use the p-channel mosfets as power switches. One mosfet is switched on at first and powers one matrix "row" of 16 leds. Now that these have power, you can start supplying the TLC5940 with clock pulses for the PWM generation until on PWM cycle is over. Then you switch off that row of leds and switch on the next row. This way you effectively "change, which leds are connected to the TLC5940". The other three rows of leds will have no current flowing, because they are not connected to power.

Doing this fast enough will make all leds appear lit steadily, although they aren't.

The TLC5940 accepts its data via the same serial interface as all shift registers do. Basically, it is a 192bit long sipo shift register with lots of special circuitry connected to its "output pins". Basically that means, you can cascade more that one TLC5940 or other shift registers in any fashion you want. For my circuit I needed for more pins to do the "row-switching". I made use of the cascading-possibility and added a simple sipo-shift register to gain more outputs in close proximity to the TLC5940. This minimizes the amount of wiring between the micro controller and the led-board. So by clocking out 200Bytes of data, the complete set would be updated.

Some calculations:

Clocking out one byte takes 8*4 cycles (see above), this equals to 1,6us. The ISR for sending out the next byte can be programmed very efficient in assembly language and will only take about 1us. Roughly this means 65us of processing time for one matrix cycle (= 25 byte). It requires four matrix cycles to run the full number of 64 leds. Assuming that the matrix will be updated 100times a second, this means each 5000us there will be 260us of time spend with updating the leds. This leaves approximately 94,8% of processing power for other tasks. Even when using inefficient ISR programming (8,6us per byte) this would mean 860us of time spend with updating the display (82,8% spare processing time). Taking these results, it seems no problem to increase the refresh rate by 3 or 4 to gain 100% flicker-free images, even on cameras.

Compared to the shift-register approach, this method gives the micro controller a lot of free time. It only needs to supply a PWM clock and switch the rows on and off from time to time.

Based on these ideas, I designed three pcbs.