m5stack / M5GFX

Graphics library for M5Stack series

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using AtomDisplay with single-mode HDMI devices

tobozo opened this issue · comments

commented

Hi and thanks for this awesome driver!

According to the data sheet of my display, I came up with this configuration. However the initialization fails with an "out of range" error printed in the console.

M5AtomDisplay display( 800, 480, 66, 800, 480, 1, 1, 32000000 );

I plugged the display to a linux machine and extracted the xrandr information after it was detected.

It turns out this display only has one refresh rate: 66Hz (negociated at 65.681445).

I've double checked the numbers in a pixel clock calculator, and the EDID information matches the data sheet information, what am I doing wrong?

Display informations

    00ffffffffffff000481040001000000
    01110103800f0a000a00000000000000
    00000000000001010101010101010101
    010101010101800c208030e02d102830
    d3006c44000000180000001000000000
    00000000000000000000000000100000
    00000000000000000000000000000010
    00000000000000000000000000000017
  • Vendor & Product Identification:
  Manufacturer: ADA
  Model: 4
  Serial Number: 1
  Made in: week 1 of 2007
  • Preferred video timing:
  DTD   1:   800x480    65.681445 Hz   5:3     34.483 kHz     32.000000 MHz (108 mm x 68 mm)
                  Hfront   40 Hsync  48 Hback   40 Hpol N
                  Vfront   13 Vsync   3 Vback   29 Vpol N
  • Calculations:
    image

other AtomDisplay related threads: #30 #47

Hello, @tobozo
My apologies for the delay in responding.

ModuleDisplay and AtomDisplay is not officially HDMI compliant, so special resolution settings may not be possible.

I don't have this panel, so I can't say exactly what it is,
There may be a slight possibility that you can display it by making your own adjustments based on the EDID information.

Try the following settings and see.

#include <M5AtomDisplay.h>

M5AtomDisplay display(800,480,60,800,480,1,1,32000000);

void setup(void)
{
  display.init();
  auto panel = (lgfx::Panel_M5HDMI*)display.getPanel();
  lgfx::Panel_M5HDMI::video_timing_t param;
  param.h.active = 800;
  param.h.front_porch = 40;
  param.h.sync = 48;
  param.h.back_porch = 40;
  param.v.active = 480;
  param.v.front_porch = 13;
  param.v.sync = 3;
  param.v.back_porch = 29;
  panel->setVideoTiming(&param);
}

void loop(void)
{
  display.fillRect(rand() & 512, rand() & 512, 16, 16, rand());
  delay(1);
}

However, if the horizontal blanking period is too short, the FPGA may not operate in time.
In the above configuration, the blanking period is 128, but this is probably not enough.