'Wizard,
One thought would be determine the number of board levels in software. Cascade every level of the rgb shift registers, or just one serial input, to save on pins. Clock out all the data up to the number of levels, then latch. QUOTE]
---------------------------------------
Nickel:
I did the PCB layout for 8 RGB LED Modules doing parallel in, parallel out. I was able to finish it. But what a maze of wires on 2-sided board. I will post if anyone wants to see what it looks like.
That said, the board is so detailed that requires professional manufacturing and might not be feasible with a homemade PCB.
I looked at this post you made and followed thru with the logic. It makes perfect sense. What I was worried about was number of times you are clocking the registers to get to the last register in the last level.
I compared it with what I thought was different and it is not! I pretty much used the same number of clocks but did it in a different order.
I thought about your idea over the weekend and looked at a few other products on the market using similar idea. Here is the recap of what you suggested. Please correct me if I am misunderstanding you.
1- Read number of levels (Could be a simple jumper at the right place telling the software how many levels: Interrupt?!?)
2- Read data from a data table and place them in 8 bit variables
3- Put out these individual 8-bit variables on PORT B (as output)
4- This is a twist on your idea: Now connect the 8-bit outputs from PORT B of PIC to a 8-Bit Parallel-in, Serial-out shift register. (Requires separate Load-data-in, Clock-shift-out controlled by 2 ports of PIC)
5- Now grab the serial out of the register as your data-in for the first register on the first level. (Serial-in, Parallel-out, Serial-out)
6- Per your idea, cascade all the registers on all levels (Tie Serial-out of one register to Serial-in of the next)
7- Carry the same connection up the levels as Serial-out of first level ties in to Serial-in of the next level....and so on.
8- All registers in all levels will have common: Vcc, Ground, Latch, Enable, and Clock
Latch: Latches bits in the registers output (Create color)
Enable: Activate all registers (1= clear all, 0=keep last color), Handy since you do not have to send a zero thru to initiate. Also you do not lose color and worry for LED/Register to go blank.
Clock: Shifts bits across the registers
VCC: 5V Regulated
9- 3 Registers on each level with 3x8-bits for R, G, B (SI-PO-SI)
10- Use 3 ports from PIC to feed: Clock, Enable, Latch
This will reduce the wires from PIC to all levels to 6 wires!
Software:
How does the data flow works?
A- Declare number of levels by checking jumper status
B- Goto Data Table and fetch 8-bit color data
C- Place 8-bit data into 8-bit variables
D- Now call on desired 8-bit varaible and put the data out on PORTB
E- Tell Register (PI-SO) to load it (call it: Ext-Reg)
F- Clock Ext-Reg and shift out to serial in of first register on first level (Mod-Reg), enable the registers
G- Clock Ext-Reg 8 times, clock Mod-Reg 8-times in total
H- Goto next color variable load into PORTB
I- Load data from PORTB into Ext-Reg
J- Clock Ext-Reg 8 times while clocking Mod-Reg 8-times (data is building up in all registers)
K- Continue to do read table, put bits out, and shift them until you have all the bits on all registers on all levels
L- Latch all Mod-Registers (Color produced)
Now you can repeat this set of data as many times as you want for POV
M- Get next color movement frame and continue with programming....
N- The table can easily be simplified to have 8 color codes as mentioned in previous posts. Have a subroutine that reads and distinguishes the color codes, place 0, and 1 in varaiables and then save them to be called into action as mentioned above.....