Hi
I'm using a Riverdi EVE3 5"LCD display,
The code is provided from them and then used with modification.
https://github.com/riverdi/riverdi-eveI use for development is Mikroe RA4M1 Clicker,
(Renesas 32-bit ARM Cortex-M4 R7FA4M1AB3CFM MCU 48 MHz)
On the Mikroe RA4M1 Clicker development board,
when I use App_Common_Init(&host) to initialize the display,
it will be normal and the background will have the desired color.
When Itransfer the same code to a new MCU (Renesas 32-bit ARM Cortex-M4 R7FA6M1AD3CFP MCU 120 MHz)
This will not display properly.
SPI and clock settings are as shown below.
Thank so much.
void hal_entry(void)
{
phost = &host;
init_eve_spi_master();
App_Common_Init(&host);
APP_PRINT ("\r\n ** App_Common_Init OK ** \r\n");
}
void App_Common_Init(Gpu_Hal_Context_t *phost) {
Gpu_Hal_Open(phost);
Gpu_Hal_Powercycle(phost,TRUE);
uint8_t chipid;
Gpu_HostCommand(phost,GPU_EXTERNAL_OSC);
Gpu_HostCommand(phost,GPU_PLL_24M);
Gpu_HostCommand(phost,GPU_ACTIVE_M);
Gpu_Hal_Sleep(300);
chipid = Gpu_Hal_Rd8(phost, REG_ID);
while(chipid != 0x7C)
{
chipid = Gpu_Hal_Rd8(phost, REG_ID);
Gpu_Hal_Sleep(100);
}
/* read REG_CPURESET to confirm 0 is returned */
{
uint8_t engine_status;
/* Read REG_CPURESET to check if engines are ready.
Bit 0 for coprocessor engine,
Bit 1 for touch engine,
Bit 2 for audio engine.
*/
engine_status = Gpu_Hal_Rd8(phost, REG_CPURESET);
while(engine_status != 0x00)
{
engine_status = Gpu_Hal_Rd8(phost, REG_CPURESET);
Gpu_Hal_Sleep(100);
}
}
Gpu_Hal_Wr16(phost, REG_PWM_HZ, 750);
Gpu_Hal_Wr8(phost, REG_PWM_DUTY, 20);
//uint16_t pwmHz = Gpu_Hal_Rd16(phost, REG_PWM_HZ);
Gpu_Hal_Wr32 (phost, REG_FREQUENCY, 0x3938700);
Gpu_Hal_Wr16(phost, REG_HCYCLE, DispHCycle);
Gpu_Hal_Wr16(phost, REG_HOFFSET, DispHOffset);
Gpu_Hal_Wr16(phost, REG_HSYNC0, DispHSync0);
Gpu_Hal_Wr16(phost, REG_HSYNC1, DispHSync1);
Gpu_Hal_Wr16(phost, REG_VCYCLE, DispVCycle);
Gpu_Hal_Wr16(phost, REG_VOFFSET, DispVOffset);
Gpu_Hal_Wr16(phost, REG_VSYNC0, DispVSync0);
Gpu_Hal_Wr16(phost, REG_VSYNC1, DispVSync1);
Gpu_Hal_Wr8(phost, REG_SWIZZLE, DispSwizzle);
Gpu_Hal_Wr8(phost, REG_PCLK_POL, DispPCLKPol);
Gpu_Hal_Wr16(phost, REG_HSIZE, DispWidth);
Gpu_Hal_Wr16(phost, REG_VSIZE, DispHeight);
Gpu_Hal_Wr16(phost, REG_CSPREAD, DispCSpread);
Gpu_Hal_Wr16(phost, REG_DITHER, DispDither);
/* after this display is visible on the LCD */
Gpu_Hal_Wr8(phost, REG_DLSWAP, DLSWAP_FRAME);
/* GPIO configuration */
Gpu_Hal_Wr8(phost, REG_GPIO_DIR,0xff);
Gpu_Hal_Wr8(phost, REG_GPIO,0xff);
Gpu_Hal_Wr8(phost, REG_PCLK,DispPCLK);
Gpu_ClearScreen(phost);
phost->cmd_fifo_wp = Gpu_Hal_Rd16(phost,REG_CMD_WRITE);
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(23, 213, 255));
App_WrCoCmd_Buffer(phost, CLEAR(1, 1, 1));
App_WrCoCmd_Buffer(phost, DISPLAY());
}