<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>advanced hmi — ELECROW - FORUM</title>
        <link>https://forum.elecrow.com/index.php?p=/</link>
        <pubDate>Tue, 07 Apr 2026 22:44:06 +0000</pubDate>
        <language>en</language>
            <description>advanced hmi — ELECROW - FORUM</description>
    <atom:link href="https://forum.elecrow.com/index.php?p=/discussions/tagged/advanced-hmi/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>Touchscreen failure on CrowPanel_Advance_3.5 with C6 wireless module</title>
        <link>https://forum.elecrow.com/index.php?p=/discussion/28217/touchscreen-failure-on-crowpanel-advance-3-5-with-c6-wireless-module</link>
        <pubDate>Mon, 02 Mar 2026 15:10:48 +0000</pubDate>
        <category>Elecrow HMI Display</category>
        <dc:creator>msullivan</dc:creator>
        <guid isPermaLink="false">28217@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>I have the touchscreen working with esphome using i2c on gpio 15 &amp; 16, When I plug in a C6 wireless module the touch screen doesn't work at all and the esphome logs show it detecting many non-existent i2c devices at addresses 0x08-0x14 &amp; 0x65-0x77. Is the i2c bus and touchscreen expected to work properly with the C6 wireless module?</p>

<p>Based on the Wireless_Module-ESP32-C6_DataSheet.pdf and the wiki for CrowPanel_Advance_3.5-HMI_ESP32_AI_Display.html it appears as though the host gpio 15 &amp; 16 connect to the C6 gpio20 and EN pins. Is that correct?</p>

