1.5 Crosstalk and PCB Routing
When measuring analog signals, especially signals with a high quantity of source impedance, keep signals with fast rising/falling edges far away. Use the Peripheral Pin Select (PPS) feature on PIC® MCUs or the Port Multiplexer (PORTMUX) on AVR® MCUs to increase the routing flexibility during PCB layout.
Besides distance, there are a few other ways to reduce or minimize crosstalk. Since crosstalk occurs from the edges of digital signals, slowing the edges down will reduce the amount of interference generated. Some microcontrollers contain a Slew Rate Control (SLRCONx) register, which can be used to lower the switching speed of the I/O. On devices without this register, using a small resistor in series can have a similar effect.
An alternative method to distance may be to shield the analog signal with ground. This is effective against capacitive coupling but not inductive coupling(1).
Another way to reduce crosstalk is to change the digital I/O when not sampling. The easiest way to implement this is by putting the device into a sleep mode while sampling occurs and then wake up and apply changes when complete.
- Inductive coupling is created from changes in current, whereas capacitive coupling is created from changes in voltage. Digital logic on the microcontroller almost always acts capacitively.