Digi-key
Touchscreens integrated into an LCD (usually TFT) or as part of a PCB have become the de facto user interface for modern handheld devices. Based mostly on resistive and capacitive technology, these transparent or opaque surfaces replace mechanical switches, membrane switches, dome switches and buttons to provide embedded micros with user interface information that goes well beyond just a button press.
Dedicated touchscreen interface chips have emerged to help unburden the host processor and deliver additional functionality. While they may increase cost and require a little more PCB space, they allow engineers to get their designs to market quicker and with a highly tested and reliable touch technology.
This article discusses I2C connected touchscreen controllers.
Beyond connectivity
User interfaces have moved far beyond switches and contact closures. Gestures for expanding a view, contracting a view, or scrolling, for example, accomplish more than is possible via any single discrete button or switch. Circular motion also replaces the mechanical JOG rings made popular by early iPods. Sliders, which used analog trimmer resistors, are also being replaced by touch-sensitive technology.
All this capability and flexibility means more processing horsepower is required to detect, de-code, debounce, and pass along user intent to a host processor. This means either a higher-performance (and more costly) processor or a dedicated controller is needed.
Both are valid approaches. Modern day microcontrollers and microprocessors typically have a lot of horsepower and feature A/D and D/A converters, as well as op amps and comparators which can implement a rudimentary touchscreen interface. However, this approach requires coding real-time and time-sensitive detection and response into the host processor’s burdened schedule. Consequently, that means more on-chip code flash, as well as scratchpad and buffer RAM, which, in turn, can mean larger more costly micros.
Size is usually a driving constraint in any handheld or portable device, so if a lot of I/O is needed to implement a touch interface, it is undesirable. As a rule of thumb, the fewer number of micro pins needed to perform a function, the better the design tactic. For this reason, serial interfaces are used to let complex functions connect to a resident micro without burning precious I/O pins.
I2C is a simple, yet effective, two-wire bi-directional communications technique that lets peripheral chips perform complex function while only using two I/O lines of a host processor. It is such a simple protocol that it can be easily bit-banged if dedicated I2C hardware is not built into the micro.
As you may expect, this universally accepted standard is used to allow dedicated touchscreen controller interface chips to connect to a host micro with the fewest number of I/O pins. Also, as you may expect, many touchscreen controller chips are dedicated processors and systems on a chip (SoCs). This means that while they may be optimized for touch interface, they may also perform other system functions, further unburdening the host processor.
Take for instance the Cypress CY8CTST200A-48LTXI PSoC-based dedicated microcontroller, an 8-bit, 4 MIPS Harvard architecture, M8C-based microcontroller programmed to function as a dedicated touch interface controller (Figure 1). Implementing the company’s True Touch technology, the capacitive-sensing IC contains reference drivers, multiplexers, comparators, timers, and the logic needed to implement a variety of touch-sensing algorithms such as positive charge integration, negative charge integration, successive approximation, sigma delta capacitive sensing, and relaxation oscillator frequency variations.
Figure 1. | The embedded processor in the Cypress True Touch controller can run a variety of touch-sensing algorithms and perform other peripheral functions while communicating to a main processor over I2C. |
In addition to I2C, the Cypress parts have USB, SPI, and UART interfaces. With 32 Kb of on-chip flash and only 2 Kb of SRAM, the core processor can be tailored for your specific touch needs as a dedicated touch controller. It most likely will not have the horsepower to run your design completely, but it is not intended to. It is more like a programmable peripheral chip with a micro at the heart of it.
Atmel is another player in this arena with its Qtouch technology. The Atmel AT42QT1060-MMUQS397 for example is intended for use in cell phones and smart phones, combining touch control with PWM based LED drivers to integrate two needed functions in a single package (Figure 2).
Figure 2. | In addition to monitoring touch pads, the Atmel Q-Touch has dimmable LED drivers. All touch events and dimmer controls are over I2C. |
The Qtouch technology is based on a digital burst-mode charge transfer technique to detect capacitive changes in the buttons. A modulated burst of spread-spectrum frequencies is used to suppress RF emissions and reduces the effects of ambient noise. This also helps reduce interference with the sensitive RF stages that are used in cell phones. A training module is available on Digi-Key’s website that details the Atmel Qtouch technology.
Sliders, too
An interesting part comes from IDT with its LDS6000NQGI8 designed to support up to 15 sensors for sliders and touch rings. IDT calls its touch technology PureTouch and is based on a capacitance to digital converter thought use of an internal 500 KHz sigma delta switch matrix (Figure 3).
Figure 3. | The sigma delta switch matrix built in to the IDT Pure Touch controller takes aim at multiple sliders and jog ring designs as well as discrete touch zones. |
A nice feature of the LDS6000N is its on-chip calibration logic, which continuously monitors the environment to adjust the on-off thresholds to make the inputs more immune to noise. In addition to I2C, the LDS6000 has an SPI port that can be designated and used as a serial communications link selected by an external input state.
If higher resolution and more sensor inputs are needed, you may want to check out the STMPE24M31QTR from STMicroelectronics. This part, based on the company’s S-Touch technology, supports up to 24 sensor inputs and has a slider/wheel resolution of 256 steps. It also features eight PWMs that can control up to 16 LEDs with brightness control and blinking capability.
The I2C interface has a full 400 Kbit/s data rate and all input pins are protected to 8 kV for ESD events. This part also has 16 general-purpose I/Os and is aimed at mobile phones, portable media players, laptops, and game consoles, but can be used for any capacitive-touch systems.
ST makes available the STEVAL-ICB003V1 evaluation kit, which contains eight touch keys, a rotary encoder interface, and 4- to 7-segment LED displays (Figure 4). The company also has a training module online that details its capacitive touch-sensing solutions.
Figure 4. | The development and evaluation board from STMicroelectronics is intended to demonstrate front panel solutions including the company’s S-Touch technology. Reference designs in the datasheet demonstrate a variety of sensors including sliders, rotary encoders, and liquid level sensors. |
Freescale Semiconductor also has an interesting I2C touch-sensing controller. The MPR121QR2 is the company’s second generation touchscreen controller, supporting up to 12 touch pads.
A nice feature on this part is the internal filtering and debounce circuitry and a simulated electrode where all 12 are charged together to allow a greater near proximity detection distance and an increased sensing area.
In operation, once the electrode capacitance data is acquired, the electrode touch/release status is determined comparing it to the capacitance baseline value. The capacitance baseline is tracked by MPR121QR2, automatically based on the background capacitance variation.
The baseline value is compared with the current immediate electrode data to determine if a touch or release has occurred. A designer has the ability to set the touch/release thresholds, as well as a touch/release debounce time. This is to eliminate jitter and false touches due to noise. This part also has a hardware configurable I2C address so you can arbitrate devices sharing the same I2C lines.
In summary
Touch sensing technology can reliably replace mechanical buttons and switches to eliminate mechanical wear and tear. Modern touch sensors can be configured into simple sliders, rotary wheels, and touch pads to offer significant advantages for more intuitive user interfaces, allowing greater freedom for designers while reducing overall system cost. Touch sensor controllers driven by an I2C interface remove the processing burden from the host microcontroller, and as we have seen in several part examples, also can perform other peripheral functions.