Configure lcd controller into 8080 mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Configure lcd controller into 8080 mode

1,172 Views
alvenwu
Contributor I

 I am using the i.MX 6ULL Applications Processor, seems on this chip , we don't need to use the flexbus to communicate with the oled controller. and we can just configure LCD controller into 8080 to control the SSD1322 controller.

Here is my configuration: 

1. Enable the pix-clock bit in CCM regiseter and reset the clock

static void Oled_ControllerReset(void)
{
    volatile uint32_t i = 0x100;
    /* Disable the clock gate. */
    gsOledReg->CTRL_CLR = LCDIF_CTRL_CLKGATE_MASK;
    /* Confirm the clock gate is disabled. */
    while (gsOledReg->CTRL & LCDIF_CTRL_CLKGATE_MASK);
    /* Reset the block. */
    gsOledReg->CTRL_SET = LCDIF_CTRL_SFTRST_MASK;
    /* Confirm the reset bit is set. */
    while (!(gsOledReg->CTRL & LCDIF_CTRL_SFTRST_MASK));
  
    /* Delay for the reset. */
    while (i--);
  
    /* Bring the module out of reset. */
    gsOledReg->CTRL_CLR = LCDIF_CTRL_SFTRST_MASK;
   
    /* Disable the clock gate. */
    gsOledReg->CTRL_CLR = LCDIF_CTRL_CLKGATE_MASK;
}

2. Configure the LCD ctrl register

   /* CTRL DATA SELECT CONFIG*/
    /* CTRL READ_WRITE SELECT */
    /* CTRL BYPASS COUNT SELECT */
    /* CTRL BUSY PIN DISABLE*/
    gsOledReg->CTRL = (LCDIF_CTRL_READ_WRITEB(0)) | (LCDIF_CTRL_BYPASS_COUNT(0))
                       |(LCDIF_CTRL_DATA_SELECT(0)) | (LCDIF_CTRL_LCD_DATABUS_WIDTH(0x1U))
                       |(LCDIF_CTRL_WORD_LENGTH(0x1U)) | (LCDIF_CTRL_MASTER(0x1U))
                       | (LCDIF_CTRL_RUN_MASK);
   
    /* CTRL1 8080 MODE SELECT */
    gsOledReg->CTRL1_CLR = LCDIF_CTRL1_MODE86_MASK;

   /* LCD TIMING REGISTER CONFIG*/

    gsOledReg->TIMING = LCDIF_TIMING_DATA_SETUP(0x1U) | LCDIF_TIMING_DATA_HOLD(0x1U)
                         | LCDIF_TIMING_CMD_SETUP(0x1U) | LCDIF_TIMING_CMD_HOLD(0x1U); 

3. write data function: 

void Oled_WriteData(uint8_t data)
{    
     /*output cs signal*/
     GPIO_WritePinOutput(OLED_CS_GPIO_PORT, OLED_CS_GPIO_PIN, kGPIO_Low);
    
     gsOledReg->CTRL_SET = LCDIF_CTRL_DATA_SELECT_MASK;
     /*send data to LCDIF_DATA register*/
     gsOledReg->DATA = LCDIF_DATA_DATA_ZERO(data);
       
     /*output cs signal*/
     GPIO_WritePinOutput(OLED_CS_GPIO_PORT, OLED_CS_GPIO_PIN, kGPIO_High);    
}

However , could anyone check if it is correct?  

And I am rather confusing about the description on reference manual. Do we need to set "run" bit and "master" bit in  8080 mode ?     what about set the DATA_SHIFT_DIR and SHIFT_NUM_BITS ??

Labels (1)
0 Kudos
3 Replies

907 Views
alvenwu
Contributor I

Could anyone offer some help ? thanks a lot.

0 Kudos

907 Views
jimmychan
NXP TechSupport
NXP TechSupport
0 Kudos

907 Views
alvenwu
Contributor I

Could anyone give me any suggestion ?  

how to configure the display clock?

0 Kudos