TRIKLITS Control Box Interface Example

This page serves two purposes. One is to show you how you can hack the Triklits control box and reprogram it with your own patterns. The other is to give you an example of how to interface a microcontroller directly to the Triklits, so that you can build your own controller.

You should also see that there are two ways to electrically send data frames to the Triklits. In this example we interface directly using TTL level data signals. This might be desireable for low cost applications.

However, if you need to locate your controller or computer system generating patterns far from the Triklits this won't work. In that case you would want to put the Triklits control box in receive mode and send the data over an RS-485 link to the RJ11 jack. In receive mode, the Triklits control box just takes the data coming in on the RS-485 link and converts it to TTL level signals for the light string. It also takes care of automatically inverting the signal if the polarity is wrong.

This is the schematic for the Triklits control box:

First note that power and ground (9-12vdc) are fed directly to the light string. The power supply is then also regulated down to 5v to power the PIC16F684 microcontroller. The PIC generates data frames and outputs a 5v TTL level signal that passes through a 2K ohm resistor and then to the lights. The resistor protects the PIC from short circuits and also keeps the signal level from overdriving the wire. Note also the two buttons and the RS-485 transceiver circuit which we will not go into. You would not need these for a simple controller. For the simplest circuit, you would only need a 5v supply, a microcontroller and a 2K ohm resistor.

Now you may get the idea that you could just reprogram the PIC in the control box with your own patterns instead of building your own box. So we have made this a little easier. Open your Trikits control box so you see it as in the picture below. Note the 5-pin header that is circled in pink. The control box does not come with that header installed, instead you will just see 5 holes in the PCB. This is an In-Circuit Serial Programming interface to the PIC microcontroller. If you want to use it solder on a 5-pin header like in the picture, and you will still be able to close up the case.

The ICSP header follows some kind of standard pinout. Pin 1 is marked by the blue arrow. The pinout is then:

  1  Vpp   - programming high voltage
  2  Vdd   - 5vdc
  3  Vss   - Ground
  4  PGD   - programming data
  5  PGC   - programming clock  
When using the ICSP interface always disconnect the power supply from the control box. The PIC programmer should supply the power for programming. To use this interface you might need to build an adapter for your PIC programmer. Also, make sure the programmer you select can handle the PIC16F684.

We use a programmer from www.tech-tools.com. There are many available from various sources, a cheap one with the correct ICSP header is made by Microchip and called the PICKit 2 (though we haven't tried using it).

Now you need some software to generate RGB patterns and send the formatted frames to the light string. You can look at our demo pattern generator for a code example. This is PIC16F684 assembly language, and you will need the Microchip MPASMWIN software (part of MPLAB IDE) to assemble it. Then you can flash it into the Triklits controller PIC to see it run. Once you get that working then you can modify the software and create your own patterns. But please note if you reflash the PIC in the control box you will lose the original software it came with and we are currently not distributing it (we may decide to do this soon though). Without this software the RJ11 interface will no longer function either.

The demo software is more complex than it needs to be for a simple controller, because it still allows you to select patterns and variations, and there are a number of support routines to pick nice colors from a color wheel. Of particular interest would the the routine txframe that outputs a full frame of RGB data to the lights.

HOME