For the template patterns, I have used This Excel spreadsheet to prototype each pattern to generate the code.  Although it isn't completely automated, it saves quite a few steps in generating a workable pattern.  The basic flow goes like this:

  1. Starting with a pattern that has about the number of steps that you want to have in your pattern, make a copy of the tab that corresponds to that pattern.  The fountain pattern happens to be one of the longer ones, so it is generally a safe bet.
  2. Click in the top half of the window and scroll all the way to the top cell.  (Press Home then Ctrl-Home is the fastest way).  
  3. Page down to the first step.  Note that the window size should be already set so that each page down takes you to the next step.  This is critical to making it easy to visualize how the pattern will operate.
  4. Each LED is represented by a colored circle which indicates what the LED should do for this step of the pattern.  I've even included a nice legend next to the tree on each step.  For example a circle with a dot in it indicates that the LED starts out ON at the beginning of the cycle and fades to OFF.   To change what you want the LED to do, simply copy the correct symbol and paste it into the corresponding cell.
  5. Once you are happy with the new pattern (scroll up/down to watch it in action), scroll back to the top of the page and set the information for the number of Cycles and the name of the pattern.  This causes it to generate the right code in columns AL and AM
  6. Scroll right to column AL and copy the entire column and paste it into the Table of the code.
  7. Select column AM and paste it into the corresponding spot in the Toggle table.
  8. Ignore the stuff to the right of Column AL, it is used for generating the Animated GIFs that you see on this web site.
  9. Note that you also have to create an entry in the Scheme table for the new pattern, fortunately this is documented well on Pages 2-3 of the Flowchart.
  10. If you get something that you like, tell us!


The Picmas Tree 1.1 is programmed in MPASM assembler using the MPLAB IDE which you can download from Microchip for free.  Once you have installed MPLAB, you can download the source code for the tree and then open it up and build it.  You will need to have a programmer to load it into the pic.  We also have the .hex file which you can download.

 We've documented the code extensively inline and in a complete multi-page flow chart which you can download here.   

Microchip has a lost cost programmer called PICkit 2 which is a programmer and development platform. The PICKit 2 starter kit is available from Microchip Direct or several other sources ( or
Microchip released the schematics and source code for the PICkit 2 programmer so there are also several other programmers capable of programming the PIC processors based on the design. Below are a couple of links. Also if you search the web for PIC programmers you will find lots of low cost alternatives. Just make sure you can program the PIC used in the Xmas Tree. If you are new to PIC processors you may want to stick with the PICkit 2 or a similar debug/development platform.