o28 LED matrix - serial protocol

Is there any documentation about the serial protocol used by the o28 LED matrix?

Can the cloudbit hardware physically put out the data in serial form? (Obviously that would require new code on the cloudbit.)

Similar question:

I have the Arduino bit and the 650-0028 LED Matrix bit.

Is there protocol documentation, code samples, or identification of the underlying manufacturer and part number of the LED color matrix that would assist in programming using the Arduino bit?

Hi Gary @GaryG and Ian @Hixie,

Nearly all bits can be found on Github, see https://github.com/littlebits
But unfortunally all the more recent bits are missing there, also the LED matrix…
Maybe you can send a request for information to the Littlebits support team, they can be contacted here:
Maybe they can supply the requested information, I think the Littlebit bits are open source…

Hi Alex @alexpikkert and Ian @Hixie,

Thank you for the link to GitHub. Indeed, I see there is even the firmware there for the older bits should someone want to build his or her own.

I see from their Tips & Tricks that the o28 has very nice OOTB functionality http://littlebits.cc/tips-tricks/led-matrix-bit. One can make it do interesting things by manually selecting a mode and using switches and dimmers as inputs. A nice abstraction layer from the littleBits engineers.

The o28 also is well supported for programming by their education division using its Code bit and Sketch.

Using Sketch is probably a good choice for educators to assist them in managing their classroom time. Less to explain and debug, but the Code bit Sketch approach comes with at an entry cost of $299 – and I already have boxes of bits.

For my 10-year-old grandson, he already understands Sketch, and the Arduino provides a sandbox for learning programming using a text editor. Of course, even the Arduino is a short-term item based on small microcontrollers. Moore’s Law has made Apple’s Swift Playground the current programming platform for many young people. We just need some packaged bit integration. Nonetheless we will still need protocol specs to actuate devices.

Well, in any case, I’ve taken your advice and submitted a request for some documentation on setting modes and sending data to the o28 from the Arduino.

Thanks for the suggestion!

1 Like

Did anyone from LittleBits get back to you @GaryG about the serial protocol?

If not, I’m wondering if it’d be possible to attach an Arduino Bit to the Code Bit to figure out the serial protocol.

The Arduino Bit appears to support serial-in on the top left input bitsnap. Would attaching the Code Bit serial output to that, and then writing an Arduino sketch that outputs any data received on serial-in, allow seeing the data, and thus enable reverse-engineering the protocol?

The standalone Code Bit is less than the cost of the entire Code Kit.

I got an oscilloscope and reverse engineered the protocol.

The w26 codebit sends serial binary data to the o28 LED matrix to show images. Each image is a sent as a 12.1ms burst of data.

When no data is being sent, the voltage of the data line is kept at 5V.

Data is sent as a series of eight-bit bytes. Each byte takes about 175.5μs. Each byte begins with 17.3μs at 0V, then eight bits, least significant bit first, each 17.3μs long, at 0V for 0 and 5V for 1, and finally a terminating 5V for 19.5μs.

The preamble is four bytes, 0x1C001140 (in network byte order). The postamble is one byte, 0x26. One or both of these probably change based on the configuration; I was testing a 1x1 matrix group (i.e. just one LED matrix).

The image data is 8 bit RGB. On the wire, the first two bits of each byte represent the blue signal, the next three bytes represent the green signal, and final three bytes represent the red signal. This is equivalent to the low two bits being blue, the next three bits being green, and the high three bits being red.

For reasons I cannot explain, pulses from the w26 codebit are sometimes arbitrarily longer than they should be according to the description above. The o28 LED matrix appears to either ignore bogus data or somehow correct for it; either way, I don’t see glitches on the LED matrix when glitches happen in the output of the codebit.

I haven’t tried reading or writing serial data via the cloudbit yet, but adding that feature to my localbit project is my next task. I’d be very curious as to whether anyone manages to get the arduino bit to control the LED matrix.

which is apparently RS232, 58K/8-N-1.

Here are some more detailed notes I wrote up about the protocol: