Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch not working #34

Open
Me-Phew opened this issue Dec 28, 2024 · 6 comments
Open

Touch not working #34

Me-Phew opened this issue Dec 28, 2024 · 6 comments

Comments

@Me-Phew
Copy link

Me-Phew commented Dec 28, 2024

I am using the default wiring pinout with a ILI9486 display. The screen is working correctly but for some reason no touch is ever detected. I have verified all pin numbers and connections. Also touch is actually working correctly without any wiring or pin number modifications using a different library made for Arduino framework.

Relevant part of sdkconfig

# TFT Configuration
CONFIG_ILI9486=y
CONFIG_INTERFACE_GPIO=y
CONFIG_WIDTH=320
CONFIG_HEIGHT=480
CONFIG_OFFSETX=0
CONFIG_OFFSETY=0
CONFIG_ENABLE_TOUCH=y
CONFIG_ADC_CHANNEL_YP=6
CONFIG_ADC_CHANNEL_XM=7
CONFIG_XP_GPIO_D6=y
CONFIG_XM_GPIO_RS=y
CONFIG_YP_GPIO_WR=y
CONFIG_YM_GPIO_D7=y
# end of TFT Configuration

Program startup log:

I (594) LCD_COM: LCD_CS_PIN=33
I (594) gpio: GPIO[33]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (604) LCD_COM: LCD_RS_PIN=15
I (614) gpio: GPIO[15]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (614) LCD_COM: LCD_WR_PIN=4
I (624) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (634) LCD_COM: LCD_RD_PIN=2
I (634) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (644) LCD_COM: LCD_D0_PIN=12
I (644) LCD_COM: LCD_D1_PIN=13
I (654) LCD_COM: LCD_D2_PIN=26
I (654) LCD_COM: LCD_D3_PIN=25
I (654) LCD_COM: LCD_D4_PIN=17
I (664) LCD_COM: LCD_D5_PIN=16
I (664) LCD_COM: LCD_D6_PIN=27
I (674) LCD_COM: LCD_D7_PIN=14
I (674) LCD_COM: INTERFACE is GPIO
I (674) gpio: GPIO[12]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (684) gpio: GPIO[13]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (694) gpio: GPIO[26]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (704) gpio: GPIO[25]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (714) gpio: GPIO[17]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (724) gpio: GPIO[16]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (734) gpio: GPIO[27]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 
I (744) gpio: GPIO[14]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (754) LCD_COM: LCD_RESET_PIN=32
I (754) gpio: GPIO[32]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (764) main_task: Returned from app_main()
I (964) ILI9486: Your TFT is ILI9486.Same as ST7796
I (964) ILI9486: Screen width:320
I (964) ILI9486: Screen height:480
I (1264) LCD_COM: _adc_yp=0 _adc_xm=1073448112
I (1264) LCD_COM: _gpio_xp=27 _gpio_xm=15
I (1264) TouchGetCalibration: Opening Non-Volatile Storage (NVS) handle...
I (1264) TouchGetCalibration: Opening Non-Volatile Storage (NVS) handle done
I (1274) TouchGetCalibration: nvs_get_i16(calibration)=4354
I (1284) TouchCalibration: TouchGetCalibration=0
I (547014) TouchCalibration: counter=0 _xp=1 _yp=1 xp=-32768 yp=32767
I (547034) TouchCalibration: counter=1 _xp=1 _yp=2 xp=1 yp=1

Could _adc_xm=1073448112 have sth to do with it? It doesn't really look correct.
The counter values shown at the end weren't actually caused by touch but rather by moving the cables which also seems strange.

@nopnop2002
Copy link
Owner

nopnop2002 commented Dec 31, 2024

This is my logging.

