Pages: 1 [2] 3   Go Down
Author Topic: 8x8 rgb led matrix + 4bit pwm, irq code speed  (Read 5839 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
God Member
*****
Karma: 2
Posts: 854
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm experimenting with toner transfer right now to get a decent pcb done for this project. Seems I'll be needing a laminator - or much more practice and pressure. My tiny iron just doesn't do a good job for more than 25x25mm. So far I've tested this with "HP Premium Plus Photo Paper, satin matte" (for inkjets, but printed with a laser of course). Except for some defects at the edges it delivers a remarkably sticky layer on the copper with sharp edges. Not worse than most of the photo transfer I've done so far, and less chemicals :-)

I bought the blue press 'n peel before I'd heard of using photo paper.  So I've never actually tried photo paper, but I found the press 'n peel very easy to use, I got a perfect impression (about a 2x3" board) the first time and every time.  Since then I've read that photo paper can be just as good, but if you're having that much trouble, maybe try the real thing?

Quote
I'll post some pictures and videos of the current status when I wake up again. Right now there's also code for individually addressing each of the 64 rgb leds, set a HUE value, set RGB values and some fader effects for testing. Right now the PWMing is done with an ISR routine and supports 28 brightness levels for each colour channel. Anything above that takes longer than timer2 can support. I'll switch to timer1 to get more time in the ISR routine.

This has been a very interesting thread.  I'm curious how long your ISR is now.  Earlier you were talking about it being in the 20mS range, which could be a problem with your main program halting for long periods of time (if you're doing anything more complex than setting up the values for the ISR).  
Logged

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

Right, the ISR time is quite maxed out right now. I haven't had the nerve to touch my old oscilloscope yet to get some real numbers for that. This magnificent piece of electronics really triggers a primeval urge in me to kick it off the table.

Using timer2 the arduino can handle about 28 levels of brightness, anything above that freezes the code. I take it that the ISR gets called again before ever finishing, thus no time is left for the main loop to manipulate the leds. I'm hoping to fix that with timer1, as is takes longer for it to trigger an OVF interrupt. This will of course affect overall responsiveness of the thing, but I haven't put the code for serial transfer in yet.  :smiley
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!

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

Forgot to comment on the press'n peel.

