cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Data to TFT/LCD via FMC fails

MGuth.1
Associate III

Hi

I'm struggling with a TFT Display and a Nucleo U575 board. The Display is a 320x240px Display that I want to control with a 16 bit FMC interface.

As the Display doesn't show anything, I connected my Logic analyzer to the Nucleo's FMC Pins.

Result: It seems, that the commands (8-bit) are sent correctly to the TFTs D0:D7 pins. However when I try to send data (e.g. a 16 bit color) to the display it's also just D0:D7 that turn high/low. D8:D15 are always low when data is sent and are always high wen nothing is sent.

I followed this guide by NickNagy on github. He's using a 8-bit interface. However I changed to the 16-bit command for sending data and I can't find the mistake I obviously made.

Can someone help me please? :sleepy_face:

I uploaded the code to my github

Thanks a lot in advance!

16 REPLIES 16

I'm not quite sure if I got the things you mean as I'm quite new to the Cube environment, but I hope I found the correct data 🙂 If not, please let me know...

0693W00000Nqo0MQAR.jpg0693W00000Nqo0CQAR.jpg

Dbl-checked your gpio for control and you have them correct. At least they're same as the FMC example I've passed earlier, of which I know works flawlessly.

 PD4  ------> FMC_NOE/RD

 PD5  ------> FMC_NWE/WR

 PD13 ------> FMC_A18/RS

 PD7  ------> FMC_NE1/CS

 PE2  ------> FMC_RESET

//Confirmed correct.

Really running out of ideas here. Other than perhaps the hardware side of things; those display can be naughty and requires trial & error if not documented, particularly on the pullups/pulldown of pins, some requires to be floating.

Try leaving the SDO pin floating (required on mine here). It bugs me to know that Nucleo/Code side works when scoping the lines, but not when the display is hardwired.

thanks for your time and effort you're putting into this! I highly appreciate it!

Sorry, I missed that. I kept SDO floating as I was instructed to by the manual. But for every other pin that I'm not using I put them to GND (in the manual it says GND or IOVCC).

I think you got me wrong here: When scoping the lines, I don't get valid data:

  • lines 0-7 are oscillating in a way. However I can't find the correct bit sequence (e.g. 00010001 for the command sleepout) but different "random" values.
  • lines 8-15 are always low. When sending a command this might be right as it's an 8-bit command, but they are also low when sending (16-bit) data. Doesn't matter if I send 0xFFFF or 0x00 the output for lines 8-15 are always scoped low.

That's why I was wondering about the address...

When HAL starts misbehaving (rare mind you) I turn to registers and painfully hardcode the thing from scratch. Never done it for the FMC interface though.

I still swear by the GPIO bus sent earlier, over FMC anyway 🙂

Keep us updated about what it was. gl man

Oh and that 16bits gpio really starts to be half-fun on that ST7789 when this:

0693W00000Nqo2SQAR.jpg

I was told that FMC is much more efficient compared to GPIO Bus. Also I plan to use FMC along with DMA to reduce ​the processor load even more and hence improve battery life for the final product 😉

Back to topic: I don't know what I changed - I didn't change anything at all 😅 but: I connected the logic analyzer once again to get any hint for the problem. And somehow all 16 lines work perfectly now! 😍

I then wired up the LCD again and it at least shows some weird grey pixels. ​0693W00000Nqo6KQAR.jpg

I think the missing link is the timing settings for now. I'll try and hope it won't get worse again 😉

Thanks to both of you for your help today!! I'll update the post as soon as there are news to share :)​

MGuth.1
Associate III

Gooood news!

The screen is running now! It shows different colors and I'm even able to display a jpg image that I converted to a hex-array 😍

As I said above, I can't really tell what made the FMC work.It just worked from one second to the other.

After adjusting the timing settings, everything is displayed correctly on the LCD.

Things to do:

  • optimize the functions to manipulate the screen. e.g. drawing squares, circles, lines, ... in different colors
  • adjust gama settings and so on as the colors shown right now are not really what they should look like
  • add DMA support to decrease processor load

For everyone who's in trouble like I was: feel free to check out the Github repo. I'll continue to work on it until it works properly 🙂

Thanks again @Mecanix​ and @Community member​ for your help!