4x4x4 LED Cube Kit

I saw these on ebay and decided I wanted one so I added it to my "Birthday Wish List" and sent it out to the family.

5/5/2016

The kit is just a bunch of parts. No instructions come with the kit. You must hunt them down from the internet.

The kit contains:

1 PCB board 1 470uf electrolytic capacitor

70 Red/Blue LEDs with long leads 1 40 pin IC socket

2 40 pin female headers 4 1K Resistors

4 Brass stand-offs 4 Auto-Blinking LED with plastic mounting base
(for under PCB)

4 matching screws 1 STC12C5A60S2 Microcontroller (pre-programmed)

1 Barrel Jack to USB power supply line 2 22 p ceramics capacitors

1 PCB Barrel Jack connector 1 11.0592 MHz crystal

1 Length of wire

Assembly:

The kit took me about 8hrs to put together including the time spent building the "jig" to hold the LED while soldering them.

I imagine that without that “jig” or some other guide the results would not have been as good.

It’s suggested that you remove the plastic from around the header pins leaving just the metal pins.

This was tedious but made it look a lot neater. Once complete it fired right up and started blinking the LEDs

Programming:

Of course what I REALLY wanted to do was to re-program the chip and write my own display and control routines.

Sadly I could find no way to download the code from the chip itself and not wanting to have a lifeless brick on my hands

I decided to order up a couple of blank chips and leave the original alone. I didn’t have much luck finding a stateside

vendor for those chips so I had to wait for them to come from China. This was so frustrating that I built an interface

connector that connected the CPU socket to a solderless breadboard with an Atmel ATMega32 on it.

It didn’t take me long to have a few of the routines translated to run on the ATMega32 so I could start building

utility functions that controlled the LED cube displays via menu commands from a serial terminal.

The 12C5A60S2 by STC is an 8051 based microcontroller with 60K of flash memory and 1280 bytes of RAM.

This one is running at 11.0592MHz (this odd value make baud rate selection work out better)

Since it is byte compatable with standard 8051 code I can use the SDCC compiler with it. http://sdcc.sourceforge.net/

Along with the ISP software from the chip manufacturer's site (it's in China so sometimes tough to get

the latest version - just download the one attached below)

When the new chips finally arrived it took some time to get the ISP software to communicate with them.

The built-in serial bootloader responds to only for a short time after power up (not reset) so a little bit of

interface circuitry was needed to allow me to easily remove power from the target board and block any

current feed trough from the RX and TX pins on the serial interface. Each time I wanted to upload new code

I had to hold down the VCC disconnect button, start the ISP upload and immediately release the button.

The chip can only be programmed using the primary UART and the PCB has support for a 4 pin connector

to the ISP. Unfortunately the design of the PCB uses the same pins that the UART uses for RX and TX signals

to drive the LEDs. So I had to make sure the RED LEDs were off when I wanted to communicate with the UART.

This got to be a bit of a pain when a couple of the display routines confused the USB-Serial device so much

that it needed to be reset (unplugged) before programming the chip or the upload would fail.

Later I added a connector for the secondary UART which did not use any shared pins.

This required a second USB-Serial converter during development but the idea was to eventually add an HC06 bluetooth

adapter tucked under the PCB so I could control the LED Cube using a bluetooth terminal app on my phone.

All this is working now, although I'm sure I'll tweak the software as time goes on.

I've got it connected to the bluetooth module and with simple text menu selections I can run any of the 37 display routines

that I've got programmed so far as well as a few special combinations or run them all.

Here's a link to the LED Cube with revised software in action: LED Cube Video

Here's some more photos:

Click on the images for a larger view

Completed LED Cube kit

Lights ON!!

LED Cube in case (not part of kit)

ISP Program screen

Serial Programming Adapter

Menu on phone Bluetooth terminal app.

Attachment Details:

4x4x4_LED_Cube_Instructions.doc These are the instructions I found online copied to a single document.

Serial_Programmer_Adapter.pdf Serial Programmer Adapter Schematic

Uart2_Cube.zip My 4x4x4 LED Cube source code

stc-isp-15xx-v6.85N.zip ISP program for programming the STC12C5A60S2 microcontroller

Links:

stc12c5a60s2-english.pdf (link) STC12C5A60S2 datasheet

The original code cleaned up as posted on gitHub https://github.com/rgm3/ledcube444