2023-04-03 05:28 AM
I checked a few manuals. RM0432 explains memory mapping but it does not mention how to connect LCD, what address to send data and command. I have 800 x 480 pixel LCD with 16 bit data bus.
I think the problem might be with the address to send command and data. I am using STM32L4Q5RGT6
this is I am trying to send command
*(__IO uint32_t *)(0x60000000) = command;
for data;
*(__IO uint32_t *)(0x60040000) = data;
there is something wrong with the address or maybe it should be
*(__IO uint16_t *)(0x60040000) = data;
this is the beginning of LCD initialization:
LCD_WR_REG(0xF000); LCD_WR_DATA(0x55);
LCD_WR_REG(0xF001); LCD_WR_DATA(0xAA);
LCD_WR_REG(0xF002); LCD_WR_DATA(0x52);
LCD_WR_REG(0xF003); LCD_WR_DATA(0x08);
LCD_WR_REG(0xF004); LCD_WR_DATA(0x01);
Solved! Go to Solution.
2023-04-03 11:44 AM
With more help we are getting close.
I think that it should be for data
*(__IO uint32_t *)(0x6C020000) = data;
0110 1100 0000 0010 000 0000 0000 00000
I found this but I wonder if each STM32 has the same address mapping for FMC
2023-04-03 05:38 AM
0x40000 offset looks correct for A16 address bit in 16-bit mode
2023-04-03 07:04 AM
I am checking all data sheets and I think that it might be
*(__IO uint32_t *)(0x60008000) = data;
for data if I use A16 for LCD register
The LCD might be broken, I got it from eBay. So I want to make sure that at lest this part is fine.
2023-04-03 07:15 AM
You could always write to an address spanning the boundary and view on a scope or logic analyzer
Perhaps 0x20000, pretty sure not 0x8000
2023-04-03 10:37 AM
> 0x40000 offset looks correct for A16 address bit in 16-bit mode
Yes, but for FSMC_NE4 the base is not 0x6000'0000 but 0x6C00'0000.
JW
2023-04-03 11:44 AM
With more help we are getting close.
I think that it should be for data
*(__IO uint32_t *)(0x6C020000) = data;
0110 1100 0000 0010 000 0000 0000 00000
I found this but I wonder if each STM32 has the same address mapping for FMC
2023-06-16 01:25 PM
Where did you find that bit explanation table?