Overview
Touch interfaces have shifted from a premium feature in high-end consumer products to an expected capability across a wide range of devices, including low-cost appliances. For designers, the good news is that capacitive touch sensing requires minimal sensor hardware: electrodes etched on the printed circuit board. However, implementing reliable touch requires relatively sophisticated software on the microcontroller (MCU) and, depending on the application and number of keys, sometimes dedicated hardware acceleration. Despite this, capacitive touch remains cost-effective and robust even in demanding environments, so its adoption continues to grow.
Touchpad complexity and MCUs
Almost any MCU can handle basic touch sensing. For example, Microchip supports multiple touch technologies, and the capacitive voltage divider (CVD) approach works across MCU products that integrate A/D converters, including members of the PIC10 product family. CVD relies on the sample-and-hold capacitor of the A/D converter as a reference; the converter detects touch by sensing the voltage level.
Low-end devices in the 8-bit MCU segment may only handle a handful of keys. Higher-end 8-bit MCUs can support more keys. According to Microchip, the PIC16 series is positioned in the midrange of its 8-bit portfolio and offers up to 30 A/D channels and a capacitive touch system based on the CVD approach. Each electrode requires one channel.
However, the number of A/D channels is not the only constraint on the number of keys a designer can support with a given MCU. Memory can limit the number of keys because each sensor requires stored calibration and state data.
Microchip provides touch software to customers, including source code. The software implements functions to ensure accuracy, including filtering of 60 Hz and high-frequency noise and environmental compensation for temperature and humidity. The MCU continuously scans keys by multiplexing channels into the A/D converter.
Microchip reports that a typical PIC16-based implementation might support 22 keys and consume about 80% of the MCU processing time to run the touch interface while providing a maximum response time in the 100 to 200 ms range. Customers typically implement 4 to 10 sensors.
Charge Time Measurement Unit
Microchip uses an analog peripheral called the Charge Time Measurement Unit (CTMU) on some MCUs to support a different touch sensing method. CTMU was not developed specifically for touch but can be applied to touch applications with less processor overhead.
The CTMU uses a constant current source to repeatedly charge the touch circuit for a fixed time and samples the resulting voltage with the A/D converter. When no finger is present, the touch circuit charges to a higher voltage; when touched, it charges to a lower voltage.
The CTMU approach lets the MCU support as many keys as there are A/D channels, with scan times as low as 4 μs per key. Microchip offers this peripheral in selected 8-bit PIC18 and 16-bit PIC24 devices. For example, the general-purpose PIC18F45K22 MCU and the USB-capable PIC18F46J50 MCU include CTMU. In the 16-bit lineup, PIC24F04KA201, USB-capable PIC24FJ64GB004, and PIC24FJ256DA210 with an integrated LCD controller also include CTMU.
Touch-specific hardware
Renesas handles touch sensing differently. Most of the company's MCUs can support touch interfaces in software, but Renesas chose not to provide and support general-purpose touch software because, the company states, software implementations are vulnerable to component drift, noise, and other factors that affect accuracy.
Instead, Renesas offers a peripheral called the Sensor Control Unit (SCU) for members of the 16-bit R8C MCU family. The SCU is based on state machines, comparators, and timers that, when combined, detect touch and perform noise mitigation and continuous system calibration in hardware. Devices in the family can sense up to 36 keys while using only about 15% of the host MCU’s processing capacity.
Renesas’ approach uses a comparator to measure the charging and discharging of a reference circuit and the touch circuit, and a timer to measure the time for the touch circuit to fall below a threshold.
According to Renesas, low power is another advantage of dedicated hardware. Their MCUs can scan a keypad with supply currents as low as 16 μA. In industrial software implementations they report minimum currents in the 30 μA range. Renesas positions the R8C MCUs for customers who want a single MCU to handle both touch sensing and application functions, or as a dedicated touch controller for applications that require a faster host processor.
Software support
Freescale adopts a software-and-hardware approach that gives design teams a consistent software interface and the flexibility to choose either MCUs with dedicated touch hardware or standard MCUs that rely on software algorithms. Freescale’s Xtrinsic touch sensing software (TSS) provides the same interface to embedded software developers regardless of the MCU hardware. TSS supports 8-bit HCS08 and 32-bit ColdFire MCUs without dedicated touch hardware, as well as ColdFire+ and Kinetis MCU series that include a Touch Sensing Input (TSI) peripheral.
Freescale supports multiple touch algorithms for HCS08 and ColdFire. The simplest approach uses GPIOs and general-purpose I/O lines. This timer-based method measures how long it takes an external capacitor connected in parallel with the sensor electrode to charge. When touched, it takes longer for the voltage to reach a set threshold.
The TSI peripheral offloads touch sensing from the MCU and supports 16 keys. Freescale reports that MCUs with TSI can operate at currents as low as 1 μA and can wake on touch key events.
A layered architecture allows a design team to use the same interface for keys, sliders, and rotary sensors regardless of whether a TSI module is present. It also allows teams to select among multiple touch algorithms when TSI is not available.
ALLPCB