This article provides information about configuring various clocks in the Atmel START QTouch® Configurator.
Overview
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.
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.
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.