Designing MCU-based touch-enabled wireless HIDs for Windows 8 -

Designing MCU-based touch-enabled wireless HIDs for Windows 8

Editor’s Note: In this Product How-To article, Santhosh Kumar Vojjala and Utsav Ghosh of Cypress Semiconductor analyze the challenges facing designers of MCU-based HIDs (human-interface devices) for Windows 8-based computers and explain how the company’s PRoC-UI can be used to reduce component count and cost.

In October 2012, the world witnessed one of the biggest product launches ever as Microsoft released Windows 8 with its modern user interface (UI) and windows-style apps. While it has had its critics, the fact remains that the new OS marks a fundamental change in the way customers interact with their PCs.

Windows 8’s modern UI is designed to support tablets as well as PCs and laptops. The Windows GUI has undergone several modifications to make it more tablet-friendly:

  • The Start Button and Start Menu have been removed. Instead there is a full-fledged Start Screen (Figure 1) , with tiles for apps, websites, folders, etc.
  • Inclusion of touch-based gestures for frequently used functions:
  • The Charms Bar, which contains features like Search, Settings, etc., can be accessed with a single finger swipe from right edge to center.
  • The commands menu for any application can be accessed with a single finger swipe from top edge to center
  • Scrolling through all open applications is possible with a single finger swipe from left edge to center

The inclusion of touch-based gestures for frequently-used features makes it imperative that touch- handling capability be present on hardware for Windows 8.

Figure 1: Windows 8 Start Screen

Figure 2: Microsoft's Wedge Touch Mouse

Figure 3: Logitech T650 Wireless Trackpad

As Windows 8 is adopted by a larger customer base, the demand for touch-based HIDs is expected to increase significantly. In keeping with the current trends in HID, the majority of these peripheral devices will be wireless enabled. As a result, OEMs across the world are looking for efficient, cost-competitive, and good-quality components for building touch-enabled wireless HID.

Basic building blocks for touch-enabled wireless HID
Any touch-enabled wireless HID needs three key components – a microcontroller (MCU), a radio, and a capacitive touch controller (Figure 4 ).

The interface for communication between MCU, capacitive touch controller, and radio is assumed to be a serial peripheral interface (SPI), while other components are connected to their respective controllers over general purpose input/output (GPIO) pins. The HID communicates via a dongle plugged into the USB port of a PC or laptop. A detailed understanding of the functionality of each of these three basic building blocks is essential for HID designers.

Figure 4: Basic Building Blocks for Touch Enabled Wireless HID

Capacitive touch controllers
A capacitive touch controller detects change in capacitance on the surface of a touchpad to determine the location of fingers. A touchpad is usually created on a printed circuit board (PCB) or on a flexible printed circuit (FPC). Sensor patterns on the touchpad are created using a conductive material like copper. The touchpad consists of row and column sensors arranged in a grid format (Figure 5 ).

Figure 5: Touchpad with sensor grid and capacitive touch controller

The touchpad and capacitive touch controller can be on same board or on different boards. In cases where the touchpad and capacitive touch controller are on different boards, metal traces from the sensor grid are brought out on a header, and an FPC cable is used as a connector between the two boards. If both are on the same board, metal traces connect the sensor grid to the capacitive touch controller.

Typical operation of a capacitive touch controller
The touch controller scans all sensors periodically and records the capacitance value for each sensor. The presence of fingers on the touchpad changes the capacitance of any sensor over which fingers are placed. The touch controller senses the relative change in capacitance and calculates actual finger positions (X and Y position). Current finger positions are compared with previously recorded positions to decode gestures. Gestures need to be computed on the chip to avoid having an extra driver deployed on the Windows OS. Once a new gesture is detected, the capacitive touch controller reports availability of data via an interrupt to the MCU and waits for the MCU to read the data.

Figure 6: Capacitive touch controller – firmware flow

Capacitive touch design considerations
Refresh time: Refresh time is the time interval between two consecutive reports by the capacitive touch controller. As the number of capacitive sensors to be scanned increases, the total time to scan all sensors will increase, thereby increasing refresh time.

Overlay material and thickness: Capacitance induced by a finger is inversely proportional to the thickness of the overlay material and directly proportional to its dielectric constant. To achieve the best finger response, the dielectric constant of overlay material should be high and its thickness should be low.

