Hello Jens,
By looking into your code, I found that you had programmed the TSC at the TSMode 2 (Host-Controlled and X-Y Scan Mode) and with /PINTDAV pin as /PENIRQ. Therefore, the /PENIRQ pin should function in such a way (refer to Figure 41 on pg 44 of the TSC2004 d/s) --
(1) Without I2C communication (do not run software): the /PENIRQ totally reflects touch status. That is: it is high if no touch; or low if applying a touch on the screen;
(2) With I2C communication: the /PENIRQ reflects touch status when /PENIRQ is not disabled. However, the /PENIRQ must be disabled whenever a X or Y or Z driver is on (while TSC samples/concerts/reprocesses a X or Y or Z touch data. Refer to Figure 41, the /PENIRQ is disabled (and thus low) when TSC samples/converts/reprocesses Y (or X) data; and is enabled when TSC finishes with getting Y (or X) data and thus the pin returns high. Under this point, if the touch is still on the screen, the pin will go back low again (to reflects the touch status).
The /PENIRQ functions just as it is programmed, isn't it?
You may look into the Figure 41, and also change the /PINTDAV pin to /DAV or /PENIRQ + DAV, to see its behavior.
Please always fell free to ask if there is any problem!
Regards,
Wendy F.