hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.66k stars 1.16k forks source link

Control matrix 64x32 with mbi5153 (icn2053) led driver ic #466

Open kbateam opened 6 years ago

kbateam commented 6 years ago

Does anybody sucessfull make control led matrix 64x32 with mbi5153 (icn2053) led driver ic New matrix P5 64x32 comes with new IC led driver (Same as P2.5 matrix) P5 Matrix with mbi5038 (icn2038) ic led driver works fine on this project (only transform passed) Any idea ? Thanks.

hzeller commented 6 years ago

I have not seen such panels yet. Do you have a link to a source ?

kbateam commented 6 years ago

I can make photo pcb of this matrix. So. i parsed some datatsheet of mbi IC Signal OE is not use. It's replaced by GCLK, this ic led driver has hardware 14bit (or 13bit) PWM GrayCycle on each other output (0..15) As I understand chip need to be preload configuration every time as power up. (load some parameters such scan rate 1/4, 1/8 e.t.c) also every time after load data on SDI cycle, need load PWM data for each output(0..15) and after that need send vsync command to latch data to output pins. P.S Can upload some datasheet which i found on internet.

kbateam commented 6 years ago

Photo of new P5 64x32 module Photo of old P5 64x32 module Photo both old and new P5 64x32 module

Here is some datasheets MBI5038.pdf icn2038s.pdf ICN2053.pdf MBI5153.pdf mbi5152.pdf mbi5152_appnote.pdf

Comments mbi5153 same as mbi5152 difference mbi5153 support 1/32 scan and has 16Kbits SRAM mbi5152_appnote is common algorithm to initialize chip mbi5038 and icn2038 led drivers used on old led matrix and they works fine with this project

Updated this post (upload datasheet ICN2053 led driver chip)

raphaelfacredyn commented 6 years ago

Hi @kbateam this is off topic but I would like to know if the old p5 display you bought was this one or an equivalent? This is because I want to buy this one. The drivers are the same so I think they are the same but I am not sure.

Also, what does only "transform passed" mean in your first post?

I am sorry this is off topic but I could not find your email or any other way of contacting you :|

Thank you for your help in advance

kbateam commented 6 years ago

To @raphy1234 Follow by your link is different hardware P5 outdor matrix module that i have. With china production is difficult to buy right matrix module. (Be shure , and ask your seller to send real photos of pcb matrix module) On offical site macroblock owner MBI tm is not present MBI5154 ic chip. It seems to be MBI5153 ic chip.

Also, what does only "transform passed" mean in your first post?

It means for right working this led matrix module on project which wrote hzeller need wrtie logical transofrmation procedure, cause matrix module splited on logical submodules (for expample 2x(32x32), 4x(16x32) e.t.c)

Here is my transform for modules that i have P5 64x32 1/8scan outdoor based on icn2038 ic led driver (MBI5038) transformer.cc led-matrix.cc

kbateam commented 6 years ago

Countinue for my theme If someone have any idea, will very grateful.

hzeller commented 6 years ago

Interestingly, on this document http://pmod86499.pic35.websiteonline.cn/upload/Q4F32V1.pdf there is a CS mentioned on pin 16. It doesn't say if it is high or low logic. According to Google translate, the 消隐信号 label next to it mean "Blanking Signal".

Can someone who has such a panel try to pull 16 high, by connecting that pin with 5V ?

hzeller commented 6 years ago

@birdtechstep can you try if changing the logic level on Pin 16 changes anything ?

birdtechstep commented 6 years ago

@hzeller chip select (cs pin) active low

birdtechstep commented 6 years ago

@hzeller My friend dev. on stm32 said SetBits strobe hi on columns_-4 (led_width-4)

hzeller commented 6 years ago

can you elaborate? The only place where things are strobed is already high logic.

birdtechstep commented 6 years ago

add lib/framebuffer.cc (line 587 ) work.

582      for (int col = 0; col < columns_; ++col) {
583        const gpio_bits_t &out = *row_data++;
584        io->WriteMaskedBits(out, color_clk_mask);  // col + reset clock
585        io->SetBits(h.clock);               // Rising edge: clock color in.
586
587        if (col == columns_-4) io->SetBits(h.strobe); // ICN2038S : Bird Techstep
588      }
589      io->ClearBits(color_clk_mask);    // clock back to normal.
hzeller commented 6 years ago

Interesting. This looks like it requires further digging in the datasheet what they actually need there because it looks like if it works that it is by accident. If we have decoded the full thing we can recreate it by making a new RowAddressSetter for this kind of panel.

