Sorry for my english, i have this issue using an ILI9486 IC, 480X320 8bit parallele, mcufrien_kbv driver modified for special config and pins position on a Atmega32U4 micro (Leonardo), for saving pins, share the reset pin of the LCD with a switch as a mechanism sensor (stop) because lcd seems don't need it while reset lcd pin is kept hi, and program a routine for resistive touch panel (without a touch library) because of saving program space on the microcintroller...
First issue: draw some things on lcd runs well on setup, then configure shared pin (reset on mcufriend_shield.h) as a input_pullup (PORTB4 / Pin 8 on Arduino) for stop sense purposes that runs as spected while mecanism finds his start position... but changes then his input_pullup config i think because the second issue...
Second: for reading the x and y touch point just change the configuration of the LCD shared pins with the pinMode( ), digitalWrite( ) and analogRead( ) method implemented as touch screen libraries, all runs well until i try to past to direct port manipulation, trying even first changing DDRx than PORTx setting on every "step" and manipulating the DIDRn register on the inputs that can read signals as "analog inputs" then recovering the start settings on shared pins, that only runs if do the arduino method (pinMode( )) for pins 17 and 15, for leonardo config (PORTB1 and PORTB0), now stops drawing after the first touch point reading and deconfigure the pull-up function on PORTB4 and any other pin that i want to use (try already with PORTF7) configuring on setup as do with PB4, at return to arduino method configuring all pins for touch screen read runs well first time but steel deconfigure any pin i use as mecanism stop sense... all i need is to use low program space for implementig some sensors for a mechanical ventilation system...
Notes_210103_185936.txt (1014 Bytes)
Notes_210103_193742.txt (1.74 KB)
Notes_210103_194746.txt (430 Bytes)