Author Topic: 32x32 led matrix with de0-nano  (Read 22678 times)

0 Members and 1 Guest are viewing this topic.

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
32x32 led matrix with de0-nano
« on: August 28, 2014, 06:54:50 pm »
Hi,

I've got a few 32x32 LED matrices from Adafruit, and have been through their 32x16 FPGA howto.  It runs, in a way, on my 32x32 matrices, but of course it doesn't look right.

Is there anyone with one of these 32x32 matrices and an Altera FPGA in-hand that can offer me some guidance on how to make it work with these?

The changes that need to be done to the existing VHDL:

* 3 address lines to 4, with appropriate wiring change
* 2x8 scan to 2x16

I believe I have the first of these changes completed, and I am unsure about how to make the second.

The code as I got it from Adafruit is here: https://github.com/adafruit/rgbmatrix-fpga and it works on my matrices, except instead of drawing 16 contiguous rows, it draws the top 8 rows, then a gap of 8 rows, and then the bottom 8 rows followed again by a gap of 8.  Making the first of those listed changes indeed allows the FPGA to draw on all 32-rows, and because I haven't made the 2nd change, all I see is garbage.

I've scoured the Internet pretty well and I'm unable to find anyone that's adapted this code for the 32x32 matrix.  I imagine it is an easy change to make, I'm just not there, yet.

