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.63k stars 1.15k forks source link

P10 HUB12 Multiplexing Almost There #593

Open cmagnuson opened 6 years ago

cmagnuson commented 6 years ago

I'm trying to get a P10 panel with HUB12 interface working and am almost there, but can't get the mapping quite right.

I'm using the adafruit matrix HAT and rewiring the HUB75 OE/GND/A/B/CLK/LAT/R to matching HUB12 pins seems to be working correctly.

The problem I'm seeing is that with the following mapping, I get the same results duplicated on left half and right half of display:

class P10Mapper : public MultiplexMapperBase {
public:
  P10Mapper() : MultiplexMapperBase("P10", 2) {}

  void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
    int y_component_matrix_x = ((int)(y/4)) * 8;
    int x_component_matrix_x = (((int)(x/8)) * 32) + (x % 8);
    *matrix_x = x_component_matrix_x + y_component_matrix_x;
    *matrix_y = 0 - ((y % 4) - 3);
  }
};

Using this command: sudo ./demo -D12 --led-gpio-mapping=adafruit-hat --led-rows=16 --led-multiplexing=7 20180419_145321

And with another mapping I can solve the left-right split, but then only every 2 rows are displayed (2 on 2 off, etc):

class P10Mapper2 : public MultiplexMapperBase {
public:
  P10Mapper2() : MultiplexMapperBase("P10-2", 4) {}

  void MapSinglePanel(int x, int y, int *matrix_x, int *matrix_y) const {
    int y_component_matrix_x = ((int)(y/4)) * 8;
    int x_component_matrix_x = (((int)(x/8)) * 32) + (x % 8);
    *matrix_x = x_component_matrix_x + y_component_matrix_x;
    *matrix_y = 0 - ((y % 2) - 1);
  }
};

sudo ./demo -D12 --led-gpio-mapping=adafruit-hat --led-rows=16 --led-multiplexing=8 --led-chain=1 20180419_145814

I've experimented with the led-row-addr-type and the existing multiplexers but with no success. Any ideas would be greatly appreciated!

cmagnuson commented 6 years ago

For what it's worth, I was able to map out each pixel with the following command: sudo ./demo -D12 --led-gpio-mapping=adafruit-hat --led-rows=16 --led-cols=32 --led-chain=4

When I did less then led-chain=4, I was getting duplicate pixels (display split left and right or top and bottom). I created the following x/y mapping for them, but haven't been able to successfully implement a multiplex mapper that works sized for the 16x32 display

X-mapping: screen shot 2018-04-23 at 11 51 56 am

Y-mapping: screen shot 2018-04-23 at 11 52 08 am

I also tried a command that should be appropriately sized, but after filling rows 0 and 1, rows 2 and 3 did not fill: sudo ./demo -D12 --led-gpio-mapping=adafruit-hat --led-rows=4 --led-cols=128 --led-chain=1

lbnshrivas commented 6 years ago

did you get a solution for your issue?

cmagnuson commented 6 years ago

I didn't but thanks for checking back. I switched to some RGB panels that were supported by rpi-rgb-led-matrix and haven't done any more experimenting with these P10 panels since. Issue can be closed in my opinion

lbnshrivas commented 6 years ago

I have written a transformer for my single color P10 module. Please see #531 . May be it will be useful to you.