9 years, 3 months ago.

Extend the number of LED drivers and inputs?

First of all I would like to thank you for this great project. I just started with my first experiments with the pinscape controller and I'm really impressed. But as you described in the documentation the number of LEDs this solution could drive is limited by the number of PWM outputs of the KL25Z. Might it be an option to extend the number of PWM outputs using an IC like the TLC5940? Additionally you can increase the number of inputs using a shift register. In the Arduino world there are libraries for both. But I'm completely new to the KL25Z. Is there something similar?

Question relating to:

An input/output controller for virtual pinball machines, with plunger position tracking, accelerometer-based nudge sensing, button input encoding, and feedback device control.

2 Answers

9 years, 3 months ago.

I've thought about this too! That's exactly the approach I had in mind - adding one of the dedicated PWM LED driver chips and using it to drive the outputs. Using a TLC5940 or something similar would also simplify the output power booster circuitry (for connecting motors and solenoids and such), since you could use it to drive an optocoupler directly. You'd just need an opto, a MOSFET, and a resistor per output. If you went with the TLC5940, each chip would provide 16 outputs, so two chips would be enough for the full the 32 outputs that the LedWiz protocol can handle.

(And thanks to Wim Huiskamp for pointing out that there's a KL25Z library for the TLC5490. That would greatly simplify adding this to the project.)

On the input side, I'm sure you could do something similar with an external key encoder, but I don't think there's much actual need, at least for virtual pinball cabinets. VP itself is limited to 24 inputs from the joystick controller, and that's plenty in practice. I've been pretty completist in building my cabinet, and I think I only needed about 20 button inputs.

Accepted Answer

Great to hear that we are in complete agreement :-)

I would go for the TLC5940 because there's a library and it's available as DIL format which eases the handling for hobbyists.

You're right about the inputs. I think there're already enough of them.

Another nice to have feature will be another single output pin that acts as a mono flop for about 500ms after a configurable time frame after the pinscape is turned on. This one could be used to drive a circuit that turns on TVs in the cab that don't have an auto power on functionality.

posted by Markus Kalkbrenner 19 Jan 2015

The TV switch timer would be a good addition. I actually built a custom circuit with a couple of 555 timers to handle exactly this function on my own cabinet early on. Doing it via a GPIO pin on the KL25Z would have been a heck of a lot easier, but I built that before I even thought about the KL25Z project. A programmable timer would be an easy addition on the software side, and it would fit nicely with adding the external LED driver support, since the LED driver would free up GPIO pins for other uses like this.

posted by Mike R 24 Jan 2015
9 years, 3 months ago.

You can check the component page. There is a lib for the TLC5490. There are also libs for I2C or SPI portexpanders such as the MCP2317.

Thanks for pointing out this library.

posted by Markus Kalkbrenner 19 Jan 2015