Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FM6126A chip support #78

Open
marcmerlin opened this issue Apr 17, 2019 · 18 comments

Comments

Projects
None yet
4 participants
@marcmerlin
Copy link
Contributor

commented Apr 17, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

@bobdavis321

This comment has been minimized.

Copy link

commented Apr 22, 2019

Here is the teensy code to reset the panels (It may work with other processors by changing pin assignments:)

// SMart Matrix Panel Reset Program
// For use with newer LED Panels
// Written 3/28/2019 by Bob Davis
int MaxLed = 128;

#define GPIO_PIN_CLK_TEENSY_PIN 14
#define GPIO_PIN_LATCH_TEENSY_PIN 3
#define GPIO_PIN_OE_TEENSY_PIN 4
#define GPIO_PIN_B0_TEENSY_PIN 6
#define GPIO_PIN_R0_TEENSY_PIN 2
#define GPIO_PIN_R1_TEENSY_PIN 21
#define GPIO_PIN_G0_TEENSY_PIN 5
#define GPIO_PIN_G1_TEENSY_PIN 7
#define GPIO_PIN_B1_TEENSY_PIN 20
#define ADDX_TEENSY_PIN_0 9
#define ADDX_TEENSY_PIN_1 10
#define ADDX_TEENSY_PIN_2 22
#define ADDX_TEENSY_PIN_3 23

int C12[16] = {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int C13[16] = {0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0};

void setup() {
// put your setup code here, to run once:
pinMode(GPIO_PIN_CLK_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_LATCH_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_OE_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_B0_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_R0_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_R1_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_G0_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_G1_TEENSY_PIN, OUTPUT);
pinMode(GPIO_PIN_B1_TEENSY_PIN, OUTPUT);
pinMode(ADDX_TEENSY_PIN_0, OUTPUT);
pinMode(ADDX_TEENSY_PIN_1, OUTPUT);
pinMode(ADDX_TEENSY_PIN_2, OUTPUT);
pinMode(ADDX_TEENSY_PIN_3, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
// Send Data to control register 11
digitalWrite (GPIO_PIN_OE_TEENSY_PIN, HIGH); // Display reset
digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
for (int l=0; l<MaxLed; l++){
int y=l%16;
digitalWrite (GPIO_PIN_R0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_G0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_B0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_R1_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_G1_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_B1_TEENSY_PIN,LOW);
if (C12[y]==1){
digitalWrite (GPIO_PIN_R0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_G0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_B0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_R1_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_G1_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_B1_TEENSY_PIN,HIGH);
}
if (l>MaxLed-12){digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, HIGH);}
else{digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, LOW);}
digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, HIGH);
digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, LOW);
}
digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
// Send Data to control register 12
for (int l=0; l<MaxLed; l++){
int y=l%16;
digitalWrite (GPIO_PIN_R0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_G0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_B0_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_R1_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_G1_TEENSY_PIN,LOW);
digitalWrite (GPIO_PIN_B1_TEENSY_PIN,LOW);
if (C13[y]==1){
digitalWrite (GPIO_PIN_R0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_G0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_B0_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_R1_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_G1_TEENSY_PIN,HIGH);
digitalWrite (GPIO_PIN_B1_TEENSY_PIN,HIGH);
}
if (l>MaxLed-13){digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, HIGH);}
else{digitalWrite(GPIO_PIN_LATCH_TEENSY_PIN, LOW);}
digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, HIGH);
digitalWrite(GPIO_PIN_CLK_TEENSY_PIN, LOW);
}
digitalWrite (GPIO_PIN_LATCH_TEENSY_PIN, LOW);
digitalWrite (GPIO_PIN_CLK_TEENSY_PIN, LOW);
}
.

@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Thanks @bobdavis321. Diffs work better, but I compared what you pasted with what I was able to get from your webpage:

     // Send Data to control register 11
-    digitalWrite (GPIO_PIN_OE_TEENSY_PIN, LOW); // Display reset
+   digitalWrite (GPIO_PIN_OE_TEENSY_PIN, HIGH); // Display reset

The problem was not with MaxLed but the version I got from your webpage that had this small bug. Thanks for the updated version

https://github.com/marcmerlin/SmartMatrix/blob/FM6126A/examples/FM6126A_reset/FM6126A_reset.ino updated.

@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented Apr 24, 2019

Also sent to @embedded-creations via #79
Obviously it's not where it belongs long term, but if he can't test it, it's better there than nowhere for now

@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented Apr 25, 2019

