3x3x3 LED Cube

From SpiderProjects
Jump to: navigation, search

The Story

I've seen a bunch of these across the net and thought I'd try making one myself. I'll be using a method similar to that of this Instructables tutorial to build it, but with a 3x3x3 cube since my PIC16F84 only has 13 IO pins. There's also an awesometutorial on building a 3x3x3 cube using a PIC16F690. I've converted this to work with the PIC16F84A. That cut out a lot of work that I would otherwise have had to do from scratch.

Acknowledgement:

Thanks to portreathbeach, chr, vladutz2000, and all the people over at Instructables.com for organizing the information that makes projects like these a lot easier to take on.

3x3x3 LED Cube

Circuit

3x3x3 LED Cube Schematic

This schematic is based on the one by portreathbeach at Instructables. I'm using a 5K resistor from the oscillator input to 5V. I honestly am not sure what frequency that sets the PIC clock at and I don't have an oscilloscope to check it with. I built the circuit on perfboard, but drew up a PCB using the free program, ExpressPCB, to make wiring a little easier.

3x3x3 LED Cube PCB

I started by building the LED Cube. I made a template for the layers by drawing lines 1.5cm apart since my LED cathode(GND) leads were 1.5cm long. Then I drilled holes just big enough for the LEDs to squeeze in.

3x3 LED Layer Template

Following the 4x4x4 LED cube tutorial I built each layer and used 24 gauge steel wire from Ace Hardware to strengthen each layer before removing it from the template. Once all 3 layers were built I just stacked them by placing the prettiest one back in the template and using a set of helping hands to hold the second layer in place while soldering and repeating for the final layer. To make this easier I pre-bent the leads to each layer before beginning to solder and soldered the corners first. Be sure to solder in short bursts so as not to damage the LEDs since the connections are made so close to the LED itself.

LEDCube1.jpg
LEDCube2.jpg
LED Cube

With the cube complete I carefully placed it into a piece of perfboard and marked the holes in order to make a template for the project box that will hold all of my circuitry.

3x3 LED Layer Template

I transferred this template to the lid of the project box and drilled holes just large enough for the LED leads to fit. For this I used a #60 drill bit that I also got from Ace Hardware. I drilled the holes as far to one side as I could to avoid the 9V battery as much as possible.

3x3 LED Layer Template

With the LED Cube placed on the lid I drilled 3 more holes for the ground connection to each layer and soldered 3 pieces of the 22 gauge wire to each layer ground.

3x3 LED Layer Template

To connect the LED cube to the controller circuit I used some extra IDE ribbon cable I had. It takes some time to get used to working with ribbon cable like this, but it keeps things organized and saves space. I connected one end directly to the LEDs and layer grounds and the other end to 2 rows of header pins. When doing this you have to carefully check each pin to make sure that everything is only connected where it's suppose to be and nothing is accidentally bridged. Otherwise you could damage your circuit or controller.

LEDConnections.jpg
LEDConnector.jpg
Ribbon Cable Connected to LEDs & Grounds Ribbon Cable Connected to Header Pins

Since I used header pins as the connector to the LEDs I was able to use a cut IDE cable as connector to the control circuit. I used a dremel with a cutoff wheel to cut the IDE connector down to size.

IDE Connector Cut to Size

I placed the control circuit and battery in a 1"x2"x3" project box from Radioshack with a power switch added to the side. The power switch is held in place with a couple dabs of hot glue on the inside of the box.

CircuitInBox.jpg
Switch.jpg
Control Circuit and 9V Battery Inside the Project Box

All that's left is to plug the header pins into the connector and carefully close the box up. You'll want to test everything out before closing the box up to prevent the need to re-open it and troubleshoot.

LEDCubeFront.jpg
LEDCubeSide.jpg
Finished LED Cube

PIC Code and Programming

The tutorial on building a 3x3x3 cube using a PIC16F690, by portreathbeach at Instructables was a real time saver here. I was able to modify his assembly code to work on a PIC16F84A microcontroller. I wanted to use this chip because I have a few sitting around that I got as samples from Microchip for another project and never ended up using. The other reason for using this chip is that it's really easy to build a cheap serial pic programmer for it.

