I have a 3.5" MCUfriend TFT shield for Arduino UNO with ILI9486.
My project use an Arduino Mega2560 and another shield (motor driver Dual max14870), So I need to remap the tft pins for this project.
then I have modified mcufriend_shield.h uncommented the "#define USE_SPECIAL" and likewise
modificate mcufriend_special.h and uncommented "#define USE_MEGA_8BIT_PROTOSHIELD"
Pin remaping:
LCD_D0 22
LCD_D1 23
LCD_D2 24
LCD_D3 25
LCD_D4 26
LCD_D5 27
LCD_D6 28
LCD_D7 29
LCD_RD A2
LCD_ WR A3
LCD_RS A4
LCD_CS A5
LCD_RST A6
When i run "graphictest_kbv" this works perfect. But when i run "button_simple" the button not work.
Then i run "TouchScreen_Calibr_native" and appears the next message (Attached image):
Touch Calibration FAILED
Unable to read the position of the press. This is a
hardware issue and can not be corrected in software.
check XP,XM pins with a multimeter
CheckYP, YM pins with a multimeter
should be about 300ohms
I thought the touch pins were broken, so I undid the changes on mcufriend_special.h and mcufriend_shield.h and rewired with original pins (A0,A1,A2,A3,A4 and 2 to 9)
I ran "TouchScreen_Calibr_native" and to my surprise it worked , "button_simple" too .
Any ideas how to fix this? I can't get the touch work, with the pins remapped
![]()
In case it is necessary here I paste the result of "LCD_ID_readreg":
Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)
reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 54 80 66 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 66 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 93 30 93 30 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 02 02 3B 3B Display Control
reg(0x00B7) 00 06 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 0E 0E 0E 0E 0E 0E 0E 0E Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 04 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 00 NVM Read
reg(0x00D3) 00 00 94 86 ILI9341, ILI9488
reg(0x00D4) 00 00 00 00 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 80 RDID2
reg(0x00DC) 00 66 RDID3
reg(0x00E0) 00 0F 21 1C 0B 0E 08 49 98 38 09 11 03 14 10 00 GAMMA-P
reg(0x00E1) 00 0F 2F 2B 0C 0E 06 47 76 37 07 11 04 23 1E 00 GAMMA-N
reg(0x00EF) 00 80 00 10 60 40 ILI9327
reg(0x00F2) 00 18 A3 12 02 B2 12 FF 10 00 00 00 Adjust Control 2
reg(0x00F6) 00 54 80 66 Interface Control
Here the result of "diagnose_TFT_support"
tft.readID() finds: ID = 0x9486
MCUFRIEND_kbv version: 2.9.8
PORTRAIT is 320 x 480
Thanks



