TRIKLITS Protocol

This document describes how to control the Triklits if you wish to write your own driver or build your own controller.

Design Philosophy

The Triklits were originally designed as a way to build large computer graphics type displays. In our design we assumed a very large number of lights, constantly changing color at a very high refresh rate. In addition, we wanted every light to change at the exact same time, even if there were thousands of them. This is in contrast to other lighting control systems such as those using DMX protocols which are generally for slower stage lighting effects.

The Triklits protocol may seem a little strange at first. The protocol was designed in order to make the hardware for each light as cheap as possible. We assumed there would generally be a more powerful computer system generating the data to control many lights, so we moved some of the complexity to the software in order to reduce the hardware costs.

Addressing

Each light on the Triklits string has a hardwired address from 1 nearest the controller to 24 at the end of the string. However, addresses are not sent to the lights. Instead, each light picks up its RGB data from the appropriate slot in the data frames.

Data Frames

Data is sent to the Triklits in frames. Each frame contains the RGB values for every light on the string. The frame starts with a header, followed by up to 24 sets of RGB data, and ending with a trailer. Ideally, frames are sent back to back with no idle time between them. If there is nothing to send between frames you can send zeros (hold the line low) for any amount of time.

Timing

Data is sent at a rate of 40khz or 40,000 bits per second (25usec/bit). The Triklits can tolerate an error of at least +/- 1% off frequency. For low cost applications the transmission could be generated by a device such as a PIC microcontroller that has a built in oscillator trimmed to 1%. However, we suggest a crystal controlled transmitter for the highest reliability.

Data Format

A data frame is (usually) 776 bits long. It consists of 4 header bits, 32 bits of RGB data for each of the 24 lights, and 4 trailer bits. The frame is made up of data that is always sent in multiples of 4 bits. The fourth bit of each group of bits is always the compliment of the 3rd bit, except in the trailer.

Header

The frame header is 0 0 1 0.

RGB Data

The RGB data for each light then follows in sequence. The Red, Green and Blue values for a light are each 8-bit numbers. The RGB values are interlaced, starting with the lowest order bits. Each set of those 3 bits are followed by a fourth bit we call the P bit. The P bit is always equal to the compliment of the previous B bit. So to send the RGB data for one light the bits sent are:

 R0 G0 B0 P
 R1 G1 B1 P
 R2 G2 B2 P
 R3 G3 B3 P
 R4 G4 B4 P
 R5 G5 B5 P
 R6 G6 B6 P
 R7 G7 B7 P
This sequence is repeated 24 times to send the data for each light.

For example, to send the RGB value 1,2,3 the 32 data bits sent would be: 1010 0110 0001 0001 0001 0001 0001 0001

Trailer

The frame trailer is 0 0 0 0.

Frame Format Summary

  header  lights  bits  data    trailer
  0010    [24*    [8*   RGBp]]  0000
HOME