LedCube8x8x8

[LedCube pcb]

Abstract

This is a LedCube design that evolved out of a dicusion on the open-light mailing list.

Details

There was a dicusion on the open-light mailing list on how to drive the LEDs of an 8x8x8 LED cube. Adam Davies came up with the initial idea to drive all 64 LEDs of a layer at once and cycle thru the 8 layers. The design can be seen as an led-matrix where the whole layer forms the row and the layers form the column. We need 64+8 outputs to driver the LEDs. The discusion was on what chips to use to drive the LEDs. The two three ideas on how to drive the LEDs where to:

  1. Use 5 MCP23s17
  2. Use 9 74594, 74595 or similar.
  3. Use an ISE40FPGA plus output drivers

The idea from Adam is to use a RaspberryPi running OLA to receive DMX512 data from a LightingConsole via ArtNet and to control the ON/OFF state of each LED with one of the 512 channels of an ArtNet universe.

The ICE40 has the oportunity to add 64 PWM or PPM outputs to dim each LED individually but adds a lot of complexity, as the FPGA might not be possible to drive the LEDs directly and thus needs an off chip output driver, like a p-channel MOS-FET, for each LED. It als needs some programming in Verilog or VHDL, which makes it not easy for startes.

Another aproach was to use five MCP23S17 SPI GPIO expanders. The first idea was to daisy chain them but that is not possible, as it operates in 3-wire SPI only. But the MCP23S17 has three Address inputs (A0..A2) and the first byte in the SPI transfer contains a read/write bit as well as an address. That means that up to eight MCP23S17 can be connected to a single SPI chip select line. Because the linux spi driver supports combined spi transfers, it is possible to change all outputs of all MCP23S17 on the same chip select with one ioctl call. The outputs will not change at the exact same time but very close to each other.

The third aproach, introduced by Peter Stuge was to use a serial to parallel shift register with an output latch, as the 74'594 or 74'595. Two pins (SCLK,DI) are used to shift the data serially into the shift register, where the priviois data is shifted out via a DO (QS7) pin. Another pin makes it possible to latch the shift register content to the outputs at any time. By using the chip select pin for that purpose, it is possible to clock all 72 outputs with one spi transfer and all bits are loaded to the output at once.

An extension to the 74'594 solution it to use a PWM output to load the shift register at a very constant rate and feed the pwm back to the SoC via a gpio configured as interrupt input. The software can wait for the interrupt and issue an spi transfer, as the data from the last transfer has just been copied from the shift register to the output stage. That creates a very precise timing.

Here are some KiCad renderings of the different boards.

[LedCube-mcp23s17 pcb] [LedCube_sn74594 pcb] [Rpi_LedCube_adapter pcb]

Files


Last update: 2021-03-07
Contact me via: