Pages: 1 2 [3]   Go Down
Author Topic: 8x8 rgb led matrix + 4bit pwm, irq code speed  (Read 4894 times)
0 Members and 1 Guest are viewing this topic.
"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Which code exactly? matrix_code or matrix_test ?

The first one should produce , the second one needs a button attached to digital pin 7 and should give you effect, when the button is pressed.

The arduino's digital pin9 should be connected to all the shift registers at pin13 (output enable, G in the schematic). All the 595's pin10 (master reset, SCL in the schematic) should be connected to +5V.

The ICSP pin1 links to the MISO line. I wonder why this has an effect at all. It is not used in the code.

Also make sure you have good contact at the wires. The data transfer runs at several MHz and I had a lot of fun thinking all was broken, just because of bad contact.

If you have trouble making it work, you can try the ShiftOut tutorial first. It also builds a chain of several 595 shift registers. As soon as that works, you can just switch the code + rewire the output enable line to arduino (wired to +5V in the tutorial).

Got and pictures yet ?
« Last Edit: October 28, 2008, 04:18:04 pm by madworm » Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

a few possibly relevant pointers from someone else doing LED matrix code for the first time...

Have you considered that you can implement 16 brightness levels with 4 loops instead of 16, if you insert delays of different lengths into each loop?

Be sure you take branch length into account, otherwise some cycles of your loop will execute much faster than others, causing inconsistent brightness.

16 linear steps of voltage-on time does not produce 16 consistent levels of brightness.  You need a logarithmic curve to get a looks-linear response.
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, logarithmic... yes. If you take the human eye as the reference. Maybe I forgot about that as I'm trying to avoid such subjective quantities as "brightness" during my day-job. (W/sr is what I prefer, and only linear detectors of course). I also didn't want to over-complicate things.

I'm not sure if inserting delays would be compatible with the multiplexing. Right now it is certain that every loop takes the same amount of time and the 'framebuffer' data is easily translated into a PWM signal without any hick ups.
« Last Edit: November 13, 2008, 08:18:53 pm by madworm » Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Berlin
Offline Offline
Newbie
*
Karma: 0
Posts: 14
Go go go!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Excellent thread! Gave it a full read-through and ejoyed it. Thanks for posting your code and eagle diagram as well. I may just go an build it. smiley
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

this post helped me out a lil too thanks
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the work documenting your efforts. It is very helpful for a newbie
Logged

Riga, Latvia
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Journeyman
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for documenting all your efforts. Did you try to drive more than one matrix at the same time? I just bought 4 of these on ebay and i want to display some mario and other old-school sprites on it. smiley Sparkfun's backpack contains a full Atmega but i think it's overkill.
« Last Edit: December 17, 2008, 03:46:42 am by stas2k » Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not try driving more than one of these babies with a single micro. In principal it is possible, but it is likely to interfere with the pulse width modulation for the color mixing. I know that the interrupt timing is easily messed up when trying to do more colors, as this takes more time. Adding more matrices should have the same effect. You'll need to adjust the irq timer settings.

Color mixing without PWM will work for sure, but at the cost of fewer colors. Just like the sparkfun gadget does it.
Logged

• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Riga, Latvia
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Journeyman
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll try to make it work. Yesterday bought 12 74hc595 chips and some current sinks. I'll try to make a simple game. Maybe like frogger, controlled by sega genesis joystick. Did you try some ASM optimizations like loop unwinding?
Logged

Pages: 1 2 [3]   Go Up
Jump to: