joe_1 said:
You might want to consider using decoders, for example 4-16, so with only 4 pins from PIC you will control 16 LEDs. this will reduce number of PICs that you will have to use and simplifies your project.
Joe,
That wouldn't work. Being that I have 1024 LEDs to control, a certain number have to be on at the same time. The 1024 grid is comprised of sixteen 8x8 matrices.
https://www.futurlec.com/LED/LEDM88RG.shtml This link goes to common cathode ones. The 16 I have are common anode, but you get the idea.
There are 8 wires to control the anodes, and 8 wires to control the red cathodes (I'm not using the green ones). To get a design displayed, you strobe them. An LED will look like it is constantly on as long as it is getting at least a 1/10 duty cycle (voltage applied for 10% of time, can be off 90% of time, and still look like it is on, since it's too fast for your eyes to register as being off). So in order to achieve that, I turn on row 1, and load a bitpattern on the 8 columns simultaneously. Then I turn off row 1, clear the bits, turn on row 2, load the new pattern, repeat. That way, cycling through all 8 rows gives all LEDs in each row a 1/8 duty cycle.
If I stuck two 8x8 grids together and tried to control them with a 4 to 16 decoder, it would take up to 16 cycles to control the LEDs in a single row. That already violates the 1/10th duty cycle limit. And there are still 7 more rows to go!
What I am going to do is have four of those side by side. Port E, a 3-to-8 decoder, and transistors will give voltage to the rows. One transistor will power one row. There will be 32 LEDs per row. (8 LEDs * 4 matrices). So I need to have the 32 cathodes turning on and off at the same time, while the rows are being cycled by Port E. My solution is to use a single 8 bit data bus, and control the grids through latches. Have four latches loading the data individually, then turn on all four latch enables. Then load 0's in the latches, enable them, change row with Port E, repeat. This only controls four of the matrices. I have three more rows of four. ^^ So I'm going to have perhaps three more PICs running in parallel doing this same thing. I had an idea yesterday to possibly be able to control 8 grids with one PIC. Hopefully I can work that out, so that one PIC does 8 grids, another PIC does the other 8 grids, and then a master PIC will compute all the patterns and pass the data on to the two displaying PICs. 3 PICs total instead of 5 would be nicer cost-wise, and cut down on soldering too.