I (967) ILI9341: Your TFT is ILI9341
I (967) ILI9341: Screen width:240
I (967) ILI9341: Screen height:320
I (1267) LCD_COM: _adc_yp=0 _adc_xm=1073447984
I (1267) LCD_COM: _gpio_xp=12 _gpio_xm=15
I (1267) TouchGetCalibration: Opening Non-Volatile Storage (NVS) handle...
I (1267) TouchGetCalibration: Opening Non-Volatile Storage (NVS) handle done
I (1277) TouchGetCalibration: nvs_get_i16(calibration)=4354
I (1287) TouchCalibration: TouchGetCalibration=0
I (3637) TouchCalibration: counter=0 _xp=6591 _yp=992 xp=-32768 yp=32767
I (3647) TouchCalibration: counter=1 _xp=6618 _yp=999 xp=6591 yp=992
I (3657) TouchCalibration: counter=2 _xp=6635 _yp=1010 xp=6618 yp=992
I (3667) TouchCalibration: counter=3 _xp=6637 _yp=1017 xp=6635 yp=992
I (3677) TouchCalibration: counter=4 _xp=6646 _yp=1021 xp=6637 yp=992
I (3687) TouchCalibration: counter=5 _xp=6649 _yp=1021 xp=6646 yp=992
I (3697) TouchCalibration: counter=6 _xp=6656 _yp=1022 xp=6649 yp=992
I (3707) TouchCalibration: counter=7 _xp=6667 _yp=1022 xp=6656 yp=992
I (3717) TouchCalibration: counter=8 _xp=6668 _yp=1021 xp=6667 yp=992
I (3727) TouchCalibration: counter=9 _xp=6674 _yp=1022 xp=6668 yp=992
I (3737) TouchCalibration: counter=10 _xp=6683 _yp=1045 xp=6674 yp=992
I (3757) TouchCalibration: counter=11 _xp=6688 _yp=1050 xp=6683 yp=992
I (3767) TouchCalibration: counter=12 _xp=6686 _yp=1049 xp=6688 yp=992
I (3777) TouchCalibration: counter=13 _xp=6688 _yp=1048 xp=6688 yp=992
I (3787) TouchCalibration: counter=14 _xp=6686 _yp=1049 xp=6688 yp=992
I (3797) TouchCalibration: counter=15 _xp=6688 _yp=1048 xp=6688 yp=992
I (3807) TouchCalibration: counter=16 _xp=6686 _yp=1048 xp=6688 yp=992
I (3817) TouchCalibration: counter=17 _xp=6689 _yp=1047 xp=6688 yp=992
I (3827) TouchCalibration: counter=18 _xp=6688 _yp=1048 xp=6689 yp=992
I (3837) TouchCalibration: counter=19 _xp=6691 _yp=1050 xp=6689 yp=992
I (3847) TouchCalibration: counter=20 _xp=6698 _yp=1049 xp=6691 yp=992
I (3857) TouchCalibration: counter=21 _xp=6691 _yp=1048 xp=6698 yp=992
I (3867) TouchCalibration: counter=22 _xp=6692 _yp=1048 xp=6698 yp=992
I (3877) TouchCalibration: counter=23 _xp=6692 _yp=1046 xp=6698 yp=992
I (3887) TouchCalibration: counter=24 _xp=6696 _yp=1049 xp=6698 yp=992
I (3907) TouchCalibration: counter=25 _xp=6694 _yp=1047 xp=6698 yp=992
I (3917) TouchCalibration: counter=26 _xp=6692 _yp=1032 xp=6698 yp=992
I (3937) TouchCalibration: counter=27 _xp=6690 _yp=1022 xp=6698 yp=992
I (3947) TouchCalibration: counter=28 _xp=6692 _yp=1022 xp=6698 yp=992
I (3957) TouchCalibration: counter=29 _xp=6686 _yp=1022 xp=6698 yp=992
I (3967) TouchCalibration: counter=30 _xp=6688 _yp=1022 xp=6698 yp=992
I (3977) TouchCalibration: counter=31 _xp=6690 _yp=1022 xp=6698 yp=992
I (3987) TouchCalibration: counter=32 _xp=6693 _yp=1022 xp=6698 yp=992
I (3997) TouchCalibration: counter=33 _xp=6691 _yp=1021 xp=6698 yp=992
I (4007) TouchCalibration: counter=34 _xp=6689 _yp=1020 xp=6698 yp=992
I (4017) TouchCalibration: counter=35 _xp=6690 _yp=1019 xp=6698 yp=992
I (4027) TouchCalibration: counter=36 _xp=6688 _yp=1020 xp=6698 yp=992
I (4037) TouchCalibration: counter=37 _xp=6690 _yp=1016 xp=6698 yp=992
I (4047) TouchCalibration: counter=38 _xp=6692 _yp=1017 xp=6698 yp=992
I (4057) TouchCalibration: counter=39 _xp=6690 _yp=1018 xp=6698 yp=992
I (4067) TouchCalibration: counter=40 _xp=6691 _yp=1015 xp=6698 yp=992
I (4077) TouchCalibration: counter=41 _xp=6690 _yp=1015 xp=6698 yp=992
I (4087) TouchCalibration: counter=42 _xp=6691 _yp=1014 xp=6698 yp=992
I (4097) TouchCalibration: counter=43 _xp=6691 _yp=1011 xp=6698 yp=992
I (4107) TouchCalibration: counter=44 _xp=6691 _yp=1013 xp=6698 yp=992
I (4117) TouchCalibration: counter=45 _xp=6694 _yp=1014 xp=6698 yp=992
I (4127) TouchCalibration: counter=46 _xp=6696 _yp=1014 xp=6698 yp=992
I (4137) TouchCalibration: counter=47 _xp=6689 _yp=1015 xp=6698 yp=992
I (4147) TouchCalibration: counter=48 _xp=6692 _yp=1011 xp=6698 yp=992
I (4157) TouchCalibration: counter=49 _xp=6694 _yp=1013 xp=6698 yp=992
I (4167) TouchCalibration: counter=50 _xp=6694 _yp=1014 xp=6698 yp=992
I (4177) TouchCalibration: counter=51 _xp=6694 _yp=1012 xp=6698 yp=992
I (4187) TouchCalibration: counter=52 _xp=6697 _yp=1013 xp=6698 yp=992
I (4197) TouchCalibration: counter=53 _xp=6692 _yp=1014 xp=6698 yp=992
I (4207) TouchCalibration: counter=54 _xp=6690 _yp=1015 xp=6698 yp=992
I (4217) TouchCalibration: counter=55 _xp=6692 _yp=1015 xp=6698 yp=992
I (4227) TouchCalibration: counter=56 _xp=6693 _yp=1016 xp=6698 yp=992
I (4237) TouchCalibration: counter=57 _xp=6690 _yp=1014 xp=6698 yp=992
I (4247) TouchCalibration: counter=58 _xp=6694 _yp=1013 xp=6698 yp=992
I (4257) TouchCalibration: counter=59 _xp=6691 _yp=1015 xp=6698 yp=992
I (4267) TouchCalibration: counter=60 _xp=6688 _yp=1013 xp=6698 yp=992
I (4277) TouchCalibration: counter=61 _xp=6691 _yp=1014 xp=6698 yp=992
I (4287) TouchCalibration: counter=62 _xp=6690 _yp=1012 xp=6698 yp=992
I (4297) TouchCalibration: counter=63 _xp=6695 _yp=1015 xp=6698 yp=992
I (4307) TouchCalibration: counter=64 _xp=6693 _yp=1010 xp=6698 yp=992
I (4317) TouchCalibration: counter=65 _xp=6690 _yp=1019 xp=6698 yp=992
I (4327) TouchCalibration: counter=66 _xp=6698 _yp=1016 xp=6698 yp=992
I (4337) TouchCalibration: counter=67 _xp=6693 _yp=1015 xp=6698 yp=992
I (4347) TouchCalibration: counter=68 _xp=6694 _yp=1012 xp=6698 yp=992
I (4357) TouchCalibration: counter=69 _xp=6693 _yp=1015 xp=6698 yp=992
I (4367) TouchCalibration: counter=70 _xp=6696 _yp=1014 xp=6698 yp=992
I (4377) TouchCalibration: counter=71 _xp=6698 _yp=1014 xp=6698 yp=992
I (4387) TouchCalibration: counter=72 _xp=6698 _yp=1014 xp=6698 yp=992
I (4397) TouchCalibration: counter=73 _xp=6694 _yp=1016 xp=6698 yp=992
I (4407) TouchCalibration: counter=74 _xp=6694 _yp=1016 xp=6698 yp=992
I (4417) TouchCalibration: counter=75 _xp=6702 _yp=1018 xp=6698 yp=992
I (4427) TouchCalibration: counter=76 _xp=6700 _yp=1014 xp=6702 yp=992
I (4437) TouchCalibration: counter=77 _xp=6694 _yp=1014 xp=6702 yp=992
I (4447) TouchCalibration: counter=78 _xp=6692 _yp=1013 xp=6702 yp=992
I (4457) TouchCalibration: counter=79 _xp=6695 _yp=1015 xp=6702 yp=992
I (4467) TouchCalibration: counter=80 _xp=6700 _yp=1016 xp=6702 yp=992
I (4477) TouchCalibration: counter=81 _xp=6697 _yp=1016 xp=6702 yp=992
I (4487) TouchCalibration: counter=82 _xp=6701 _yp=1012 xp=6702 yp=992
I (4497) TouchCalibration: counter=83 _xp=6699 _yp=1017 xp=6702 yp=992
I (4507) TouchCalibration: counter=84 _xp=6701 _yp=1011 xp=6702 yp=992
I (4517) TouchCalibration: counter=85 _xp=6701 _yp=1013 xp=6702 yp=992
I (4527) TouchCalibration: counter=86 _xp=6708 _yp=1016 xp=6702 yp=992
I (4537) TouchCalibration: counter=87 _xp=6697 _yp=1014 xp=6708 yp=992
I (4547) TouchCalibration: counter=88 _xp=6698 _yp=1014 xp=6708 yp=992
I (4557) TouchCalibration: counter=89 _xp=6700 _yp=1013 xp=6708 yp=992
I (4567) TouchCalibration: counter=90 _xp=6697 _yp=1018 xp=6708 yp=992
I (4577) TouchCalibration: counter=91 _xp=6699 _yp=1015 xp=6708 yp=992
I (4587) TouchCalibration: counter=92 _xp=6697 _yp=1018 xp=6708 yp=992
I (4597) TouchCalibration: counter=93 _xp=6700 _yp=1019 xp=6708 yp=992
I (4607) TouchCalibration: counter=94 _xp=6698 _yp=1016 xp=6708 yp=992
I (4617) TouchCalibration: counter=95 _xp=6693 _yp=1015 xp=6708 yp=992
I (4627) TouchCalibration: counter=96 _xp=6703 _yp=1012 xp=6708 yp=992
I (4637) TouchCalibration: counter=97 _xp=6698 _yp=1018 xp=6708 yp=992
I (4647) TouchCalibration: counter=98 _xp=6701 _yp=1015 xp=6708 yp=992
I (4657) TouchCalibration: counter=99 _xp=6701 _yp=1014 xp=6708 yp=992
I (4657) TouchCalibration: _min_xp=6708 _min_yp=992
I (6047) TouchCalibration: counter=0 _xp=862 _yp=6816 xp=32767 yp=-32768
I (6067) TouchCalibration: counter=1 _xp=973 _yp=7166 xp=862 yp=6816
I (6077) TouchCalibration: counter=2 _xp=978 _yp=7201 xp=862 yp=7166
I (6087) TouchCalibration: counter=3 _xp=979 _yp=7221 xp=862 yp=7201
I (6097) TouchCalibration: counter=4 _xp=980 _yp=7228 xp=862 yp=7221
I (6107) TouchCalibration: counter=5 _xp=972 _yp=7226 xp=862 yp=7228
I (6117) TouchCalibration: counter=6 _xp=971 _yp=7230 xp=862 yp=7228
I (6127) TouchCalibration: counter=7 _xp=969 _yp=7232 xp=862 yp=7230
I (6137) TouchCalibration: counter=8 _xp=963 _yp=7231 xp=862 yp=7232
I (6147) TouchCalibration: counter=9 _xp=962 _yp=7238 xp=862 yp=7232
I (6157) TouchCalibration: counter=10 _xp=961 _yp=7240 xp=862 yp=7238
I (6167) TouchCalibration: counter=11 _xp=959 _yp=7244 xp=862 yp=7240
I (6177) TouchCalibration: counter=12 _xp=951 _yp=7253 xp=862 yp=7244
I (6187) TouchCalibration: counter=13 _xp=946 _yp=7258 xp=862 yp=7253
I (6197) TouchCalibration: counter=14 _xp=940 _yp=7263 xp=862 yp=7258
I (6207) TouchCalibration: counter=15 _xp=936 _yp=7269 xp=862 yp=7263
I (6217) TouchCalibration: counter=16 _xp=928 _yp=7284 xp=862 yp=7269
I (6227) TouchCalibration: counter=17 _xp=922 _yp=7296 xp=862 yp=7284
I (6237) TouchCalibration: counter=18 _xp=921 _yp=7305 xp=862 yp=7296
I (6247) TouchCalibration: counter=19 _xp=923 _yp=7314 xp=862 yp=7305
I (6257) TouchCalibration: counter=20 _xp=914 _yp=7325 xp=862 yp=7314
I (6267) TouchCalibration: counter=21 _xp=914 _yp=7321 xp=862 yp=7325
I (6277) TouchCalibration: counter=22 _xp=913 _yp=7328 xp=862 yp=7325
I (6287) TouchCalibration: counter=23 _xp=916 _yp=7328 xp=862 yp=7328
I (6297) TouchCalibration: counter=24 _xp=910 _yp=7332 xp=862 yp=7328
I (6307) TouchCalibration: counter=25 _xp=909 _yp=7351 xp=862 yp=7332
I (6317) TouchCalibration: counter=26 _xp=909 _yp=7352 xp=862 yp=7351
I (6327) TouchCalibration: counter=27 _xp=908 _yp=7353 xp=862 yp=7352
I (6337) TouchCalibration: counter=28 _xp=908 _yp=7354 xp=862 yp=7353
I (6347) TouchCalibration: counter=29 _xp=907 _yp=7359 xp=862 yp=7354
I (6357) TouchCalibration: counter=30 _xp=907 _yp=7359 xp=862 yp=7359
I (6367) TouchCalibration: counter=31 _xp=907 _yp=7356 xp=862 yp=7359
I (6377) TouchCalibration: counter=32 _xp=909 _yp=7356 xp=862 yp=7359
I (6387) TouchCalibration: counter=33 _xp=908 _yp=7358 xp=862 yp=7359
I (6397) TouchCalibration: counter=34 _xp=909 _yp=7358 xp=862 yp=7359
I (6407) TouchCalibration: counter=35 _xp=910 _yp=7359 xp=862 yp=7359
I (6417) TouchCalibration: counter=36 _xp=909 _yp=7362 xp=862 yp=7359
I (6427) TouchCalibration: counter=37 _xp=907 _yp=7356 xp=862 yp=7362
I (6437) TouchCalibration: counter=38 _xp=910 _yp=7361 xp=862 yp=7362
I (6447) TouchCalibration: counter=39 _xp=914 _yp=7362 xp=862 yp=7362
I (6457) TouchCalibration: counter=40 _xp=913 _yp=7359 xp=862 yp=7362
I (6467) TouchCalibration: counter=41 _xp=910 _yp=7358 xp=862 yp=7362
I (6477) TouchCalibration: counter=42 _xp=907 _yp=7361 xp=862 yp=7362
I (6487) TouchCalibration: counter=43 _xp=909 _yp=7362 xp=862 yp=7362
I (6497) TouchCalibration: counter=44 _xp=909 _yp=7359 xp=862 yp=7362
I (6507) TouchCalibration: counter=45 _xp=913 _yp=7358 xp=862 yp=7362
I (6517) TouchCalibration: counter=46 _xp=908 _yp=7365 xp=862 yp=7362
I (6527) TouchCalibration: counter=47 _xp=914 _yp=7364 xp=862 yp=7365
I (6537) TouchCalibration: counter=48 _xp=913 _yp=7363 xp=862 yp=7365
I (6547) TouchCalibration: counter=49 _xp=914 _yp=7360 xp=862 yp=7365
I (6557) TouchCalibration: counter=50 _xp=914 _yp=7363 xp=862 yp=7365
I (6567) TouchCalibration: counter=51 _xp=906 _yp=7363 xp=862 yp=7365
I (6577) TouchCalibration: counter=52 _xp=909 _yp=7357 xp=862 yp=7365
I (6587) TouchCalibration: counter=53 _xp=912 _yp=7337 xp=862 yp=7365
I (6597) TouchCalibration: counter=54 _xp=908 _yp=7330 xp=862 yp=7365
I (6607) TouchCalibration: counter=55 _xp=913 _yp=7327 xp=862 yp=7365
I (6617) TouchCalibration: counter=56 _xp=916 _yp=7325 xp=862 yp=7365
I (6627) TouchCalibration: counter=57 _xp=918 _yp=7321 xp=862 yp=7365
I (6637) TouchCalibration: counter=58 _xp=913 _yp=7313 xp=862 yp=7365
I (6647) TouchCalibration: counter=59 _xp=917 _yp=7316 xp=862 yp=7365
I (6657) TouchCalibration: counter=60 _xp=916 _yp=7307 xp=862 yp=7365
I (6667) TouchCalibration: counter=61 _xp=918 _yp=7303 xp=862 yp=7365
I (6677) TouchCalibration: counter=62 _xp=920 _yp=7312 xp=862 yp=7365
I (6687) TouchCalibration: counter=63 _xp=922 _yp=7308 xp=862 yp=7365
I (6697) TouchCalibration: counter=64 _xp=917 _yp=7304 xp=862 yp=7365
I (6707) TouchCalibration: counter=65 _xp=920 _yp=7304 xp=862 yp=7365
I (6717) TouchCalibration: counter=66 _xp=925 _yp=7300 xp=862 yp=7365
I (6727) TouchCalibration: counter=67 _xp=924 _yp=7305 xp=862 yp=7365
I (6737) TouchCalibration: counter=68 _xp=925 _yp=7299 xp=862 yp=7365
I (6747) TouchCalibration: counter=69 _xp=924 _yp=7301 xp=862 yp=7365
I (6757) TouchCalibration: counter=70 _xp=927 _yp=7300 xp=862 yp=7365
I (6767) TouchCalibration: counter=71 _xp=926 _yp=7299 xp=862 yp=7365
I (6777) TouchCalibration: counter=72 _xp=926 _yp=7293 xp=862 yp=7365
I (6787) TouchCalibration: counter=73 _xp=928 _yp=7292 xp=862 yp=7365
I (6797) TouchCalibration: counter=74 _xp=930 _yp=7287 xp=862 yp=7365
I (6807) TouchCalibration: counter=75 _xp=932 _yp=7279 xp=862 yp=7365
I (6817) TouchCalibration: counter=76 _xp=934 _yp=7282 xp=862 yp=7365
I (6827) TouchCalibration: counter=77 _xp=937 _yp=7278 xp=862 yp=7365
I (6837) TouchCalibration: counter=78 _xp=939 _yp=7271 xp=862 yp=7365
I (6847) TouchCalibration: counter=79 _xp=947 _yp=7264 xp=862 yp=7365
I (6867) TouchCalibration: counter=80 _xp=951 _yp=7261 xp=862 yp=7365
I (6877) TouchCalibration: counter=81 _xp=949 _yp=7257 xp=862 yp=7365
I (6887) TouchCalibration: counter=82 _xp=955 _yp=7252 xp=862 yp=7365
I (6897) TouchCalibration: counter=83 _xp=955 _yp=7253 xp=862 yp=7365
I (6907) TouchCalibration: counter=84 _xp=954 _yp=7254 xp=862 yp=7365
I (6917) TouchCalibration: counter=85 _xp=954 _yp=7252 xp=862 yp=7365
I (6927) TouchCalibration: counter=86 _xp=952 _yp=7246 xp=862 yp=7365
I (6937) TouchCalibration: counter=87 _xp=958 _yp=7247 xp=862 yp=7365
I (6947) TouchCalibration: counter=88 _xp=958 _yp=7242 xp=862 yp=7365
I (6967) TouchCalibration: counter=89 _xp=956 _yp=7238 xp=862 yp=7365
I (6977) TouchCalibration: counter=90 _xp=956 _yp=7232 xp=862 yp=7365
I (6987) TouchCalibration: counter=91 _xp=954 _yp=7229 xp=862 yp=7365
I (6997) TouchCalibration: counter=92 _xp=956 _yp=7223 xp=862 yp=7365
I (7007) TouchCalibration: counter=93 _xp=955 _yp=7220 xp=862 yp=7365
I (7017) TouchCalibration: counter=94 _xp=954 _yp=7214 xp=862 yp=7365
I (7027) TouchCalibration: counter=95 _xp=953 _yp=7207 xp=862 yp=7365
I (7037) TouchCalibration: counter=96 _xp=952 _yp=7210 xp=862 yp=7365
I (7047) TouchCalibration: counter=97 _xp=954 _yp=7209 xp=862 yp=7365
I (7057) TouchCalibration: counter=98 _xp=953 _yp=7206 xp=862 yp=7365
I (7067) TouchCalibration: counter=99 _xp=954 _yp=7204 xp=862 yp=7365
I (7067) TouchCalibration: max_xp=862 max_yp=7365
I (7067) TouchCalibration: Opening Non-Volatile Storage (NVS) handle...
I (7077) TouchCalibration: Opening Non-Volatile Storage (NVS) handle done
I (7087) TouchCalibration: Write Touch Calibration done

