ESP32-S3 LCD and I2S FULL documentation

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Mon Dec 06, 2021 11:00 pm

Hi @ESP_Sprite,

How to set hw_lcd peripheral in 8 bits mode and in 16 bits mode in internal fifo ?
My io bus is 8 bits mode.

Example: spi microchip.

Code: Select all

inline void spi1_change_mode_8_bits() 
{  
    //SPI1CONbits.MODE16 = 0;  // 8 bits mode.   
    SPI1CONCLR = _SPI1CON_MODE16_MASK;
}

inline void spi1_change_mode_16_bits() 
{   
    //SPI1CONbits.MODE16 = 1;  // 16 bits mode.     
    SPI1CONSET = _SPI1CON_MODE16_MASK;    
}
Thank's.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby ESP_Sprite » Tue Dec 07, 2021 6:40 am

You'll need to define that question a bit better as I don't speak Microchip, sorry.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 7:59 am

I used microchip as an example to facilitate your understanding and also because i made an lcd driver this way and it works very well.
I imagine that espressif hardware may be a bit similar somehow.
The problem is really the lack of documentation from espressif, which launches a product, but without documentation.
And i need to reverse engineer the esp-idf to try to understand how the hardware works.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 8:11 am

My io bus is 8 bits wide.

I need to send lcd command in 8 bits too.
Example:
8 bits mode with fifo mode or dma mode
Send 0x2a command
Send 0x45, 0x54, 0x67, 0x78 command param
Send 0x2b command
Send 0x56, 0x52, 0x23, 0x12 command param
Send 0x2c command
Switch to 16 bits
Send pixels in 16 bits mode with dma.

Hardware lcd peripheral have fifo ?
Size of this fifo ? How i can verify if it is full at tx transfer ?
How to switch from fifo mode to dma mode ?
How to switch from dma mode to fifo mode ?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby ESP_Sprite » Tue Dec 07, 2021 10:04 am

From what I can tell, LCD_CAM_LCD_2BYTE_EN selects between 16 and 8-bit modes. (Suggest you look at components/soc/esp32s3/include/soc/lcd_cam_reg.h if you're looking for data like that, the file has comments.) I don't think we have a FIFO you can manually put bytes into.

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 5:24 pm

Are you sure this bit switches between 8 bit mode and 16 bit mode ?

lcd_cam_struct.h

Code: Select all

/** lcd_2byte_en : R/W; bitpos: [23]; default: 0;
  *  1: The bit number of output LCD data is 9~16.  0: The bit number of output LCD data
  *  is 0~8.
  */
uint32_t lcd_2byte_en: 1;

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 5:47 pm

ESP_Sprite wrote:
Tue Dec 07, 2021 10:04 am
From what I can tell, LCD_CAM_LCD_2BYTE_EN selects between 16 and 8-bit modes. (Suggest you look at components/soc/esp32s3/include/soc/lcd_cam_reg.h if you're looking for data like that, the file has comments.) I don't think we have a FIFO you can manually put bytes into.
I need to know if the tx fifo is full, otherwise, how will I know if I can continue sending bytes to the peripheral lcd hardware ?

lcd_cam_struct.h

Code: Select all

// FIFO related stuf.

/** lcd_afifo_threshold_num : R/W; bitpos: [5:1]; default: 11;
  *  The awfull threshold number of lcd_afifo.
  */
uint32_t lcd_afifo_threshold_num: 5;

/** lcd_afifo_reset : WO; bitpos: [27]; default: 0;
  *  LCD AFIFO reset signal.
  */
uint32_t lcd_afifo_reset: 1;

/** cam_stop_en : R/W; bitpos: [0]; default: 0;
  *  Camera stop enable signal, 1: camera stops when DMA Rx FIFO is full. 0: Not stop.
*/
uint32_t cam_stop_en: 1;
        
/** cam_afifo_reset : WO; bitpos: [31]; default: 0;
  *  Camera AFIFO reset signal.
  */
uint32_t cam_afifo_reset: 1;

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 6:11 pm

what is the function of these bits ?
who is lcd_st[2:0] ?

Code: Select all

/** lcd_cd_data_set : R/W; bitpos: [28]; default: 0;
   *  1: LCD_CD = !reg_cd_idle_edge when lcd_st[2:0] is in LCD_DOUT state.  0: LCD_CD =
   *  reg_cd_idle_edge.
   */
uint32_t lcd_cd_data_set: 1;

/** lcd_cd_dummy_set : R/W; bitpos: [29]; default: 0;
  *  1: LCD_CD = !reg_cd_idle_edge when lcd_st[2:0] is in LCD_DUMMY state.  0: LCD_CD =
  *  reg_cd_idle_edge.
  */ 
uint32_t lcd_cd_dummy_set: 1;

/** lcd_cd_cmd_set : R/W; bitpos: [30]; default: 0;
  *  1: LCD_CD = !reg_cd_idle_edge when lcd_st[2:0] is in LCD_CMD state.  0: LCD_CD =
  *  reg_cd_idle_edge.
  */
uint32_t lcd_cd_cmd_set: 1;

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Tue Dec 07, 2021 11:18 pm

Hi,

I tried to change the state of LCD_CD pin of esp32-s3, but this way dont worked.
I uncommented "LCD_CAM.lcd_user.lcd_cmd = 1;" and it didn't work either.

Some suggestion ?

Code: Select all

void app_main(void)
{
    hw_lcd_init();

    while(1)
    {
        hw_lcd_set_data_command_pin( 0 );

        vTaskDelay( pdMS_TO_TICKS(500) );
        
        hw_lcd_set_data_command_pin( 1 );

        vTaskDelay( pdMS_TO_TICKS(500) );
    }
}


inline void hw_lcd_set_data_command_pin( bool d_c )
{
    //LCD_CAM.lcd_user.lcd_cmd = 1;  // R/W; bitpos: [26]; default: 0. 1: Be able to send command in LCD sequence when LCD starts. 0: Disable.
    
    LCD_CAM.lcd_misc.lcd_cd_cmd_set = d_c;  // R/W; bitpos: [30]; default: 0. 1: LCD_CD = !reg_cd_idle_edge when lcd_st[2:0] is in LCD_CMD state. 0: LCD_CD = reg_cd_idle_edge.
}

Baldhead
Posts: 468
Joined: Sun Mar 31, 2019 5:16 am

Re: ESP32-S3 LCD and I2S FULL documentation

Postby Baldhead » Wed Dec 08, 2021 1:07 am

I would like to understand how data/command pin and chip select pin are integrated into the esp32-s3 lcd module.

if there is such a thing as a hardware script.
Example:
chip select pin = 0; select external lcd "glass"
data command pin = 0; command
command value = 0x2A;
data command pin = 1; data
param value = 0x34;
param value = 0x56;
param value = 0x24;
param value = 0x18;
data command pin = 0; command
command value = 0x2B;
data command pin = 1; data
param value = 0x26;
param value = 0x31;
param value = 0x27;
param value = 0x12;
data command pin = 0; command
command value = 0x2C;
data command pin = 1; data
All data pixels.
start transfer;
chip select pin = 1; at the end of transfer. Deselect external lcd "glass"

Who is online

Users browsing this forum: No registered users and 38 guests