Reassign TFT digital pins for Mega

Hello, I have been searching the internet, with no luck, trying to figure out if it is possible to change the default digital pins for my TFT screen.

I'm using this screen, and I have had success programming it with the MCUFRIEND_KBV and the Adafruit_GFX.h header files. I very new to all this so I started with the screen on my uno then later the mega. I used the same pins on both boards (A0-A4 for RD,WR,RS, and CS) and (D2-D9 for the LCD pins) however when using these pins I noticed the mega framerate is slower than the uno, I read the reason for this once but I forgot the specifics.
I would like to change the mega pins from D2-D9 to D22-D29, Has anyone had experience with this before? Or maybe can point me in the right direction?

Your link shows a 240x400 Mcufriend Shield with ST7793 controller.

Original Mcufriend shields had an onboard LDO regulator for the backlight. The link pcb has no LDO regulator. This is WRONG because the Arduino 3.3V pin on Uno or Mega can only supply 50mA.

There is a SPECIAL that comes with MCUFRIEND_kbv
Read the how_to file. Enable USE_SPECIAL and USE_MEGA_8BIT_PROTOSHIELD if you just move data bus to D22-D29

Enable USE_SPECIAL and USE_MEGA_8BIT_SHIELD if you want data bus on D22-D29 and control lines on D38-D41, D43

David.

Perfect! This is exactly what I was looking for. For any other noobs out there I enabled USE_SPECIAL in mcufriend_shield.h and USE_MEGA_8BIT_PROTOSHIELD in mcufriend_special. Then I wired the screen like:

MEGA LCD
22.............................LCD_D0
23.............................LCD_D1
24.............................LCD_D2
25.............................LCD_D3
26.............................LCD_D4
27.............................LCD_D5
28.............................LCD_D6
29.............................LCD_D7

I left the remaining pins connected to the same pins as on the uno.

Hey guys, I have to say thank you about this posts! I'm pretty new to arduino (did some things with microcontrollers 20 years ago) and searched really a lot (include reading the code from david), but this brings it EASY to work properly! Now I have D2 and D3 free for hardware interrupt :slight_smile:

Thanks, also for the great work on the TFT driver library. Amazing.

btw, I'm using a 3,5" 8-bit tft shield with ILI9486 chip on a MEGA2560.

greets from bavarian forest!