cancel
Showing results for 
Search instead for 
Did you mean: 

FMC interfacing lcd screen minor issue

SMour.1
Associate III

I have nearly managed to interface one lcd screen(ili9341 16bit parallel fmc intel 8080 protocol) with my stm32 device but I am stuck at the very last step.I have connected the screen wires to the mcu , I have configured fmc from cube mx correctly , I have wrote correct two functions for send_command(uint16_t) and send_data(uint16_t), I also run some initialization code (something like 80 lines of commands with data for initial configuartions) from the lcd manufacturer and it seems to work as the outcome is a greyish pixeled screen instead of the original white of the backlight. The next step on my process was to fill the screen whith a random color but the code bellow fails to do it!

send_command(0x2A); //configure width 
        uint16_t y=320;
        send_data(0);
        send_data(0);
        send_data(y>>8);
        send_data(y);
        uint16_t x=240;
        send_command(0x2B); // configure height
        send_data(0x00);
        send_data(0x00);
        send_data( x>>8);
        send_data(x);
        send_command(0x2C); //send data
 
        for(unsigned i =0;i<320*240;i++){
            send_data(0x0f0f); //random rgb565 color
        }

Any advice?

1 ACCEPTED SOLUTION

Accepted Solutions

> I am using an stm32h7

Make sure the FMC falls into area which is tagged as Device in MPU.

JW

View solution in original post

4 REPLIES 4

Use LA to observe data/control signals on the display's pins.

JW

SMour.1
Associate III

Thanks for the response @Community member​ it is quite difficult to monitor a 20 pin protocol but I quite managed to monitor 4 pins (RS , CS , WR , and one random data line) while I was constantly sending data 0xffff(image bellow) . But I think I found something more critical , from the initialization code I tried to remove all the `send_data` lines and the results on the screen was exactly the same! I can interpret that as follows: the send_data command does not work and also some initialization commands worked as they didn't require any data and some others didn't but those that worked made the screen to look like it was responding correct.

That's kind of good news because I wasn't very sure for my send_data command , I am using an stm32h7 with the fmc peripheral set at default values for mostly anything and also `Chip select pin = N1` and `LCD Register select=A16` from cubemx. Then with the configurations above I thought:

static constexpr uint32_t LCD_CMD  = (uint32_t) 0X60000000;
    static constexpr uint32_t LCD_DATA = (uint32_t) 0X60020000;

These address is probably wrong for the data but what is more curious is that the LA shows some data is transmitting on the data line if I do

while(true) send_data(0xffff);

0693W00000CzlzLQAR.png

> I am using an stm32h7

Make sure the FMC falls into area which is tagged as Device in MPU.

JW

SMour.1
Associate III

@Community member​  Thank you so so so so so much , that little (and kind of cryptic :squinting_face_with_tongue: ) message helped a lot it worked on my first trial , I 'll leave this link here as a reference as I don't like removing duplicate questions https://community.st.com/s/question/0D50X00009XkWQESA3/stm32h743ii-fmc-8080-lcd-spurious-writes