How is Auto-grounding used in the Capactive Sensing Module? How can Auto-grounding be activated when the Capactive Sensing Module is used?
When one or multiple capsense channels/pins are configured and a capsense conversion is initiated in one channel/pin, Auto-grounding ensures that the non-initiated channels/pins are connected to the analog ground. This provides a ground shielding for the initiated capsense channel/pin and minimizes the noise coupling from toggling GPIO pins. This only applies to the Capsense Module.
To activate the Auto-grounding feature, the Port latch register is to be cleared and the PxMDIN register is to be set to analog mode. As an example, if P2.0 to P2.7 are to be used as Capsense channels, the following instructions will Auto-ground P2.0 to P2.7.
P2 = 0x00; P2MDIN = 0x00;
P2.0 to P2.7 will be connected to the analog ground. When a Capsense conversion is initiated, the selected channel in CS0MX register will release that pin for Capsense while the other pins are grounded. As an example, if CS0MX = 0x00, and a Capsense conversion is initiated, P2.0 is released from the Auto-grounded state while P2.1 to P2.7 remains grounded.