had the cam position sensor code:

17746 - Camshaft Position Sensor (G40)
P1338 - 35-00 - Open or Short to Plus

Swapped ECU, no change
swapped 2 'likely good' sensors: no change
put in brand new 'known good' sensor: no change

All points toward bad wiring from the sensor to the ECU.

Does someone have a wiring diagram and (even better) the ECU pin out?

Car is 1999 A4 quattro 1.8T AEB manual

ECU is 8D0 907 557 N