Page 1 of 1

Connect ESP32-S3 to the graphics chip BT815Q via SPI

Posted: Mon Oct 23, 2023 9:25 am
by RobertWood
Hello there,

I'd like to connect the ESP32-S3 to the BT815Q graphics chip from Bridgetek.

For this, I'm following the instructions in the manual: https://brtchip.com/wp-content/uploads/ ... -Guide.pdf

I'm also referring to the code example for Arduino: https://github.com/MatrixOrbital/EVE3-B ... Eve2_81x.c

I've connected the chip and the monitor via SPI, and I can read the Chip ID. This suggests that the hardware is working correctly.

However, I'm not getting anything more from the display. It doesn't display my image or provide any backlight.

Here's my main:

Code: Select all

void app_main() {
    esp_err_t ret;

    ret = spi_bus_initialize(HSPI_HOST, &buscfg, SPI_DMA_CH_AUTO);
    if (ret != ESP_OK) {
        printf("Error bei der Initialisierung des SPI-Busses: %s (Fehlercode: 0x%x)\n", esp_err_to_name(ret), ret);
    }

    spi_device_handle_t spi;
    ret = spi_bus_add_device(HSPI_HOST, &devcfg, &spi);
    if (ret != ESP_OK) {
        printf("Error beim Hinzufügen der SPI Geräte: %s\n", esp_err_to_name(ret));
    }

    uint32_t chipID = readChipID(spi);
    printf("Chip ID: 0x%08lx\n", (unsigned long)chipID);

    host_command(spi, HCMD_CLKEXT);  // Host-Befehl "CLKEXT"
    host_command(spi, CMD_CLKSEL);  // Host-Befehl "CLKSEL"
    host_command(spi, HCMD_ACTIVE);  // Host-Befehl "ACTIVE"
    host_command(spi, CMD_RST_PULSE);  // Host-Befehl "RST_PULSE"
    while (0x0 != rd16(spi, REG_CPURESET));  //Check if EVE is in working status.

    wr32(REG_FREQUENCY, 0x3938700, spi);

    wr16(REG_HCYCLE, 928, spi);
    wr16(REG_HOFFSET, 88, spi);
    wr16(REG_HSYNC0,   0, spi);
    wr16(REG_HSYNC1,  48, spi);
    wr16(REG_VCYCLE, 525, spi);
    wr16(REG_VOFFSET, 32, spi);
    wr16(REG_VSYNC0,   0, spi);
    wr16(REG_VSYNC1,   3, spi);
    wr8(REG_SWIZZLE,   0, spi);
    wr8(REG_PCLK_POL,  1, spi);
    wr8(REG_CSPREAD,   0, spi);
    wr16(REG_HSIZE,  800, spi);
    wr16(REG_VSIZE,  480, spi);

    /* Write first display list to display list memory RAM_DL*/
    wr32(RAM_DL+0,CLEAR_COLOR_RGB(0,0,0), spi);
    wr32(RAM_DL+4,CLEAR(1,1,1), spi);
    wr32(RAM_DL+8,DISPLAY(), spi);
    wr8(REG_DLSWAP,0x02, spi);//display list swap

    wr8(REG_DLSWAP,0x02, spi);//display list swap
    /* Enable backlight of display panel */
    wr16(REG_GPIOX_DIR, 0xffff, spi);
    wr16(REG_GPIOX, 0xffff, spi);

    wr8(REG_PCLK,2, spi);    

    wr32(RAM_DL + 0, CLEAR(1, 1, 1), spi); // clear screen
    wr32(RAM_DL + 4, BEGIN(BITMAPS), spi); // start drawing bitmaps
    wr32(RAM_DL + 8,  VERTEX2II(220, 110, 31, 'T'), spi); // ASCII T in font 31
    wr32(RAM_DL + 12, VERTEX2II(244, 110, 31, 'E'), spi); // ASCII E in font 31
    wr32(RAM_DL + 16, VERTEX2II(270, 110, 31, 'X'), spi); // ASCII X in font 31
    wr32(RAM_DL + 20, VERTEX2II(299, 110, 31, 'T'), spi); // ASCII T in font 31
    wr32(RAM_DL + 24, END(), spi);
    wr32(RAM_DL + 28, COLOR_RGB(160, 22, 22), spi); // change colour to red
    wr32(RAM_DL + 32, POINT_SIZE(320), spi); // set point size to 20 pixels in radius
    wr32(RAM_DL + 36, BEGIN(POINTS), spi); // start drawing points
    wr32(RAM_DL + 40, VERTEX2II(192, 133, 0, 0), spi); // red point
    wr32(RAM_DL + 44, END(), spi);
    wr32(RAM_DL + 48, DISPLAY(), spi); // display the image

    spi_bus_remove_device(spi);
    spi_bus_free(HSPI_HOST);
}

I'm attaching the complete file and the header file for reference.

Re: Connect ESP32-S3 to the graphics chip BT815Q via SPI

Posted: Wed Oct 25, 2023 8:24 am
by RobertWood
<<--