<p>If the C6 gpio20 is set to an input pullup would you expect the host i2c bus to work properly? If the host i2c bus drives the C6 EN pin would you expect it to be fast enough to avoid resetting the C6?</p>
]]>
        </description>
    </item>
    <item>
        <title>Strange behaviour Crow Panel HMI Advanced 7inch Lesson4 - displaced sccreen</title>
        <link>https://forum.elecrow.com/index.php?p=/discussion/1123/strange-behaviour-crow-panel-hmi-advanced-7inch-lesson4-displaced-sccreen</link>
        <pubDate>Wed, 26 Feb 2025 12:51:28 +0000</pubDate>
        <category>Elecrow HMI Display</category>
        <dc:creator>Bart_SwiatlLnuksa</dc:creator>
        <guid isPermaLink="false">1123@/index.php?p=/discussions</guid>
        <description><![CDATA[<p>Hello.<br />
I'll say right away - I'm a complete beginner..<br />
I have a Crow Panel Advanced HMI 7 inch panel in my tests.<br />
During lesson 4 - photos from SD CARD - the photos are loaded but the image is shifted a few dozen pixels to the left. I hope you can see it well in the photos I'm attaching.<br />
The panel resolution is set correctly - I'm attaching the code<br />
Second thing - with the standard parameter<br />
cfg.freq_write = 21000000; the image flickers when loading - it's like it's waving.<br />
After setting cfg.freq_write = 14000000; - everything is ok<br />
Setting below 14 only causes a white screen</p>

<p>SD_CrowPanel_ESP32_Advance_HMI_4_3_5_0_7_0.ino</p>

<pre><code>    #include "pins_config.h"
    #include "LovyanGFX_Driver.h"
    #include &lt;Wire.h&gt;
    #include &lt;SPI.h&gt;
    #include &lt;FS.h&gt;
    #include &lt;SD.h&gt;
    #include &lt;Adafruit_SSD1306.h&gt;
    #include &lt;Adafruit_GFX.h&gt;

    /* Expand IO */
    #include &lt;TCA9534.h&gt;
    TCA9534 ioex;

    #define SD_MOSI 6
    #define SD_MISO 4
    #define SD_SCK 5
    #define SD_CS 0 //The chip selector pin is not connected to IO

    // The image name you stored on the SD card
    #define IMAGE_1 "/1.bmp"
    #define IMAGE_2 "/2.bmp"
    #define IMAGE_3 "/3.bmp"
    #define IMAGE_4 "/4.bmp"
    // #define IMAGE_5 "/5.bmp"

    SPIClass SD_SPI = SPIClass(HSPI);
    LGFX gfx;

    // Display text on the screen
    void show_test(int lcd_w, int lcd_h, int x, int y, const char * text) {
      gfx.fillScreen(TFT_BLACK);
      gfx.setTextSize(3);
      gfx.setTextColor(TFT_RED);
      gfx.setCursor(x, y);
      gfx.print(text); 
    }

    void setup()
    {
      Serial.begin(115200); // set baud rate

     // Init Display
      gfx.init();
      gfx.initDMA();
      gfx.startWrite();
      gfx.fillScreen(TFT_BLACK);
      delay(500);

      Wire.begin(15, 16);
      delay(50);
      ioex.attach(Wire);
      ioex.setDeviceAddress(0x18);
      ioex.config(1, TCA9534::Config::OUT);
      /* Turn on backlight */Serial.println("Refreshing image...5");

      ioex.output(1, TCA9534::Level::H);

      if (SD_init() == 0)
      {
        Serial.println("TF_Card initialization succeeded");
        show_test(LCD_H_RES, LCD_V_RES, 800, 480, "SD_Card OK");
        delay(3000);
      } else {
        Serial.println("TF card initialization failed");
        show_test(LCD_H_RES, LCD_V_RES, 800, 480, "SD_Card failed");
        delay(3000);
      }
      gfx.setRotation(2);
      gfx.fillScreen(TFT_BLACK);
      Serial.println( "----- Setup done -----" );
    }

    void loop()
    {
     // Cycle printing each image
      Serial.println("Refreshing image...1");
      displayImage(SD, IMAGE_1, 800, 480);
      delay(5000);

      Serial.println("Refreshing image...2");
      displayImage(SD, IMAGE_2, 800, 480);
      delay(5000);

      Serial.println("Refreshing image...3");
      displayImage(SD, IMAGE_3, 800, 480);
      delay(5000);

      Serial.println("Refreshing image...4");
      displayImage(SD, IMAGE_4, 800, 480);
      delay(5000);

      // Serial.println("Refreshing image...5");
      // displayImage(SD, IMAGE_5, 800, 480);
      // delay(5000);
    }

    // SD card initialization
    int SD_init()
    {
      SPI.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);

      SD_SPI.begin(SD_SCK, SD_MISO, SD_MOSI);
      if (!SD.begin(SD_CS, SD_SPI, 80000000))
      {
        Serial.println(F("ERROR: File system mount failed!"));
        SD_SPI.end();
        return 1;
      }
      else
      {
        Serial.println("Card Mount Successed");
        Serial.printf("SD Size: %lluMB \n", SD.cardSize() / (1024 * 1024));
        // hspi-&gt;end();
      }
      listDir(SD, "/", 2);
      Serial.println("**** TF Card init finished ****.");
      return 0;
    }

    /*
    Function: List files and subdirectories in the specified directory.
    Parameters:
      - fs: The file system object used to operate on the file system.
      - dirname: A pointer to the name of the directory whose contents are to be listed.
      - levels: Specifies the depth of recursive listing of subdirectories.
    */
    void listDir(fs::FS &amp; fs, const char *dirname, uint8_t levels) {
      Serial.printf("Listing directory: %s\n", dirname); 
      File root = fs.open(dirname); // Open the specified directory.
      // If the directory cannot be opened.
      if (!root) { 
        Serial.println("Failed to open directory"); 
        return; 
      }
      // If the opened item is not a directory.
      if (!root.isDirectory()) { 
        Serial.println("Not a directory"); 
        return; 
      }
      File file = root.openNextFile(); // Open the next file in the directory.
      // While there are still files.
      while (file) { 
        // If the current file is a directory.
        if (file.isDirectory()) { 
          Serial.print("  DIR : "); 
          Serial.println(file.name()); // Print the directory name.
          // If there are still levels of depth for recursion.
          if (levels) { 
            listDir(fs, file.name(), levels - 1); // Recursively call the function to list the contents of the subdirectory, reducing the depth by 1.
          }
        } 
        // If the current file is not a directory, i.e., a regular file.
        else { 
          Serial.print("  FILE: "); 
          Serial.print(file.name()); // Print the file name.
          Serial.print("  SIZE: "); 
          Serial.println(file.size()); // Print the file size.
        }
        file = root.openNextFile(); // Continue to open the next file in the directory.
      }
    }

    /*
      Function:wrong position 7
        - Display image from file
      Parameters:
        - fs: The file system object
        - filename: The name of the BMP image file
        - x: The x - coordinate on the screen to start printing the image
        - y: The y - coordinate on the screen to start printing the image
      Returns:
        - 0 if the image is printed successfully, 0 if the file cannot be opened
    */
    int displayImage(fs::FS &amp;fs, String filename, int x, int y)
    {
        File f = fs.open(filename, "r"); // Open the file for reading
        if (!f)
        {
            Serial.println("Failed to open file for reading");
            f.close();
            return 0; // File open failed, return 0
        }
        f.seek(54); // Skip the 54 - byte BMP file header
        int X = x; // representing the width of the image
        int Y = y; // representing the height of the image
        uint8_t RGB[3 * X]; // Storage space for RGB data of each row, 320 pixels, 3 bytes per pixel (RGB)

        for (int row = 0; row &lt; Y; row++) // Iterate through each row of the image
        {
            f.seek(54 + 3 * X * row); // Jump to the position of the current row
            f.read(RGB, 3 * X); // Read the RGB data of the current row
            gfx.pushImage(0, row, X, 1, (lgfx::rgb888_t *)RGB); // Display the data of the current row
        }
        f.close(); // Close the file
        return 0; 
    }
</code></pre>

<p>LovyanGFX_Driver.h:</p>

<pre><code>#define LGFX_USE_V1
#include &lt;LovyanGFX.hpp&gt;
#include &lt;lgfx/v1/platforms/esp32s3/Panel_RGB.hpp&gt;
#include &lt;lgfx/v1/platforms/esp32s3/Bus_RGB.hpp&gt;
#include &lt;driver/i2c.h&gt;

class LGFX : public lgfx::LGFX_Device {
public:

  lgfx::Bus_RGB _bus_instance;
  lgfx::Panel_RGB _panel_instance;
//  lgfx::Light_PWM _light_instance;
  lgfx::Touch_GT911 _touch_instance;

  LGFX(void) {
    {
      auto cfg = _panel_instance.config();

      cfg.memory_width = 800;
      cfg.memory_height = 480;
      cfg.panel_width = 800;
      cfg.panel_height = 480;

      cfg.offset_x = 10;
      cfg.offset_y = 0;

      _panel_instance.config(cfg);
    }

    {Serial.println("Refreshing image...5");

      auto cfg = _panel_instance.config_detail();

      cfg.use_psram = 1;

      _panel_instance.config_detail(cfg);
    }

    {
      auto cfg = _bus_instance.config();
      cfg.panel = &amp;_panel_instance;
      cfg.pin_d0 = GPIO_NUM_21;    // B0
      cfg.pin_d1 = GPIO_NUM_47;    // B1
      cfg.pin_d2 = GPIO_NUM_48;   // B2
      cfg.pin_d3 = GPIO_NUM_45;    // B3
      cfg.pin_d4 = GPIO_NUM_38;    // B4
      cfg.pin_d5 = GPIO_NUM_9;    // G0
      cfg.pin_d6 = GPIO_NUM_10;    // G1
      cfg.pin_d7 = GPIO_NUM_11;    // G2
      cfg.pin_d8 = GPIO_NUM_12;   // G3
      cfg.pin_d9 = GPIO_NUM_13;   // G4
      cfg.pin_d10 = GPIO_NUM_14;   // G5
      cfg.pin_d11 = GPIO_NUM_7;  // R0
      cfg.pin_d12 = GPIO_NUM_17;  // R1
      cfg.pin_d13 = GPIO_NUM_18;  // R2
      cfg.pin_d14 = GPIO_NUM_3;  // R3
      cfg.pin_d15 = GPIO_NUM_46;  // R4

      cfg.pin_henable = GPIO_NUM_42;
      cfg.pin_vsync = GPIO_NUM_41;
      cfg.pin_hsync = GPIO_NUM_40;
      cfg.pin_pclk = GPIO_NUM_39;
      cfg.freq_write = 14000000;

      cfg.hsync_polarity = 0;
      cfg.hsync_front_porch = 8;
      cfg.hsync_pulse_width = 4;
      cfg.hsync_back_porch = 8;
      cfg.vsync_polarity = 0;
      cfg.vsync_front_porch = 8;
      cfg.vsync_pulse_width = 4;
      cfg.vsync_back_porch = 8;
      cfg.pclk_idle_high = 1;

      _bus_instance.config(cfg);
    }
    _panel_instance.setBus(&amp;_bus_instance);

//    {
//      auto cfg = _light_instance.config();
//      cfg.pin_bl = GPIO_NUM_2;
//      _light_instance.config(cfg);
//    }
//    _panel_instance.light(&amp;_light_instance);

    {
      auto cfg = _touch_instance.config();
      cfg.x_min = 0;
      cfg.x_max = 800;
      cfg.y_min = 0;
      cfg.y_max = 480;
      cfg.pin_int = -1;
      cfg.bus_shared = false;
      cfg.offset_rotation = 0;
      // I2C接続
      cfg.i2c_port = I2C_NUM_0;
      cfg.pin_sda = GPIO_NUM_15;
      cfg.pin_scl = GPIO_NUM_16;
      cfg.pin_rst = -1;
      cfg.freq = 400000;
      cfg.i2c_addr = 0x5D;  // 0x5D , 0x14
      _touch_instance.config(cfg);
      _panel_instance.setTouch(&amp;_touch_instance);
    }

    setPanel(&amp;_panel_instance);
  }
};
</code></pre>

<p>Sry for missing <code>&lt;code&gt;</code> i cant add it, dont know how.</p>

<p><img src="https://forum.elecrow.com/uploads/editor/pk/pjo6kugizd0l.jpg" alt="" title="" /><br />
<img src="https://forum.elecrow.com/uploads/editor/do/aiskalnaf9vh.jpg" alt="" title="" /></p>
]]>
        </description>
    </item>
   </channel>
</rss>