Sensor pitch:  Sensor pitch is the distance between centers of neighboring sensors. A typical pitch in X and Y dimension is 5 mm (Figure 7 ). Higher sensor pitch can result in a loss of accuracy and linearity.

Figure 7: Sensor pitch for touchpad

Capacitive sensing pins: Each sensor on a capacitive touchpad needs to be connected to a capacitive sensing pin. If the touch controller does not have enough capacitive sensing pins, the sensor pitch can be increased to support the required touchpad area. This approach, however, can lead to a loss in accuracy and linearity. Hence, choosing a capacitive touch controller with sufficient capacitive sensing pins is vital.

Accuracy and linearity: Accuracy is a measure of the finger position being reported for the capacitive touch controller versus the actual finger position. Linearity error refers to the delta between the coordinates reported by the capacitive touch controller and the expected coordinates as the finger moves along a straight line. These measures are affected by:

  • Sensor pitch: The higher the sensor pitch, the lower the accuracy and linearity
  • Firmware algorithm: Accuracy and linearity may vary, depending on the accuracy of finger position prediction algorithm.

Firmware configurability: Firmware for touch controllers can be configured to map different actions to different gestures and even to dynamically develop custom gestures to improve end user experience.

Capacitive touch controllers
Many of the capacitive touchcontrollers available on the market today are modular components. Themodule has a capacitive touch controller programmed to handle capacitivetouch detection and gesture decoding and connects to a MCU as an I2C orSPI slave. The key limitation with a modular approach is that thecapacitive touch controller cannot be used to handle MCU activities.

Amore robust solution is offered by ICs suppliers like Cypress.Cypress’s new single chip solution, PRoC-UI (ProgrammableRadio-system-on-a-Chip – User Interface), integrates a controller thatcan handle both capacitive touch and MCU functionality together with thelow power WirelessUSB-NL radio. PRoC-UI can enable OEMs to reduce theiroverall bill of materials (BOM) cost by eliminating the need – and thecost – of a separate MCU.

Figure 8: PRoC-UI – Cypress's single-chip solution for touch-enabled wireless HID

Microcontroller – functionality and key design considerations
Themicrocontroller (MCU) is responsible for coordinating all subsystemactivities, including reading data from system components, transmittinginformation to the dongle through the radio, and optimizing powerconsumption of the system. System components are connected to the MCUover SPI/ I2C or over GPIO pins (Figure 4 ).

The typicaloperation of a MCU is as follows: An interrupt is sent to the MCU fromthe capacitive touch controller on detection of a valid gesture. The MCUthen initiates a read operation to acquire the touch coordinates andgesture information from the capacitive touch controller. The MCU alsoacquires information from other system components like optical sensorsin the case of touch mice. It then packages and sends all thisinformation to the radio for transmission. The MCU is also responsiblefor running the protocol that controls the radio. Key designconsiderations include the following:

  • Interface Support – The MCU must support the interfaces required for each of the different components (radio, optical sensor etc.). Typical interfaces include SPI and I2C, among others.
  • GPIO – Components like the optical sensor for touch mice are connected to the MCU via GPIOs. Battery monitoring, binding button, LEDs, and other such components also need GPIOs. Having a sufficient number of GPIOs on the MCU is a must.
  • Integrated components – On-chip components are an added bonus for MCUs as they help in reducing the overall bill of materials (BOM) by eliminating the need for external components. For example, an on-chip analog-to-digital converter (ADC) can be used for battery monitoring.
  • Memory – The MCU must have enough flash as well as enough RAM available to run the radio protocol and control other components via SPI/GPIO.
  • CPU Speed –Typically, an 8-bit CPU with operating frequency of 20 to 24 MHz can fulfill the system requirements of a touch-enabled HID.

Radio – functionality and key design considerations
Themajority of wireless HID devices use proprietary 2.4 GHz radio ICs.These radios commonly employ Gaussian frequency shift keying (GFSK) formodulation and are controlled using a driver and a protocol running onthe MCU.

