pixelmatix / SmartMatrix

SmartMatrix Library for Teensy 3, Teensy 4, and ESP32
http://docs.pixelmatix.com/SmartMatrix
612 stars 161 forks source link

FM6126A chip support #78

Closed marcmerlin closed 3 years ago

marcmerlin commented 5 years ago

Newer panels are shipping with FM6126A, apparently because it's a chip offering faster refresh, which is necessary for bigger displays. But it indeed does not work with SmartMatrix https://community.pixelmatix.com/t/pxmatrix-seems-to-support-fm6126a-driver-chips-that-smartmatrix-doesnt-support/421 Discusses the details. The chip is already supported by http://github.com/2dom/PxMatrix/ but that's only supported on ESP8266

marcmerlin commented 4 years ago

Mmm, now I just get a black screen with a couple of green bars and a checkered pattern on the 5th chained panel. I did a git reset --hard HEAD^ and still get it, even at 15Mhz. I'm stumped, not sure what broke. If I connect the ribbon into a regular panel while the sketch is running, display is fine right away.

embedded-creations commented 4 years ago

Can you reverse that commit, bringing back numLeds? First try numLeds set to 256, as it was, then change over to the actual number of LEDs you update per row? KMatrixWidth * the number of panels you have stacked vertically. If you could try a handful of values and see where it breaks that would help. Thanks!

marcmerlin commented 4 years ago

@embedded-creations sorry, I messed up and the FM6126A was gone from my sketch. It's back and now it works again like it did last ime. I can see how the init length change shows up in the overflow panels, while the main 3 panels are the same: they mostly work except for the lower right corner that is wrong in intensity.

But wait, it gets better: 1) if I init the panels with rpi, and switch in the ESP32, everything looks fine 2) I reboot the ESP32, it inits the panels, the lower right corner looks wrong 3) if I plug the rpi back in, using the ESP32 init, nothing gets displayed. In other words, the ESP32 FM6126A init isn't quite right and doens't allow the rpi to talk to the panels until I restart the rpi and have it re-init.

hope this helps.

embedded-creations commented 4 years ago

@marcmerlin Just to confirm: "upper right corner where the pixels first get pushed" (from your note on Mar 18), this is on the side of the panel closest to the ESP32, correct? "lower right corner" is this a different corner, or same one? Same side of the panel closest to ESP32?

if I plug the rpi back in, using the ESP32 init, nothing gets displayed. In other words, the ESP32 FM6126A init isn't quite right and doens't allow the rpi to talk to the panels until I restart the rpi and have it re-init.

Did you do this multiple times or just once? I could see where unplugging and plugging in could accidentally put the chips in a state where they need an init sequence again. Do you mind trying it a couple more times? (Sorry, I wish I had your panel here to try it myself)

The change I just pushed adds more delays to the reset sequence. Can you give that a try to see if that helps?

Thanks again

marcmerlin commented 4 years ago

@embedded-creations 1) lower right is indeed closest to th ESP32, looks like the first 16 pixel columns are wrong on the first panel. Anything beyond that is fine. This is 100% repeatable

2) plugging/unplugging, from ESP32 to rPI, I did it twice, it failed twice.
From rPI to ESP32, I did it 3 times, and it worked 3 times.
I didn't touch any pins (which indeed can send garbage and de-init the panels)
I don't need the ESP32 to rPI to work, but I thought I'd gvie that bit of info in case it was useful. It could also be a wild goose chase. As long as the first set of pixels is initialized correctly, I think it should be all good.

embedded-creations commented 4 years ago

@marcmerlin Thanks for clarifying. LMK if the new delays I added help with the first 16 pixel columns

Now that I think about it, the worst parts of my panel when driven at 20MHz (instead of 15MHz) are in the first 16 pixels. Not the same cause of failure, but similar symptoms.

marcmerlin commented 4 years ago

sorry for the delay. I just tried with the added delays and it didn't really fix that issue for me.

embedded-creations commented 4 years ago

Hmm, I'm not sure what else to try...

marcmerlin commented 4 years ago

no problem. I don't really need it myself anyway since I only have FM6126A on panels that are too big for smartmatrix, but if I can provide further help, let me know.

embedded-creations commented 3 years ago

@daveythacher Do you have more info than is in the publicly available datasheet, which doesn't seem to include the details of the config register?