Code

Base Assembly for PIC16F84

Here is the base assembly code I used for the PIC16F84. Simply add the effect subroutines that you want to the end of this block and call them in the main LOOP.

Base assembly code for the PIC16F84

;-----------------------------------------------------------------------------------------------;
;		LED	cube
;		--------
;
;	Portions of code taken and modified from original project by Craig Smith for PIC16F690
;	Author: Elliott Long
;	Date:	Aug. 2010
;
;	4MHz internal resonator used
;
;
;	3 layers of 3 x 3 LEDs
;
;	RA0	-	Top layer common
;	RA1	-	Middle layer common
;	RA2	-	Bottom layer common
;
;
;	Each layer of LED's Anodes
;
;		RB1			RB0			RA3
;
;
;		RB4			RB3			RB2
;
;
;		RB7			RB6			RB5
;
;	4 registers are used to hold the patterns for the LEDs
;
;	Layer1 - Top layer (8 Leds)
;	Layer2 - Middle layer (8 Leds)
;	Layer3 - Bottom layer (8 Leds)
;	Layer4 - bits 7,6 and 5 hold the 9th LED for top, middle and bottom, bits 4 and 3 hold the
;			 brightness (how long it is on for), bits 2,1 and 0 is the time the specific
;			 pattern is on until the next one is retrieved
;
;	There are 4 look-up tables Table1, Table2, Table3 and Table4. These are for each layer
;	giving a total of 255 different patterns.
;-----------------------------------------------------------------------------------------------;
 
 ;Constants
 STATUS	equ 03h
 RP0	equ 05h
 PORTA	equ 05h
 PORTB	equ 06h
 INTCON	equ 0Bh
 OPT	equ 81h
 OPT	equ 81h
 TRISA	equ 85h
 TRISB	equ 86h
 C		equ 00h
 Z		equ 02h
 Delay1	equ 0Ch
 Delay2	equ 0Dh
 Delay3	equ 0Eh
 Layer1	equ 0Fh
 Layer2 equ 10h
 Layer3 equ 11h
 Layer4 equ 12h
 Time	equ 13h
 Brightness	equ 14h
 
 ORG 0000h
 GOTO STARTUP	
 
 ;Startup	
 STARTUP	BCF STATUS,RP0	;Bank 0
 		CLRF PORTA	;Init PORTA
 		CLRF PORTB	;Init PORTB
 		BSF STATUS,RP0	;Bank 1
 		MOVLW 00h	;Set PORTB outputs
 		MOVWF TRISB	;Setup RB as outputs
		MOVLW 00h	;Set PORTA outputs
		MOVWF TRISA	;Setup RA as outputs
 		BCF STATUS,RP0	;Bank 0
		BCF STATUS,C
 		
 ;Loop through testing
 LOOP
	
	;Call EFFECTS HERE
	;Ex: Call CubeFill
	

 	GOTO LOOP	;Continue lightshow
 

	
;-----------------------------------------------------------------------------------------------;
; The Delay routine is called with a number put into the W register. This is in multiples of	;
; 100u seconds, (0.1m seconds)									;
;-----------------------------------------------------------------------------------------------;
Delay:
	movwf	Delay3			; put W into Delay 3

Loop1:
							; After Delay2 decreses to 0, it is reset to..
	movlw	0x1				; put 1 into W
	movwf	Delay2			; put W into Delay2

Loop2:
							; After Delay1 decreses to 0, it is reset to E9h
	movlw	0xA4			; put 80 into Wb, A4=100us@20MHz
	movwf	Delay1			; put W into Delay1

Loop3:
	decfsz	Delay1,1		; decrement Delay1
	goto	Loop3			; jump back to Loop3
	decfsz	Delay2,1		; decrement Delay2
	goto	Loop2			; jump back to Loop2
	decfsz	Delay3,1		; decrement Delay3
	goto	Loop1			; jump back to Loop1
	return
	
	
