MCUfriend UNO shield on MEGA2560

I have a 3.5" MCUfriend TFT shield for Arduino UNO. The ID reads 0x7796 when I run the id sketch.
My current project uses a MEGA2560 and also a DS3231 RTC in my project. Having no other touch-enabled screen specifically built for the MEGA, I had to use this UNO tft shield. I used M-F cables to avoid stacking the TFT on top of the Arduino MEGA. Instead I fixed it alonside the MEGA board.
My issue is the screen is really SLOW on the Arduino MEGA. So, I need to remap the tft pins to get it to run faster but don't know how to do that.
Any help would be welcome.

Photos attached below.

There is a recent thread

Although the Mega2560 is about 1/3 the speed of a Uno most Apps' performance depend on updating the minimal areas of the screen.

You can access the SDA, SCL, 5V, GND with male angle pins with the Shield in place.

David.

Hi David.

Thank you for answering. I did the connections as per your instructions, that is:
"LCD_D0 - LCD_D7 go to D22 - D29 on the Mega, LCD_RD . LCD_RST go to A0 - A4 on the Mega. GND to GND. 3.3V to 3.3V. 5V to 5V."

Some more questions:

  1. Inside the mcufriend_special.h file I uncomment the #define USE_MEGA_8BIT_PROTOSHIELD. Correct?
  2. Where do I put the USE_SPECIAL part?
  3. What else do I do?

Regards,
John

David, hi.

This is an update to previous post.
So, I got it up and running.

  1. Uncommented the "#define USE_SPECIAL" in mcufriend_shield.h
  2. Likewise the "#define USE_MEGA_8BIT_PROTOSHIELD" in mcufriend_special.h

So this UNO tft shield runs on the MEGA2560 really FAST!
I will observe your suggestion for building a protoshield for the MEGA2560 for a more rigid and reliable connection between Arduino and tft shield. But for the moment still runs using the ribbon cable, which proves all is ok.

Thanks again.

John

I do not want to make SPECIALs too easy. After all, the library is intended for plug-and-go shields.

The how_to file does explain the procedure but I would appreciate any improvement to the words.
What did you find difficult?

You should see how fast these displays can work with an Xmega or Cortex-M4

David.

Just when I thought I'd go on with the sketch, there seems to exist one more problem: The touch screen feature doesn't work. I set the pins in the sketch as:

YP=55, XM=56, YM=7, XP=6

Any suggestions, please?

John

Think about it.

If YM=7 was on the Uno (LCD_D7) it will have moved to 29 on the 18x2 header.
I have no idea what YP=55 was. If it was A1 on the Uno it is probably still A1

David.

David,

You are right. These are shared pins between the TFT screen and the touch interface. So for this mod with the MEGA2560 i have set:

XP=28, XM=A2, YP=A1, YM=29

and everything works fine now. :slight_smile:

Thanks for this one, too.

John

David,

Some feedback for your mcufriend_how_to.txt as per your request: "I would appreciate any improvement to the words. What did you find difficult?"

Well, in the text, there is no instruction for "Remapping pins" and the only relevant is instruction No 17; but that one goes: "If you do not have a standard Uno Shield..."; I took it, this isn't my case; Shield was standard, but the use wasn't. Then I thought it would be a good idea to ask you.
Would you consider adding an instruction for the "UNO shield on MEGA with remapped pins" case? More people may find that useful.
I suppose you don't encourage improvised use of the shields but in my case I needed the touch function with some speed and was so glad to see it works fast after the remapping!
So, as far as I'm concerned, the remapping "experiment" is acceptable practice. After all, Arduino is about creating and experimenting!

Thanks again and regards,
John