Can others confirm that this improves the situation ?

hzeller commented 6 years ago

Is there a place where I an buy a panel with that chip, so that I can look into supporting it with the library ?

hoangphan commented 6 years ago

Great! @hzeller and @birdtechstep : i did a quick check and above patch seems to work with mine (same 2038s led driver).

shall perform more test and let you know the result!

hoangphan commented 6 years ago

Is there a place where I an buy a panel with that chip, so that I can look into supporting it with the library ?

@hzeller : you can find the P3 that has ICN2038s led driver as following link, https://www.alibaba.com/product-detail/GKGD-small-pitch-indoor-P3-RGB_60445963111.html

hoangphan commented 6 years ago

@hzeller : I have just quicked check all demo example from your library, and it seems working well with my board mentioned in #539. color display as expected, no flickering (i using gpio slow = 1)

what i'm curious is some body on the top comment of this topic, said with P5 64x32 the same code works with the same chip (2038s), however some others with 64x64 says its not.

apart from that, what is the meaning of the patch as @birdtechstep shared? (sorry i'm still on the way to study your library).

kbateam commented 6 years ago

Yes it's works without any modification

what i'm curious is some body on the top comment of this topic, said with P5 64x32 the same code works with the same chip (2038s)

hzeller commented 6 years ago

Without further datasheets that explain the protocol to the displays it is hart to tell, maybe what is happening underneath is that the strobe pulse actually is negative logic, not positive logic, so pulling up the signal before the strobe will create that situation.

hzeller commented 6 years ago

In that case, swapping the lines in https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/lib/framebuffer.cc#L595

from

   io->SetBits(h.strobe);
   io->ClearBits(h.strobe);

to

   io->CleartBits(h.strobe);
   io->SetBits(h.strobe);

would help as well. Can someone who has such a display try if this works as well ? (without the if (col == columns_-4) io->SetBits(h.strobe); patch)

I need to get to the bottom of this so that we can support this in the standard library; the columns-specific thing looks very specific and probably not necessary.

Also, I still would like to know where to buy such a panel to do experiments with.

@hoangphan the ali-express shop you mentioned: their minimum order is 40 items which I don't have the money for.

hoangphan commented 6 years ago

@hzeller : i checked your mentioned patch but unfortunately the panel is not lighted up. stay dark without the line if (col == columns_-4) io->SetBits(h.strobe);

from the datasheet as link http://www.xlix.ru/datasheet/icn2038s.pdf I'm trying to map it with the way you programmed software.

hoangphan commented 6 years ago

@kbateam : how did you get the datasheet for these led drivers? i looked into the icn2038s datasheet, but it seems too many typo and confusion. is it possible to get the official datasheet from the Chinese company (i.e. Chipone)?

hoangphan commented 6 years ago

@hzeller : i think i know the reason why if (col == columns_-4) io->SetBits(h.strobe); patch works.

with the attached snapshot of datasheet, the STROBE pin of panel (that has ICN2038s led driver) - is not simply a STROBE pin, it serves as a command parser, which also cover the LATCH data in.

as you can see, in order to latch a data out, we need to pulse the strobe pin high in the 3rd clk pulse OR the 12th pulse.

that's why the patch above works.

let me know if you agree with this. and if yes, kindly share your thought about how to make this patch generic into your standard library.

screen shot 2018-03-12 at 12 53 02 am
raphaelfacredyn commented 6 years ago

@hzeller, here are some panels that have icn2038 make sure to pick the icn2038 option though https://m.aliexpress.com/item/32784851966.html?trace=wwwdetail2mobilesitedetail&productId=32784851966&productSubject=P5-led-video-panel-nationstar-rgb-full-color-320mm-160mm-1-8-scan-outdoor-SMD-3in1&spm=a2g0s.9042311.0.0.ZfkLbb

kbateam commented 6 years ago

I got it form china reseller Look MBI5038.pdf , ICN2038 hard copy from original driver

how did you get the datasheet for these led drivers

hoangphan commented 6 years ago

I see there is a key of similarity between the icn2038s (pay attention to the S) and icn2053: they have LE pin functions as a command parser, as below snapshot.

If LE is raised after 12 CLK pulse, it means enable all output channels.

The same for icn2038S, if LE is raised after 12 CLK pulses, data is copy to reg2 - which relevant to the dual latch feature of the ASIC

7f16fd03-2308-4925-9eb9-894c4c1ce9f2

hoangphan commented 6 years ago

Attached the snapshot for dual latch feature on icn2038s. By accident, the value 12 is the key to functional of both ASICs f30b82a6-c0cc-40c6-ab6d-79d74c2b069d

hoangphan commented 6 years ago

@kbateam : are you able to make your board (with ICN2053) working with the provided patch ?if (col == columns_-4) io->SetBits(h.strobe);

if not, would you check if (col == columns_-2) io->SetBits(h.strobe); instead?

kbateam commented 6 years ago

@hoangphan Tested both variants, result negative :(

hoangphan commented 6 years ago

@kbateam : would you try to tweak around the number of CLK rising edge when STROBE pin is high? because from the datasheet of ICN2053, it looks like if you want to deliver the data to buffer of the IC, this number should be 2 or 12.

can you just tweak this around from 1 to 15 and to just see if the panel lights up?

birdtechstep commented 6 years ago

http://www.chiponeic.com/content/details11_293.html Top-Level PWM - Leading a Small Pitch LED "Core" Standard with the ICN2053

arktrin commented 6 years ago

Hello everyone. I also have these ugly 64x32 Qiang Li LED modules with ICN2053 drivers. I even managed to connect one of them to Huidu HD-C10 controller (almost), but I still cannot understand how to control these LED modules without HD-C10 controller. What should I do to solve the problem?

hzeller commented 6 years ago

Did you try the proposed change in lib/framebuffer.cc ( https://github.com/hzeller/rpi-rgb-led-matrix/issues/466#issuecomment-370287035 ) @arktrin ?

DonDalle commented 6 years ago

I also have a ICN2053 Panel. I applied both patches and it did not resolve the problem. I get some outputs on the panel but they are glitched. If re reboot the Pi the outputs won't show again. I have to unplug the power supply again.

foliastar commented 6 years ago

Dear All,

Today I tried a lot and found something strange......I have the ICN2053 in 64x64 and nothing works so far. Since I changed the GPIO-Mapping once to classic-pi1

So far I also read that they are used for LINSN or Novastar systems......what ever this means

From this time my displays started to show some strange lights..... And i can set what ever I want...the never turn off really..... I will try to make video on youtube

Here is the video: https://www.youtube.com/watch?v=E_Ylf9v0-2g

Sascha

pathosDev commented 5 years ago

Hi everyone,

I have the same problem like @foliastar. I also have a 64x64 ICN2053 led panel and nothing worked so far. I tried every "patch" mentioned above but no results. For the most time the panel stays completely blank. After playing a long time with parameters and stuff I managed to get some bugy and flickering output (random squares and lines, mostly red) as you can see here (it's demo 0, rotating square):

screenshot_643

Did anyone manage to get these panels working?

PS: I have the Adafruit RGB Matrix Bonnet.

Greetings, Marcel

arktrin commented 5 years ago

Here the output of Huidu HD-C10 controller that somehow can work with ICN2053: inc2053_out

Hope this will help someone.

g3gg0 commented 5 years ago

@arktrin do you happen to still have access to the signal?

need some information about the OE tick count.

SebiTimeWaster commented 5 years ago

is this thread dead? did someone find a signal diagram or something? the picture above is not helpful with timings / counts...

VLVOZ commented 5 years ago

@hzeller chip select (cs pin) active low

``

@hzeller My friend dev. on stm32 said SetBits strobe hi on columns_-4 (led_width-4)

Hello, can someone help with my problem? I have the driver ICN2053 on the LED panel, I need to know the contents of the configuration registers and the algorithm for displaying the image on the LED panel using these ICN2053

ElectronicsInFocus commented 5 years ago

icn2053 need 138 clocks on OE pin in each scan period. I successfully run it on ESP32. Video (sources in description): https://www.youtube.com/watch?v=nhCGgTd7OHg

SebiTimeWaster commented 5 years ago

@ElectronicsInFocus AWESOME! i am ordering an ESP32 now.

I hope google translate can translate your comments ok ^^

SebiTimeWaster commented 5 years ago

so, i was able to build it, had to fix some include paths from windows to linux notation, and in a newer version of ESP-IDF the mrt package moved from /mrt to /driver, but all in all easy. flashing only works by holding the boot button on my SHC-NodeMCU-ESP32 module.

i think the pinout is totally different on my module, thats why i got this out:

led_wall

i have to read up further about it, but i can already see the intended pattern, kinda... will continue tomorrow.

arktrin commented 5 years ago

@SebiTimeWaster can you share your ESP-IDF linux project with pinout, please?

SebiTimeWaster commented 5 years ago

so, it looks now like this: IMG_20190403_234042

this guide helped me find free pins, it seems some pins react crazy or are just not usable as outputs: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ and this was the only info i could find about "vin", but 5v on vin works just fine: https://docs.zerynth.com/latest/official/board.zerynth.doit_esp32/docs/index.html

the upper block has an issue with green (some stuck on full, most on off), but this seems to be an initialization problem, i swapped panels and rgb lines around and it is always green that shows like this.

can someone verify one thing for me so i know i'm not crazy: do your panels also PUT OUT 5v on OE, LAT and CLK even though these are inputs??

the code from @ElectronicsInFocus is by no means complete, there is for instance an 8 to 16 bit mapping missing. but as a proof-of-concept it works nice!

@arktrin sure, here you go: follow these two setup guides: https://docs.espressif.com/projects/esp-idf/en/latest/get-started/linux-setup.html in https://docs.espressif.com/projects/esp-idf/en/latest/get-started/#get-started-get-packages you do not need Step 7 if your ESP32 does use /dev/ttyUSB0 and Step 5 is replaced with the download: unzip nadyrshin_ryu-icn2053_esp32_demo.zip into the /esp/ directory then in the "nadyrshin..." directory run "make flash" the used pinout is in esp/nadyrshin_ryu-icn2053_esp32_demo/main/icn2053/icn2053.c on the top, connect "vin" to the 5v from your power supply (but only when you did NOT connect USB!). that should be it.

the next step for me is to rewrite the code in Arduino, but that will take a while.

SebiTimeWaster commented 5 years ago

Here the finished library (although i have a couple of additional feature ideas): ICN2053_ESP32_LedWall

Most information is in the repo's readme, just a few comments here:

The ESP32 is not fast enough, partially because of how the ICN2053 chips work. Since the chip is saving 16 x 32 pixels of gray scale 16 bit data in its internal memory and there is no pin to control how the data is outputted it depends on the incoming data stream to be uniform and exactly as specified to use this as cues to output its saved data. the generation of the clock data on the OE pin (At 12 Mhz) takes a lot of power away from outputting data, which reduces real FPS. so i think on one hand the chips have the advantage over the passive chips used in older panels to generate much better picture quality, but on the other hand it takes a lot of processing power to generate all the signals needed (in the quality needed), MUCH more than with the old style of chips. so overall i think these panels are much better suited for professional systems (Like the video processing systems one can buy from china), but not so much for private tinkering, although with my code it is absolutely possible to do graphics and text where the picture quality is not as important.

Finding all this stuff out was a pain in the butt. taking over the code from @ElectronicsInFocus it looked all easy and i thought hey, ESP32 can do hardware PWM generation that makes it much faster! but after a lot of reading and trying out finding out that turning the hardware generation on and off has a massive delay and that the ICN2053 needs an EXACT clock cycle (meaning just putting out a couple more cycles produces a garbled image) meant i could not utilize that at all and was pretty frustrating.

Finding out what pins i could use was also frustrating, my board has a GPIO13 that does not exist on any pin mapping i found, GPIO's 34 to 39 cannot be used for output even though they are named GPIO, GPIO 12 + 13 can be used, but do something special on programming, and pin 4 failed for me for no apparent reason.

What is really nice about the ICN2053 chips is that the output refresh "fps" is at 16 times the real fps, so even if you only reach 50 real FPS the refresh rate is actually 800 fps, which makes the output absolutely flicker free.

Buying a Logic Analyzer and to see what is happening on the lines was the only thing that enabled me to finish this project.

If no one finds a trick to optimize the data generation more i think the only way to go faster (to do lets say 128x128 pixel 30 hertz with one board) is to go to a Raspberry Pi. The only other possibility in the Arduino family are Intel Edison boards which run on Atom processors and are extremely expensive.

SebiTimeWaster commented 5 years ago

so @hzeller will you adapt the code to your rPi library even though it works completely different to the other panels you support?

kimyunil commented 5 years ago

Any update for driving this 128x128 panel with rpi? https://www.aliexpress.com/item/P1-875mm-Indoor-SMD-Full-Color-Led-Module-240x240mm-High-Resolution-Monitoring-Room-LED-Video-Display/32989607179.html

kimyunil commented 5 years ago

As @hzeller said,

   io->CleartBits(h.strobe);
   io->SetBits(h.strobe);

seems to works, without if (col == columns_-4) io->SetBits(h.strobe);

But still led is glitching.

kimyunil commented 5 years ago

Do I have to apply @kbateam patch file?