The Pull-up circuit available (in AVR devices) for each GPIO pin has to be disabled before QTouch acquisition is performed. For tinyAVR and megaAVR devices the Pull-up circuit for all GPIO port pins are enabled and disabled together. When user needs to configure the pins that are not used by QTouch library for his application, he may enable the Pull-up circuit after QTouch measurements are performed and disable them before the touch acquisition starts once again (as shown in the code snippet below).
/* Disable pull-ups for all pins */ MCUCR |= (1u << PUD); //MCUCR_PUD = 1u; /* perform QTouch measurements */ qt_measure_sensors ( current_time_ms_touch ); /* Enable pull-ups for all pins */ MCUCR &= ~(1u << PUD); //MCUCR_PUD = 0u;
For XMEGA devices the Pull-up circuit for each individual GPIO port pins can be configured individually, by writing to the PINnCTRL register of the ports being used.