;-----------------------------------------------------------------------------------------------;
; Output outputs the data to the LEDs. PORTA will be used to turn on transistors to ground the	;
; cathodes of the LEDs										;
;-----------------------------------------------------------------------------------------------;
Output:
							; set the brightness
	movfw	Layer4			; put layer 4 into W
	andlw	b'00011000'		; get just bits 3 and 5
	movwf	Brightness		; put W into Brightness
	bcf		STATUS,C		; clear the carry flag
	rrf		Brightness,1	; rotate Brightness
	bcf		STATUS,C		; clear the carry flag
	rrf		Brightness,1	; and again
	bcf		STATUS,C		; clear the carry flag
	rrf		Brightness,1	; and again
	incf	Brightness,1	; add 1 to Brightess

	movfw	Layer4			; move layer 4 into W
	andlw	b'00000111'		; get just bits 0,1 and 2
	movwf	Time			; put W into Time
	incf	Time,1			; add 1 to Time
	bcf		STATUS,C		; clear the carry flag
	rlf		Time,1
	bcf		STATUS,C		; clear the carry flag
	rlf		Time,1
	bcf		STATUS,C		; clear the carry flag
	rlf		Time,1
	bcf		STATUS,C		; clear the carry flag
	rlf		Time,1
	bcf		STATUS,C		; clear the carry flag
	rlf		Time,1

Output2:
							; --- Top Layer ---
	clrf	PORTA			; clear PORT A
	movfw	Layer1			; move layer1 to W
	movwf	PORTB			; put W onto PORTB

	btfsc	Layer4,7		; see if LED 9 should be on
	bsf		PORTA,3			; turn on LED 9

	bsf		PORTA,0			; turn on layer 1 buy outputing bit 5 of PORTA

	movfw	Brightness		; put brightness into W
	call	Delay			; call the delay

							; brightness can be 1,2,3 or 4, so now we have to call the delay again
							; 4 - brightness with the LEDs off

	bcf		PORTA,0			; turn off layer 1

	movfw	Brightness		; put Brightness into W
	sublw	4				; sub W from 4
	btfss	STATUS,Z		; skip if the zero flag is set
	call	Delay			; call the delay


							; --- Middle Layer ---
	clrf	PORTA			; clear PORT A
	movfw	Layer2			; move layer2 to W
	movwf	PORTB			; put W onto PORTB

	btfsc	Layer4,6		; see if LED 9 should be on
	bsf		PORTA,3			; turn on LED 9

	bsf		PORTA,1			; turn on layer 2 buy outputing bit 6 of PORTA

	movfw	Brightness		; put brightness into W
	call	Delay			; call the delay

							; brightness can be 1,2,3 or 4, so now we have to call the delay again
							; 4 - brightness with the LEDs off

	bcf		PORTA,1			; turn off layer 2

	movfw	Brightness		; put Brightness into W
	sublw	4				; sub W from 4
	btfss	STATUS,Z		; skip if the zero flag is set
	call	Delay			; call the delay
	


							; --- Bottom Layer ---
	clrf	PORTA			; clear PORT A
	movfw	Layer3			; move layer3 to W
	movwf	PORTB			; put W onto PORTB

	btfsc	Layer4,5		; see if LED 9 should be on
	bsf		PORTA,3			; turn on LED 9

	bsf		PORTA,2			; turn on layer 2 buy outputing bit 6 of PORTA

	movfw	Brightness		; put brightness into W
	call	Delay			; call the delay

							; brightness can be 1,2,3 or 4, so now we have to call the delay again
							; 4 - brightness with the LEDs off

	bcf		PORTA,2			; turn off layer 3

	movfw	Brightness		; put Brightness into W
	sublw	4				; sub W from 4
	btfss	STATUS,Z		; skip if the zero flag is set
	call	Delay			; call the delay

	decfsz	Time,1			; decrement the Time regiester
	goto	Output2			; repeat
	return

3x3x3LEDCubePIC16F84.asm

Effects

Here is some assembly code for premade effects. Just copy any effects that you want from here, paste them at the end of the base assembly file, and call them from the main LOOP.

Assembly code for premade effects for the PIC16F84

;-----------------------------------------------------------------------------------------------;
; BigSmall sub routine																			;
;-----------------------------------------------------------------------------------------------;
BigSmall:
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	return