Anyone care to help?  thanks.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: 32x32 led matrix with de0-nano
« Reply #1 on: August 29, 2014, 12:48:47 am »
Alvaro Lopes did some code for the Papilio Pro (Xilinx but that shouldn't matter) to drive 2 displays using the ZPUino

He mentioned he will post the code but not sure when or where.




This was shown in the updates for the Papilio Duo Kickstarter:
https://www.kickstarter.com/projects/13588168/papilio-duo-drag-and-drop-fpga-circuit-lab-for-mak/posts/882177
https://www.kickstarter.com/projects/13588168/papilio-duo-drag-and-drop-fpga-circuit-lab-for-mak/posts/884233

Maybe he will post it on his site:
http://www.alvie.com/zpuino/index.html

Hasmter_nz might know where Alvaro's sample code lives.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: 32x32 led matrix with de0-nano
« Reply #2 on: August 29, 2014, 12:56:01 am »
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #3 on: August 29, 2014, 04:59:48 am »
Thank you.

I can't make much of the Verilog, it seems so much more unorganized than the VHDL I am trying to work with.  I'll give it some more time and see if I can start to wrap my mind around it more.
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #4 on: September 02, 2014, 03:40:59 am »
Got it working with the original code I had, and I even got it to draw across two panels successfully.  three panels is proving a challenge, though; it seems the time it takes to send the pixels to all three panels is more time than the boards will actually hold the LEDs on, so I get 3 panels worth of data cycling across all three panels, which gives me a headache nearly instantly.

Turning the output clock up to a certain point does help (that's what got me to two panels) but I can't seem to raise it high enough to get 3 panels playing nicely.

more tinkering...
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #5 on: September 11, 2014, 06:38:49 pm »
got this working a few days ago.

Part of the problem was the color data I was sending, part of the problem was some tweaks I'd made in the VHDL.  Those VHDL changes were reverted and now I can send images to the panels and see them.

Now for the tweaking.

The gamma on these panels is absolutely nutty.  They have a gamma of 1/8 or something insane like that.  A LED driven white for 1/256 duty cycle has about 50% apparent brightness.  this makes the dynamic range very small and is just a difficult problem to think about, for me.

I saw on one of Mike's videos where he has an annotation describing how to modulate brightness evenly among subframes using an 8-bit accumulator (presumably for 8-bit per color channel) and I'm wondering if anyone has an example of this code?  I think I get what's going on, but I'm not sure.  It's an 8-bit adder with carry, where the result of the previous operation is used as the 2nd operand for the current calculation, yes?  The intended brightness is the first operand in the adder.  When it overflows, light the LED; when it doesn't, don't.  I can do this in C or Java easily enough, VHDL is eluding me at the moment.

I can also I think safely assume that if I use 4 bits of color per channel that I need 4 bit accumulators, for example.

Another problem:
Driving the panels with a 25MHz clock at 24-bit color (8-bits per channel) causes a visible (31Hz) refresh at just 3 32x32 panels, and I'm looking to drive 6 panels.  24-bit color is out.

Any ideas about speeding things up, while keeping apparent color-depth as high as possible?

Thanks!
 

Offline AndyBadger

  • Newbie
  • Posts: 2
Re: 32x32 led matrix with de0-nano
« Reply #6 on: October 16, 2014, 04:23:19 pm »
Can you post your changes.  I am only getting two lines and a bad refresh rate.

Andy
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #7 on: October 16, 2014, 04:32:09 pm »
Yeah, gimme a few minutes.

Are you sure your wiring is correct?  Can you take a picture of what you're seeing? 
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13694
  • Country: gb
    • Mike's Electric Stuff
Re: 32x32 led matrix with de0-nano
« Reply #8 on: October 16, 2014, 04:35:07 pm »

Driving the panels with a 25MHz clock at 24-bit color (8-bits per channel) causes a visible (31Hz) refresh at just 3 32x32 panels, and I'm looking to drive 6 panels.  24-bit color is out.

The nice thing about FPGAs is you can duplicate stuff easily.
Don't try to drive 6 panels from one bus - run multiple feeds - 2 sets of 3 or 3 sets of 2.

I've never seen an RGB panel with more than a 16:1 row muxrate, 32x panels are usually two 16 panels with seperate data inputs for each half
 
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #9 on: October 16, 2014, 04:39:42 pm »
It's a single panel but it's wired internally like two 32x16 panels.  You have to add the 'd' address line in the VHDL which is pretty easy, then if you change the color depth, the processing sketches require a bit of work.

Lately, I'm working on doing delta sigma PWM rather than the inherently terrible method used currently.

I'm still too new to know how to duplicate the hardware in the FPGA properly, and I don't know how to send the correct imagery to the correct instance of the panel driver hardware yet, either.

Getting there, though.
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #10 on: October 16, 2014, 04:43:01 pm »
Can you post your changes.  I am only getting two lines and a bad refresh rate.

I don't have the wiring documented, and I don't have my processing sketch changes here, but this will help you adjust the VHDL for the 32x32 panels: https://github.com/naikrovek/rgbmatrix

top_level.vhdl, ledctrl.vhdl, and config.vhdl contain the changes.  Adding a 'd' address select line and widening the address bus from 3 bits to 4.

You'll also have to modify the pin assignments and add 'd' to an output pin.  IIRC, I used PIN_E9, which is GPIO_021 on the DE0-Nano.

If you have a panel with two separate input and two separate output connectors, that's different entirely, and shouldn't require any changes to the VHDL.
« Last Edit: October 16, 2014, 04:50:14 pm by Rigby »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: 32x32 led matrix with de0-nano
« Reply #11 on: October 16, 2014, 05:02:39 pm »
Now you made me get one from Sparkfun since they still honor their promo code FALL2014 for $10 off for $20 or more purchases.
So pretty much I get free shipping for qty 1 if it was 2 then it would be $10 off for each so just got one.

https://www.sparkfun.com/products/12584
 

Offline AndyBadger

  • Newbie
  • Posts: 2
Re: 32x32 led matrix with de0-nano
« Reply #12 on: October 16, 2014, 05:14:23 pm »
I will check it out later tonight.  Thanks!
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #13 on: October 16, 2014, 07:59:18 pm »
Now you made me get one from Sparkfun since they still honor their promo code FALL2014 for $10 off for $20 or more purchases.
So pretty much I get free shipping for qty 1 if it was 2 then it would be $10 off for each so just got one.

https://www.sparkfun.com/products/12584

I got all mine from Adafruit, BEFORE they lowered the price $30 per panel... bit miffed about that.  The last batch I bought are ENTIRELY different from the first couple of batches, which also peeves me a bit.  The new ones reverse G1 & B1, and G2 & B2, which means I can't put them in the same string as the first sets I have without modifying a cable (not a big deal, really) but I wouldnt put them in the same screen/string anyway because the color rendering is SO MUCH WORSE on the most recent ones I purchased.

Going to probably buy from aliexpress.com from now on, for the panels, if I buy more.

I spent well over $3k with Adafruit this year, and I'm pissed I got those crappy panels.  I'm torn between being pissed because they're not what I expected and being OK with it because it was my employer's money, not mine.  I should demand they replace them, and on the other hand I don't wanna bother them with it.  Every other purchase I made with them was perfection in a box delivered to my door... 
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #14 on: October 16, 2014, 09:01:48 pm »
I will check it out later tonight.  Thanks!

You're welcome.  Don't forget the ground wire!  The adafruit tutorial fails to mention that the ground wire should be connected; it assumes you know this and that you know where to hook it up.
 

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: 32x32 led matrix with de0-nano
« Reply #15 on: October 16, 2014, 10:43:24 pm »
Well, bear in mind:

Quote
Please note! These panels are remainder stock from factories that make huge light boards. For that reason, the look and size might vary from batch to batch, even though the basic operation, codebase and tutorial is the same.

I bought a few of the 32x16 panels.  First pair had screw terminals for power, and through-hole capacitors.  Second pair had a 4-pin plug for power, SMD caps, and magnetic screw mounts.  They look pretty much identical to me, but I'm not displaying video -- just simple spectrum analyzers driven by an ATmega.
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #16 on: October 17, 2014, 12:39:13 am »
I wouldn't mind about the connections, provided the same SMD led parts were used between panels.  Some have a perfectly transparent lens, the latest have a very yellow cloudy window, making the overall color pretty green and much dimmer than the other panels.  They're shit.
 

Offline ttt

  • Regular Contributor
  • *
  • Posts: 87
  • Country: us
Re: 32x32 led matrix with de0-nano
« Reply #17 on: October 17, 2014, 03:40:18 am »
The gamma on these panels is absolutely nutty.  They have a gamma of 1/8 or something insane like that.  A LED driven white for 1/256 duty cycle has about 50% apparent brightness.  this makes the dynamic range very small and is just a difficult problem to think about, for me.

I've done a project with these panels. A gamma value of 2.5 has worked very well for me so far. I put that in a table and drive my PWM based on that. The trick is that for very low values you need to be fairly accurate otherwise you get some nasty color banding. In my project I interleave the PWM/gamma handling with driving the LED panel so that at very low values the LEDs are only on for a few microseconds.

Source code, pictures and demo video:

https://github.com/tinic/rgb-led-panel-sign


I drive 8 panels with a single BeagleBoard Black at >60fps using both PRUs, no FPGA. The video data is simply piped from ffmpeg into my PRU feeder tool.

I can also I think safely assume that if I use 4 bits of color per channel that I need 4 bit accumulators, for example.

Just one suggestion: use dithering if you want to go that low.

Driving the panels with a 25MHz clock at 24-bit color (8-bits per channel) causes a visible (31Hz) refresh at just 3 32x32 panels, and I'm looking to drive 6 panels.  24-bit color is out.

I've had the same limitation with the BeagleBone, it starts to run at about 25Hz at 24bit for me which is of course very visible. With 8 panels.

But 18bit stills looks very good if you apply a bayer dither and get the PWM/gamma timing just right. Look in the main.cpp file in the above project for a bayer 16x16 dithering table if you need one. Also, if you do any sort of animation you want to do some interlacing, i.e. do even rows first and then odd, while refetching the main frame buffer after each half picture. This cuts down on tearing quite a bit.

I like these panels a lot and I am thinking how to extend mine to 8x2x32x32 :-)
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #18 on: October 17, 2014, 12:07:25 pm »
That is all excellent information, thank you so much.

Your workbench looks excellent, by the way.  Envy!
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: 32x32 led matrix with de0-nano
« Reply #19 on: October 22, 2014, 09:25:49 am »
I got my panel and since I was playing with the PSoC and there was a 32x16 demo
http://www.element14.com/community/message/84683/l/psoc-4-pioneer-kit-community-project060

I tweaked it and got it to use the whole 32x32 I still have some repeated rows but should be easy to fix.

The LED Matrix component from the example has a clock of 48MHz not sure how often the interrupt gets called, but I'll keep on playing with this. (the chip driving it is a $1 one from when they had the discount).

 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #20 on: October 22, 2014, 03:52:16 pm »
Those panels are so great.  On AliExpress those are called "P6" or "PH6" panels, 6mm being the led pitch.  I want to get some of the P3 variety and see how they look.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13694
  • Country: gb
    • Mike's Electric Stuff
Re: 32x32 led matrix with de0-nano
« Reply #21 on: October 22, 2014, 03:58:53 pm »
Those panels are so great.  On AliExpress those are called "P6" or "PH6" panels, 6mm being the led pitch.  I want to get some of the P3 variety and see how they look.
I have some 3 and 2.5mm panels, which look really nice. 3mm are pretty common now and can be had for less than $50 (2.5 cents per LED FFS!) 2.5 rather more expensive, but becoming more common
2mm pitch panels exist but I've yet to find anywhere that will sell singles (Apollomi on Aliexpress list them but are a bunch of crooks - I ordered one, they sent a 3mm one then claimed it was the same as it had the same dimensions. Eventually got a partial refund via Aliexpress dispute but still way out of pocket from duty etc.)
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #22 on: October 22, 2014, 04:00:47 pm »
I haven't been able to order anything from aliexpress yet since they keep wanting to investigate my CC info and have me prove I own the card.  Annoying. 
 

Offline RigbyTopic starter

  • Super Contributor
  • ***
  • Posts: 1476
  • Country: us
  • Learning, very new at this. Righteous Asshole, too
Re: 32x32 led matrix with de0-nano
« Reply #23 on: October 22, 2014, 04:02:02 pm »
Do you recommend a good seller or panel for 3mm stuff?  There are so many sellers and so many pics, and I REALLY don't want any of the junk I got from Adafruit in this last order I got from them.
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13694
  • Country: gb
    • Mike's Electric Stuff
Re: 32x32 led matrix with de0-nano
« Reply #24 on: October 22, 2014, 05:02:25 pm »
Do you recommend a good seller or panel for 3mm stuff?  There are so many sellers and so many pics, and I REALLY don't want any of the junk I got from Adafruit in this last order I got from them.
I've had a few 3mm panels from a few suppliers without issues (apart from the ones that should have been 2mm).
My only reccommendation is read feedback messages carefully - ignore ratings & numbers of stars etc., and Don't rely on Aliexpress's dispute resolution to help.
A lot of Aliexpress sellers are just brokers, who order stuff when they get orders - I've often had orders get cancelled after a week or two, and although you get a refund, if your card account is not in US$ you may still lose due to currency fluctuation  and foreign transaction charges.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf