Guide To Configuring the Clock In Touch Projects

This article provides information about configuring various clocks in the Atmel START QTouch® Configurator.


Several Atmel START QTouch Configurator projects perform touch measurement using the Peripheral Touch Controller (PTC). This project also uses the Timer and Universal Asynchronous Receiver Transmitter (UART) peripherals.

  • Timer: used to define and maintain the touch scan rate (touch measurement periodicity).
  • UART: used to send touch debug data to PC (Data Visualizer) when debug data is enabled.

The PTC, Timer, and UART peripherals require a clock in order to work properly. Depending on the device, these clocks can be the same or different from the CPU clock. Table 1 shows PTC minimum and maximum clock to be set.

Table 1

After creating the sensors, a warning message pops up asking whether the clock settings have to be modified appropriately for the QTouch application.

  • If Yes is selected, then peripheral clocks (PTC, USART, and Timer) are modified appropriately for the device.
  • If No is selected, the clocks are not modified.
  • In some cases, using a higher clock frequency for the CPU forces the PTC to use a higher clock frequency than the specified maximum value (e.g. ATmega328PB). In such cases, the PTC prescaler (PTC Clock) in the Parameters tab should be modified in between the MIN and MAX range (refer Table1) so that the PTC clock is lower than the maximum value.
  • The GCLK/CLKPER (input clock) has to be chosen such that at least one prescaler value is valid. The blue color indicates the valid PTC clock frequency range, and red denotes the invalid PTC clock frequency range.
Warning message for QTouch Clock settings

Sometimes the clock source used in Atmel START will be different from the actual one due to incorrect fuse settings. For this reason, it is important that you verify and ensure that the fuse settings on the device are properly configured as per your Atmel START configuration.

PTC Clock

The maximum clock supported by the PTC is noted in Table 1. In devices where the PTC clock source is different from that of the CPU clock, the PTC clock can be configured separately. While creating a QTouch project, click on the CLOCKS tab and change the clock frequency and/or sources.

Timer Clock

Depending on the timer clock, Atmel START configures the timer to maintain the desired periodicity for touch measurements. If you change the CPU or Timer clock in your application (after downloading the project from Atmel START), then the touch measurement period may be different from that of the configured time. The recommended value is 32 kHz.

UART Clock

It is advisable to configure the UART clock the same as the CPU clock.

Low-power Mode

The peripherals/clock required to be awake during the sleep operation should be set as Run in standby and Timer to be configured as 1 kHz.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.