;-----------------------------------------------------------------------------------------------;
; FlashingLines sub routine																			;
;-----------------------------------------------------------------------------------------------;
FlashingLines:
	movlw	b'00100100'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'01001001'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'10010010'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00011100'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'10010010'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'01001001'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00100100'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00011100'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	return


;-----------------------------------------------------------------------------------------------;
; LayerBrightness sub routine																			;
;-----------------------------------------------------------------------------------------------;
LayerBrightness:
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10000000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01000000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00100000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01001000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00010000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00101000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01001000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001000'
	movwf	Layer4
	call	Output
	return


;-----------------------------------------------------------------------------------------------;
; CubeFill sub routine																			;
;-----------------------------------------------------------------------------------------------;
CubeFill:
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00100000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'01100000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11100000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110000'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110010'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110011'
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110011'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00100000'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'01100000'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11100000'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110000'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110010'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110011'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110011'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110111'
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'00100000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'01100000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'11110000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'11110010'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'11110011'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111000'
	movwf	Layer4
	call	Output
	movlw	b'11110011'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11110111'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11011111'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'10011111'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00011111'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001111'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001101'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001100'
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001100'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'11011111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'10011111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00011111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00001111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00001101'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00001100'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00001100'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'11011111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'10011111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'00011111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'00001111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'00001101'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'00001100'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011000'
	movwf	Layer4
	call	Output
	movlw	b'00001100'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011000'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; SideToSide sub routine																			;
;-----------------------------------------------------------------------------------------------;
SideToSide:
	movlw	b'00000011'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111011'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00011100'
	movwf	Layer3
	movlw	b'11011011'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11100000'
	movwf	Layer3
	movlw	b'11011011'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movlw	b'00011100'
	movwf	Layer2
	movlw	b'11100000'
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00000011'
	movwf	Layer1
	movlw	b'11100000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00011100'
	movwf	Layer1
	movlw	b'11100000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00011100'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000011'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movlw	b'00011100'
	movwf	Layer2
	movlw	b'00000011'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'11100000'
	movwf	Layer1
	movlw	b'00000011'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111011'
	movwf	Layer4
	call	Output
	movlw	b'00011100'
	movwf	Layer1
	movlw	b'00000011'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111011'
	movwf	Layer4
	call	Output
	return


;-----------------------------------------------------------------------------------------------;
; DiagAroundSides sub routine																			;
;-----------------------------------------------------------------------------------------------;
DiagAroundSides:
	movlw	b'00100000'
	movwf	Layer1
	movlw	b'01000000'
	movwf	Layer2
	movlw	b'10000000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'01000000'
	movwf	Layer1
	movlw	b'10000000'
	movwf	Layer2
	movlw	b'00010000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'10000000'
	movwf	Layer1
	movlw	b'00010000'
	movwf	Layer2
	movlw	b'00000010'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00010000'
	movwf	Layer1
	movlw	b'00000010'
	movwf	Layer2
	movlw	b'00000001'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000010'
	movwf	Layer1
	movlw	b'00000001'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000001'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movlw	b'00000100'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00000100'
	movwf	Layer2
	movlw	b'00100000'
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00000100'
	movwf	Layer1
	movlw	b'00100000'
	movwf	Layer2
	movlw	b'01000000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00100000'
	return

;-----------------------------------------------------------------------------------------------;
; Firework sub routine																			;
;-----------------------------------------------------------------------------------------------;
Firework:
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001000'
	movwf	Layer3
	movlw	b'00001111'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001101'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00001101'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001101'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00001101'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011100'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011100'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'10111000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'01010101'
	movwf	Layer1
	movlw	b'10110000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	movlw	b'00010100'
	movwf	Layer1
	movlw	b'01010101'
	movwf	Layer2
	movlw	b'10110000'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00010110'
	movwf	Layer2
	movlw	b'01010101'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00010110'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; CubeLight sub routine																			;
;-----------------------------------------------------------------------------------------------;
CubeLight:
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11100000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11101000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11110000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11110000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11101000'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11100000'
	movwf	Layer4
	call	Output
	return