The MCU transfers data to the radio over SPI. The radioframes and transmits the information to the dongle on a PC or laptop. Atypical radio packet contains:

  • Preamble – a sequence of bits used to identify start of a packet
  • Sync Word – a unique sequence of bits identifying the receiver and transmitter
  • Payload – the information being transmitted.
  • CRC – a cyclic redundancy check (CRC) is typically calculated on the payload to ensure data integrity

Key design considerations
Throughput: Throughput is the total amount of data that must be moved through the system. This is influenced by factors like:

On-Air Data Rate: The radio on-air data rate is the rate at which the radio transfersdata over the air. Higher data rates result in better throughput but aremore susceptible to interference
Packet Size – Large packets resultin better throughput as they reduce overhead like preamble associatedwith the payload. However, large packets are also more vulnerable tointerference and thus transmission failure

Internal buffer: The radio’s internal buffer is used by the MCU to transmit/receiveinformation. The size of this buffer determines the number of bytes ofdata that can be handled by the radio at a time. Larger buffers reducethe MCU effort required for breaking up a large packet and loading theinternal buffer multiple times

Range: Wireless HIDsneed radios that can communicate over a range of 10m. This isinfluenced by a number of factors like the maximum output power of theradio and the availability of a built-in Low Noise Amplifier (LNA) thatallow the radio to receive low power signals and antenna design.

Interference handling: 2.4 GHz radios face interference issues due to Bluetooth, WiFi, andother sources, which also transmit on the 2.4 GHz ISM band. Radios usefeatures like a received signal strenth indicator (RSSI) to detectinterference. Once interference is detected, a frequency hoppingprotocol is needed to move to a channel free from interference. Radio ICsuppliers provide protocols (e.g. Cypress’s AgileHID protocol) thatincorporate interference handling measures.

Putting it all together
Anytouch-based wireless HID needs the three basic building blocks coveredabove. Depending upon the specific HID application, other components(like optical sensors in the case of touch mice) may be needed. A fewpoints to keep in mind while selecting components and suppliers are:

  • Choosing low power components to minimize overall system power consumption
  • Wireless HIDs are battery-powered devices. Low power consumption increases battery life and is an essential characteristic of the system
  • Selecting a solution provider to reduce design cycle time and time to market

Sourcingcomponents from separate vendors and putting them together leads to atime consuming and complex design cycle. A complete solution withintegrated capacitive touch controller, MCU and radio backed byreference material like sample schematics, BOM, layout guidelines andsample firmware can simplify the design cycle and reduce time to market.

Cost Considerations
Thebiggest hurdle manufacturers of touch-enabled wireless HIDs face iscost. Using discreet ICs for the MCU, capacitive touch controller, andradio can lead to a high overall BOM cost. The Wireless HID market is aprice-sensitive market, so minimizing the BOM cost for touch-enabledwireless HID is required for mass adoption. Reducing the number of ICsrequired is the best way to reduce BOM cost.

Cypress’s PRoC-UIis a single-chip approach to wireless HID that integrates a wirelessradio with a microcontroller that handles both capacitive touch sensingand MCU functionality. Figure 9 below compares touch mice architecturesimplemented with and without PRoC-UI.

Figure 9: PRoC-UI based touch mouse versus typical 3 chip solution for touch mouse

Ascan be seen, the PRoC-UI can replace three ICs (MCU, capacitive touchcontroller, and radio) with a single chip. This leads to significantsavings on overall BOM cost. Moreover, PRoC-UI solutions consume lowerpower than a typical three-chip approach because PRoC-UI eliminates theneed for a separate MCU.

Santhosh Kumar Vojjala iscurrently working as Applications Engineer SR at Cypress SemiconductorIndia Pvt. Ltd. He holds a Bachelor's degree in Electrical andElectronics Engineering from JNTU and Master's degree in ElectricalEngineering from Indian Institute of Technology Bombay (IITB), India.His core expertise is in designing embedded applications with capacitivetouch for consumer and automotive products. He greatly enjoys workingwith microcontrollers.

Utsav Ghosh holds a Bachelor'sdegree in Computer Science and Engineering from W.B.T.U. and a MBA inmarketing and industrial management from NITIE, Mumbai. He has 2 yearsof experience in building drivers for Windows operating systems.Currently he handles product marketing for wireless technologies atCypress Semiconductor India Pvt. Ltd.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.