@bobdavis321 ok, my upload has your corrected code now.
However, I'm not too clear about a couple of things:

  1. I read that the reset code had to be run once before running normal code.
    This is what I do with rPi, all I have to run is https://github.com/hzeller/rpi-rgb-led-matrix/files/3100669/resetmatrix_adafruit.py.txt and then normal code and it works.
    With your teensy version, you put that in loop() instead of setup()
    I moved it to setup() because it didn't feel like it needed to be in loop(), but the corrected version you gave me still does this in loop() (and doesn't fully work, see 2) below)
    Can you please download and test https://github.com/marcmerlin/SmartMatrix/blob/FM6126A/examples/FM6126A_reset/FM6126A_reset.ino ?

  2. your teensy version even after your fix you just gave me, still doesn't seem to fully work. The top half of the screen and bottom half (top 16 vs bottom 16 lines) don't look the same.
    Are you not having this issue?
    Again, can you try the link above and verify if you are seeing this, or not when doing
    a) run the code above
    b) run featuredemo from smartmatrix examples.

Thanks,
Marc

@bobdavis321

This comment has been minimized.

Copy link

commented Apr 25, 2019

@embedded-creations

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

Where'd you guys get these panels? I'd like to order some so I can test compatibility

@marcmerlin

This comment has been minimized.

@embedded-creations

This comment has been minimized.

Copy link
Contributor

commented Apr 29, 2019

@marcmerlin How would you like this to be integrated into SmartMatrix Library? Ideas:

  • Send this reset sequence automatically all the time on calling matrix.setup() (I'm assuming it doesn't do anything bad to other panels)
  • Have an option you can pass, e.g. SMARTMATRIX_OPTIONS_FM6126A into the library to make it work
  • Provide an optional matrix.fm6126a_reset() method
@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented Apr 29, 2019

I was thinking about this too...
I'm not sure how slow the sequence is, but it may have a bit of a time penalty and it's hard to know it can't cause problems to any other panel.
Given that, making it an init option seems more desirable and safer. In other words, SMARTMATRIX_OPTIONS_FM6126A would be given to setup as an optional argument that defaults to 0

@MotivDev

This comment has been minimized.

Copy link

commented May 8, 2019

@marcmerlin @embedded-creations Will this fix be applied to the ESP32 branch as well or are there other changes needed to make it work on the ESP32 chip? If so, any ETA? I just looked at my 64x64 panels late yesterday and 2 of the 3 on the bench have this newer FM6126 chip....

-Rich

@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented May 8, 2019

@MotivDev if/when this gets integrated in the SM source code, I'm sure it would, but currently, it is not. You can take the script I posted and modify the pin numbers to match your ESP32 wiring.

@embedded-creations

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

@bobdavis321 Can you send me a link to the eBay panels you bought? I ordered a panel from Aliexpress, same listing that someone else got FM6126A chipset, and I got ICN2037. The Amazon listing Marc posted is now unavailable. I'm unable to easily source a panel to test.

@bobdavis321

This comment has been minimized.

Copy link

commented May 10, 2019

@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

@embedded-creations damn, sorry to hear that you got the wrong one again, but see below
@bobdavis321 the ebay one you listed looks identical to the one I got from amazon .
By the way, the amazon panel is likely still available directly from the seller if you'd like me to put you in touch with him (been working with him directly via FB chat)
If you send him a chat request I'm sure he'll send you the correct panel directly, bypassing ebay/amazon: https://www.facebook.com/su.hongren.9
I think he removed the amazon panel because he was getting too many returns.
Azerone, I'm sure would be happy to get you setup with exactly the panels you want, checking the chips before mailing. Tell him I sent you and that you maintain the best driver for the arduino environment :)
I've done enough work with him that I just send him money by paypal, say via FB chat what I wanted, and he's sent me what we agreed on, including replaced some panels that were defective (i.e. good customer support and work ethics).

@embedded-creations

This comment has been minimized.

Copy link
Contributor

commented May 12, 2019

Thanks @bobdavis321 and @marcmerlin. I contacted the eBay seller and confirmed that they would ship me a panel with the right chipset. We'll see what I actually get in a few weeks. :-)

@embedded-creations

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

I'm now the proud owner of two panels with FM6126A chips. One is a P3 64x32 from Bob's eBay seller, which I haven't tested yet. The other is a flexible P2.5 128x64 panel, which just happened to have FM6126A chips installed.

I used Bob's sketch with some minor modifications and got the panel working from a Teensy 3.6 in a SmartLED Shield V4:

  • I removed the pin definitions and instead added #includes to the SmartMatrix Library and SmartLED Shield V4
    • I had to add definitions for GPIO_PIN_LATCH_TEENSY_PIN and GPIO_PIN_OE_TEENSY_PIN to SmartMatrix Library
  • I had to make the pinMode(ADDX_TEENSY_PIN_0... calls conditional as SmartLED Shield V4 doesn't have those pins (and fortunately this sketch doesn't actually need them)
@marcmerlin

This comment has been minimized.

Copy link
Contributor Author

commented May 23, 2019

Glad you were finally able to get some, when many of us were getting some without trying to :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.