;-----------------------------------------------------------------------------------------------;
; LineAround sub routine																			;
;-----------------------------------------------------------------------------------------------;
LineAround:
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'11111011'
	movwf	Layer4
	call	Output
	movlw	b'00000100'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00100000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'01000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'10000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00010000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000010'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000001'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; LayerDrop sub routine																			;
;-----------------------------------------------------------------------------------------------;
LayerDrop:
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'10110110'
	movwf	Layer1
	movlw	b'01001001'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'10110110'
	movwf	Layer2
	movlw	b'01001001'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'01001001'
	movwf	Layer2
	movlw	b'10110110'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'01001001'
	movwf	Layer1
	movlw	b'10110110'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; LayerDrop2 sub routine																			;
;-----------------------------------------------------------------------------------------------;
LayerDrop2:
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'11110111'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'11110111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	movlw	b'11111111'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'11110111'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11110111'
	movwf	Layer2
	movlw	b'00001000'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	return


;-----------------------------------------------------------------------------------------------;
; Spin sub routine																			;
;-----------------------------------------------------------------------------------------------;
Spin:
	movlw	b'01001001'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00100100'
	movwf	Layer1
	movlw	b'01001001'
	movwf	Layer2
	movlw	b'10010010'
	movwf	Layer3
	movlw	b'10011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11111111'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011001'
	movwf	Layer4
	call	Output
	movlw	b'10010010'
	movwf	Layer1
	movlw	b'01001001'
	movwf	Layer2
	movlw	b'00100100'
	movwf	Layer3
	movlw	b'00111001'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; SnakeLine sub routine																			;
;-----------------------------------------------------------------------------------------------;
SnakeLine:
	movlw	b'10010010'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'11011011'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'01101101'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011001'
	movwf	Layer4
	call	Output
	movlw	b'00100100'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'11011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'01101101'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11011011'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'10010010'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11011011'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'01101101'
	movwf	Layer3
	movlw	b'00111001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00100100'
	movwf	Layer2
	movwf	Layer3
	movlw	b'01111001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'01101101'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'01011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'11011011'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'10010010'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; SpiralDown sub routine																			;
;-----------------------------------------------------------------------------------------------;
SpiralDown:
	movlw	b'00000010'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000001'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'10011001'
	movwf	Layer4
	call	Output
	movlw	b'00000100'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00100000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'01000000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'10000000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00010000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00000100'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00100000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'01000000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'10000000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00010000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00000010'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00000001'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'01011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movwf	Layer3
	movlw	b'00111001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000100'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00100000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'01000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'10000000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00010000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000010'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000001'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001000'
	movwf	Layer3
	movlw	b'00011001'
	movwf	Layer4
	call	Output
	return

;-----------------------------------------------------------------------------------------------;
; UpAndOut sub routine																			;
;-----------------------------------------------------------------------------------------------;
UpAndOut:
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'01011101'
	movwf	Layer1
	movlw	b'00000000'
	movwf	Layer2
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'10100010'
	movwf	Layer1
	movlw	b'01010101'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'10011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'10100010'
	movwf	Layer2
	movlw	b'01010101'
	movwf	Layer3
	movlw	b'01011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11110111'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'11111111'
	movwf	Layer3
	movlw	b'00111011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00001000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00000000'
	movwf	Layer1
	movlw	b'00001000'
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	movlw	b'00001000'
	movwf	Layer1
	movwf	Layer2
	movlw	b'00000000'
	movwf	Layer3
	movlw	b'00011011'
	movwf	Layer4
	call	Output
	return

3x3x3LEDEffects.asm

Effect Generator

Portreathbeach also included this awesome application that makes it incredibly easy to generate new effects. It outputs an assembly file to your desktop containing the effect that you generate. Simply copy it into the base program just like the prebuilt effects.

Effect Generator by Portreathbeach

LED Cube pattern generator.exe

Programming

To program and compile the assembly into hex I used MPLAB IDE. It's free and fairly easy to use.

Then I used WinPic Programmer to program my PIC16F84 using the Cheap PIC Programmer I built.