Cube Led RGB 4x4x4 - picaxe 28x2

pippofjk

Member
Hello!

This is my cube led rgb 4x4x4 with picaxe 28x2.

It is made of 64 rgb leds (common cathode), that are driven by a cascade of six 74hc595n shift registers (2 for red, 2 for green, 2 for blue).
On each plane can be adjusted the luminous intensity by changing the pwm signal via command pwmout.

An "aux board", switches on and off each plane in a rapid sequence, so, in small fraction of time, only one plane of leds is switched on.
Therefore the entire cube has an ampere consuption equal to a single plane switched on instead of all 64 leds on (more or less).
This board has a 555 timer to generate the colck and a cd4017be as a sequencer.

Each output of the cd4017be ( 4 outputs) is combinated with the pwm signal ( 4 pwm from picaxe 28x2) through an AND gate 74hc08b1,
and then the 4 outputs "mixed" go on the 4 npn transistors that control the switching on and off of the planes, respectively.

Please, forgive the mistakes of English in what I wrote (surely there are ...)






Further information are available on my new site:
-website http://www.robotelettronica.altervista.org/
-website cube led rgb page: http://www.robotelettronica.altervista.org/projects/cuboled_rgb.html
-viedo youtube: https://www.youtube.com/watch?v=FJem2p6_duk&feature=c4-overview&playnext=1&list=TL1Hp9v8BUQT8
 

westaust55

Moderator
Hello!

This is my cube led rgb 4x4x4 with picaxe 28x2.

It is made of 64 rgb leds (common cathode), that are driven by a cascade of six 74hc595n shift registers (2 for red, 2 for green, 2 for blue).
On each plane can be adjusted the luminous intensity by changing the pwm signal via command pwmout.

An "aux board", switches on and off each plane in a rapid sequence, so, in small fraction of time, only one plane of leds is switched on.
Therefore the entire cube has an ampere consumption equal to a single plane switched on instead of all 64 leds on (more or less).
This board has a 555 timer to generate the clock and a cd4017be as a sequencer.

Each output of the cd4017be ( 4 outputs) is combination with the pwm signal ( 4 pwm from picaxe 28x2) through an AND gate 74hc08b1,
and then the 4 outputs "mixed" go on the 4 npn transistors that control the switching on and off of the planes, respectively.
Well done on your PICAXE controlled 4x4x4 RGB cube.
The PCBs are also well designed and laid out.

Any chance that you might also post your schematic diagram and PICAXE program code for the future information of others.
I do not intend to criticise but collectively we might even be able to suggest some program code improvements for improved speed.
 

westaust55

Moderator
Might be better for most if the schematic was as say a jpg or pdf file that everyone can open

You may wish to try this idea to see if you can speed up parts of your program.

Where you have tests like:
Code:
for b6=1 to 7
		
	if b6=1 then
	
		low b.7
	
	elseif b6=2 then
	
		low b.6
	
	elseif b6=3 then
	
		low b.3
		
	elseif b6=4 then
	
		low b.7,b.3
			
	elseif b6=5 then
	
		low b.6,b.3
				
	elseif b6=6 then
			
		low b.7,b.6	
			
	elseif b6=7 then
	
		low b.7,b.3,b.6
	
	end if

;
;
next b6
try changing these to:
Code:
for b6=1 to 7
	lookup b6, (%0111111, %101111111, %11110111, %01110111, %10110111, %00111111, %00110111), pinsB
;
;
next b6
I did a quick test for just those code examples run 1000 times each (using a 40X1) and saw an improvement of around 29% in speed and the program size dropped for that part by 63 bytes from the first to second example.
But if you are using other portB pins elsewhere this may disturb those pins and not be satisfactory.

EDIT: could not open the schematic but when I went back and looked at top lines of the program the Port B pin use is given so first option is likely not possible. :(


In that case if you can use byte variable b0 to access the bit variables then

Code:
for b6=1 to 7
		
	lookup b6, (%0111111, %101111111, %11110111, %01110111, %10110111, %00111111, %00110111), b0
	pinB.7 = bit7
	pinB.6 = bit6
	pinB.3 = bit3
;
;	
NEXT b6
will save 59 bytes but only give 2 or 3% speed improvement


EDIT: should also say that you program code is well laid out (formatted) with indenting and comments. :)
 
Last edited:

pippofjk

Member
Thanks for your quickly reply.
On my previous post i have added the .bas file.

I have printed in pdf the schematics.
The first is printed in color, green is for bottom copper layer, red for holes and top copper layer (in my case it represent wires) and yellow for text and others element.
( yellow color is almost invisible... but the program don't have the chance to change the color).

The second pdf is all in black.
 

Attachments

Top