Guide To Configuring the Clock In Touch Projects

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


An Atmel START QTouch Configurator project performs touch measurement using the Peripheral Touch Controller (PTC). This project also uses the Timer and 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 various devices and their clock dependencies.

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 the CPU and peripheral clocks (PTC, USART and Timer) are modified appropriately for the device.
  • If No is selected, then we recommend you go through the steps below to configure the clocks (CPU, PTC, USART and Timer) manually.
Warning message for QTouch Clock settings

CPU Clock

The CPU clock is used to clock the CPU. The higher the clock frequency, the faster the instruction execution. After a touch has been detected, the CPU performs the processing on the measured touch data. This means that the higher the CPU clock frequency, the faster the processing.

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.

One of the recommended clock settings for SAMD1x/SAMD2x

Recommended clock settings for ATtiny81x/ATtiny161x/ATmega328PB/ATmega324PB

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 Pre-Scaler (clock division factor) in the 'Parameters' tab should be modified so that the PTC clock is lower than the maximum value.


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.

UART Clock

Depending on the UART clock, Atmel START configures the UART to send data at the configured baud rate. If you change the CPU/UART clock in your application (after downloading the project from Atmel START), then the debug data may not be sent at the correct baud rate. The recommended baud rate is 38400 for Tiny/Mega and 115200 for SAM devices. If a low-frequency clock is used, then there is a possibility that the baud rate error will be greater.

© 2019 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.