cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting LCD to FMC

MNapi
Senior III

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);

0693W00000bhPNsQAM.png 

1 ACCEPTED SOLUTION

Accepted Solutions
MNapi
Senior III

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

0693W00000bhQkiQAE.png 

View solution in original post

6 REPLIES 6

0x40000 offset looks correct for A16 address bit in 16-bit mode

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MNapi
Senior III

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.

You could always write to an address spanning the boundary and view on a scope or logic analyzer

Perhaps 0x20000, pretty sure not 0x8000

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

> 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

MNapi
Senior III

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

0693W00000bhQkiQAE.png 

Where did you find that bit explanation table?