Some distributor I found sells it for about 4.60€ a sheet, now I'm officially "not amused". Also my private laserprinter can't stand the HP photo paper at all (doesn't even fuse the toner to it), the one in my office worked fine. And all the other "high gloss" magazine papers that need soap and some rubbing after ironing just create paper jams.  >smiley-sad

oh well, back to work...

edit: will give the toner transfer paper by 'pulsarprofx' a shot. at least for me it's cheaper than the p'n p sheets.


« Last Edit: August 03, 2008, 02:24:44 am 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!

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

woohoo ;D

The pulsarprofx toner transfer paper really works for me.
Except for some minor toner sticking problems (might have touched the paper with my greasy fingers), the transfer is really easy. I even managed to apply too much pressure with my tiny clothes iron and smudged some tracks. The wet phase just takes about 15 seconds and the paper comes off without any residual fibers. No hot water/soap/rubbing required.

I will do some more tests tomorrow.

images of 1st test on aluminum board

edit: well, a bit more tricky than expected with the old iron. there's enough heat, but getting the right amount of pressure is hard. if using the tricks given on the homepage with a piece of round wood, the toner sticks like mad but the details are smudged. just pressing down the iron gives near perfect details (down to 4pt fonts), but the toner doesn't stick properly. at least not on aluminum.

ordered a laminator.
« Last Edit: August 12, 2008, 11:09:17 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!

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

ad laminator:

Got me a 'GBC Heatseal H212', the same brand that's sold by the pulsar people.
I managed to pass 16 sheets of paper through it, which is about 1.72mm or 68mil (uncompressed). Unfortunately it stalls with 1.5mm PCBs. Will test with 1.0mm / 0.8mm PCBs as soon as I can get my hands on them.

I'm starting to feel sorry I sold the UV thingy I once had...

« Last Edit: August 18, 2008, 05:02:35 am 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!

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

Ok, so the laminator had to be modded. Some (actually 10) plastic paper guides got in the way of the PCB and 2 of them broke off instantly. So I had to remove them all. The Fuser is springloaded and 1.5mm PCBs (64mil) are no problem for it.




Unfortunately the toner transfer process seems more intricate than expected and is not as easy as displayed on some websites out there. The copper surface needs some special treatment and I don't have mastered that apparently (yes I scrub it, clean it, degrease it, dry it and so forth). Also I need to pass the PCB through the laminator about 15 times to make the tracks stick. If I'm out of luck, the laminator doesn't get hot enough. It's plenty hot for burning my fingers though. I really don't want to mess with its temperature control circuitry, don't want to break it, already getting sick and tired of it. Oh, and it STINKS... like a motor getting way too hot. You don't want to use it in your living room.

Result:


The lines are 0.25mm wide, as well as the spacing in between (left spiral)


Compared to my dim memories of photographic transfer with a good UV box, toner transfer - to me - is much more work. Sure more chemicals involved, but NaOH is cheap, doesn't stink and once the UV timer is set properly and the amount of NaOH for the developer solution is determined, the results are basically perfect every time.

Oh waily waily, why did I ever quit using photographic transfer ? Tell me !
I definitely need severe reprimanding for that, maybe like this:
« Last Edit: August 18, 2008, 03:01:23 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!

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

OK fellow readers and readeresses, I've had it with toner transfer.
I hereby declare that the type of toner transfer known to me officially sucks.

After getting in touch with the people at pulsarprofx and hacking my laminator to get hotter (and lethally smelly), the darn toner still won't stick/refuse as advertised. Going back to photographic transfer.

Don't buy GBC-H212 if you think about toner transfer. Won't work, just STINKS.


The latest matrix code can be found here

changes:
  • switched to timer1 to get more time inside the ISR
  • reorganized parts of the code
  • adapted the code to UDN2981A source driver which is hooked up to the row driving 595 shift register (display enable pin 9)
unfortunately the udn2981a seems to add some timing issues as some leds don't turn off 100% with this chip added. without it the leds switch perfectly, but cannot get as bright. when cranking up the current without the source driver, there's crosstalk...
need to get a decent DSO to see what's going on. that'll have to wait till xmas though.

latest schematic:

(spi)-->SR1-----------SR2----------------SR3------------SR4
            |                       |                            |                      |
            |                       |                            |                      |
         row                red column          green                   blue
         select             cath. 0-7             cath. 0-7              cath. 0-7
            |
       UDN2981A
       (row anodes)
« Last Edit: September 11, 2008, 08:21:19 am 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!

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

Finally, I managed to build a prototype on perfboard. It will be done tomorrow I hope. Now it's just a minimalist arduino with lots of chips still missing.

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!

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

DONE... stuff like this should not be done without having a proper pcb. All the wires, just wires, heaps of wires.

latest vid:

Edit:
Now that I've had the chance to let it run for more than just a few minutes, it's turned out that there must be a bug in the code. Only shows up after running more than just a few loops.
« Last Edit: September 21, 2008, 02:37:27 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!

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

schematic (pdf)
« Last Edit: September 25, 2008, 01:07:55 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: 30
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great work, i read the whole thread.  Did you ever figure out a good at home solution for PCB printing?

Ryan
Logged

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

Well, I know that the photographic method works. I've used it for years, till I stopped doing electronics. Thanks to arduino, I started again :-)

Some time ago I heard of this toner transfer thingy and tested it, but couldn't get it to work properly with _my_ equipment. I don't claim it cannot work, but I'm just so fed up with it. The crucial point here is to get the "right" amount of heat with the "right" amount of pressure, which I couldn't get. Not even with a laminator. Seems like a lot of guesswork to me. I just wanted it to work 100%, so no redrawing of bad lines with a pen and stuff like that. But apparently there's lots of people who've managed to get good results with it.

So if you want to try it, give it a shot. But before you spend 100s of your favourite money unit on a laminator and supplies, better find s.o. who's had success with it to share his knowledge. Preferably within driving distance.

Now I've got a good excuse for another project: UV LED exposure unit  ;D

p.s.: The schematic I've posted before contains an error. The caps @ the quartz are 22pF not 22nF !
« Last Edit: September 30, 2008, 01:14:28 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: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey i just got a sparkfun 8x8 rgb matrix and tried out the code at the top of the page im wondering whitch parts effect each element of the matrix my intent is to control 2x2 squares of the matrix individualy any imput would be greatly appreciated
Logged

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

Hmm. That code is a bit old I guess. The latest incarnation of it can be found on my blog.

Ok aside from the innermost workings the color for each led is stored in an array. One for red, green and blue.

The interrupt routine (ISR) permanently scans the array and updates the leds in the background. To get the colors to mix in shades each led and single color is also controlled by pulse width modulation (switching it on/off very fast, but with different on/off times).

I've added some functions to set single leds, rows and columns and so forth to a given color value. Either in RGB or HSV color space. HSV is good for rainbow effects :-)

e.g.

Code:
set_led_rgb(row,column,red,green,blue)
set_led_hue(row,column,hue)
...
...

rgb: 0-255
hue: 0-360

Using these basic functions you can set any pattern you like.
The color mixing takes a lot of cpu time though, so refresh rates of the whole matrix won't be good for fast stuff.
« Last Edit: October 23, 2008, 11:58:42 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: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey  uploaded the program from your website and connected pins
13 to sck
12 to do
11 to di
10 to cs
and 9 to 5v and it gives me a slow fading light on column 1  in a dim orange that blinks 3 times then stops for a long time and repeats and wont do anything else
i also acceidentaly found that if i run 5v into icsp pin1 a bright orange light will quickly scroll across the board twice then rapidly blink in red and blue  all over the board
i dont know if either of these things are what the program should be doing or if its not where i pluged in wrong to rectify the problems
again any help would be greatly appreciated
Logged

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