This may also be helpful.
#21

This turned out to be a bad place for a logging function.

I (1267) LCD_COM: _adc_yp=0 _adc_xm=1073447984

@Me-Phew
Copy link
Author

Me-Phew commented Jan 9, 2025

Thanks for your answer.

I have managed to resolve most of the issue. Turns out I wasn't using the correct pins for ADC1.

That said I've run into some issues trying to fix this.
Namely, when trying to use the correct pins for ADC1 as stated in this table from the README.

TFT ADC1 ESP32 ESP32S2/S3
LCD-WR (Y+) Channel#6 GPIO34 GPIO07
LCD-RS (X-) Channel#7 GPIO35 GPIO08

The problem was that, at least for my devboard (a generic esp32 with 38 GPIO pins) these pins are input only which makes them impossible to use for LCD_WR / LCD_RS.

Because of that I ended up using the following modification of the default pinout:

TFT ESP32 ADC1
LDC_WR GPIO32 Channel #4
LDC_RS GPIO33 Channel #5
LDC_RST GPIO18 -
LDC_CS GPIO19 -

With that the touch is now finally working.

The screen is also working - for the most part at least. On the first touch calibration screen only the green dots are visible after touch, remaining tests are fully rendered but there is noticeable flickering. My guess is this is happening because I'm using 3v from the esp to power the display and with the adc working it can't supply enough current to the fairly big (3.5") screen. Do you think my assumption is correct or is there something I am still doing wrong?

Anyway, thanks for the nice library. I've also submitted a PR #35 that you may review if you wish.

@nopnop2002
Copy link
Owner

nopnop2002 commented Jan 9, 2025

The problem was that, at least for my devboard (a generic esp32 with 38 GPIO pins) these pins are input only which makes them impossible to use for LCD_WR / LCD_RS.

All ESP32, GPIO pins 34-39 as "input-only".
These pins don't have many uses, so I intentionally made them the default pins for analog input.
The TFT's (X-) and (Y+) require two wires as shown below.

LCD-WR(Y+) ----+---- Gpio04(for Digital Output)
               +---- Gpio34(for Analog Input)

LCD-RS(X-) ----+---- Gpio15(for Digital Output)
               +---- Gpio35(for Analog Input)

I thought it was not possible to use a single GPIO for both digital output and analog input at the same time.
Will it work with just one wire if We use GPIO32 and 33?

LCD-WR(Y+) ----+---- Gpio32(for Digital Output)
               +---- Gpio32(for Analog Input)

LCD-RS(X-) ----+---- Gpio33(for Digital Output)
               +---- Gpio33(for Analog Input)

My guess is this is happening because I'm using 3v from the esp to power the display and with the adc working it can't supply enough current to the fairly big (3.5") screen. Do you think my assumption is correct or is there something I am still doing wrong?

Even without the ADC running, the ESP32 development board cannot provide much current.
It is more stable when supplied from an external power source.
I used a USB-TTL conversion module as an external power source.

ExternalPower

@Me-Phew
Copy link
Author

Me-Phew commented Jan 10, 2025

I thought it was not possible to use a single GPIO for both digital output and analog input at the same time.
Will it work with just one wire if We use GPIO32 and 33?

Is this what you mean by that?

image

This is my current working configuration:

image

I'm asking this just for clarity because I thought it is impossible to even configure the pins in this way.

image

As I understand it now the GPIO numbers are used for digital i/o and are configured completely independently from the ADC channels which are for analog input, right?

@nopnop2002
Copy link
Owner

nopnop2002 commented Jan 10, 2025

First, thanks for providing a clear diagram.

Is this what you mean by that?

Yes. That right.

This is my current working configuration:

401738993-88e6870e-7eeb-4dc2-9022-16fb9d815056

This is a new discovery for me.

As I understand it now the GPIO numbers are used for digital i/o and are configured completely independently from the ADC channels which are for analog input, right?

My understanding was that one GPIO could not be used for digital output and analog input at the same time.
This could be wrong, so I'll check again.

@nopnop2002
Copy link
Owner

nopnop2002 commented Jan 10, 2025

That said I've run into some issues trying to fix this.
Namely, when trying to use the correct pins for ADC1 as stated in this table from the README.

What problem occurred?
Instead of changing the default values, you can use menuconfig to change to the following connections:

401738993-88e6870e-7eeb-4dc2-9022-16fb9d815056

parallel-tft


401738993-88e6870e-7eeb-4dc2-9022-16fb9d815056

I have confirmed that the touch panel works with the above connection.
This is a new discovery for me.
I will perform further long-term testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants