I am not sure what you mean on this one. Elaborate or post a diagram please.'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.
If I read you correctly you are suggesting to use serial input of the first register on the first level as master serial in. Then data out from last register of the first level to data in of the first register on second level, string it thru, go up the ladder till the last register at nth level. I like that and is doable. I am worried about memory space carrying all these additional data tables. Also worried about the refresh rate passing thru all registers in that fashion. Let me think about that a bit.
Not sure how the clk and latch pins would work for upper levels from the pdf schematic.
Since I was parallel entering all the levels at once. I was thinking of clocking all registers at once until 24th bit of that level is reached then latch. Tying up all clocks together and all latches together. Strobe Action
9 bits of color data is a little awkward, a word table would cut down on some program space.
It is not 9 bits of data color. It is 3 sets of 3 8-bits commanding each register. First set of 3 8-bit puts out first entry of the color, the next two re-enforce the color and mix it.
Example:
Wave1
11110000 R
01111000 G
00000000 No Blue
--------------------
Wave2
11100000 R
00111000 G
00000000 No Blue
--------------------
Wave3
11100000 R
00111000 G
00000000 No Blue
--------------------
Reading "Vertical Down", The code above with 3 waves will produce Red on 8th LED (R,R,R), Orange on 7th LED(RG,R,R), Yellow on 6th LED(RG,RG,RG), Pastaccio on 5th LED(RG,G,G), and Green on 4th LED(G,G,G). I will post color mapping at a later time. These 8-bit lines are in a data table and are read one after the other. Read 3 lines, put serial out, clk 24 times, latch. Fetch next wave.....Latch, Fetch last wave....latch. <color produced for 8 RGB LED of one level. Since we are parallel entering the levels at the same time, all levels will have all the colors assigned to them in one pass thru with 3 waves.
Sort of like:
table data would be b'0xxx0xxx', shift out 3 bits, then use swapf on second time thru, shift out 3 bits. Third time thru table_h data would be b'00000xxx', and final 3 bits shifted out.
Looked back on what I thought was an interesting 16 bit mono color display pattern. And using 8 different pattern generators (i.e. subs), and a single 16 bit I2C (PWM) led driver, the program compiled to 7k words
My 2 cents would be to use a chip that has some decent Ram to handle whatever patterns you come up with, and a fast internal clock to process. Like the 18f14k22. Also seems like using any of the dozens of led drivers with internal PWM would simplify things a lot. Haven't tried one of these cubes, so don't know how a 33% duty cycle works?
Unroll your 3x3x10 rgb cube and you have 30 columns and 3 rows by 3 colors. Two 16bit led sinking drivers (x3), with PWM control, would handle the columns. 3 gpio pins (x3) to control the medium sized sourcing transistors for the rows.
To keep the pin count down on the micro device use a hardware I2C bus for the drivers, with the only problem being the amount of resisters (90) to control the column current. Pin count would be (2) for the I2C bus, (9) for the row drivers, and (1) for the menu button.
Lot less resistors (6 total) used on the SPI type sinking 16 bit led drivers, but need four pins for each color, so need a 28 pin micro to run the show. Its all about trade offs.
'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.....
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?