DSP, Micros & Memory


Increasing MCU integration in embedded HMI

18 April 2012 DSP, Micros & Memory

HMI designs in embedded systems are evolving fast as the cost of manufacturing fashionable and more elegant interfaces continues to decrease. Some applications are already combining touch-sensitive interfaces, such as keys, sliders, touch-screens and haptic feedback, with rich graphical displays using the latest generation of microcontrollers (MCUs) which integrate graphic display controllers, with peripherals for implementing capacitive-touch, touch-screen controllers and USB onto a single chip.

The new MCUs promise to combine lower system cost with a wider range of options for higher system integration. However, while they enable designers to lower the cost of system hardware, manufacturing and inventory, the increased complexity of software development can impact on time to market and demands a robust integration of touch-sensing and other human-interface functions onto a single MCU.

First, consider the origin of these concerns. Take, for example, capacitive touch-sensing. When touch-sensitive keys were first introduced, designers soon realised that they were not as simple to implement as traditional pushbuttons. Touch-sensitive keys have to be handled in the same way as analog sensors; radiated noise, or noise that may be conducted from environmental sources such as common appliances, compact fluorescent lamps, power supplies, cellphones and motors, needs careful management.

To achieve robust and responsive keys, software techniques such as envelope detection, filtering, de-bounce and slew rate filters have to be applied, in addition to ensuring a good layout for signal acquisition. Now, the need to refresh a segmented or graphical LCD, when a user input is received, must be added to this human-interface system.

Rendering graphical constructs, such as geometrical shapes or text, onto a display, such as a TFT or OLED, has historically needed processor bandwidth. Also, consider human-interface applications that incorporate touch-screen input in addition to the graphics display and the touch-sensitive keys, such as the thermostat in Figure 1. Finally, a communication interface, such as USB, will typically be required.

Figure 1. Thermostat with resistive- and capacitive-touch technologies.
Figure 1. Thermostat with resistive- and capacitive-touch technologies.

The challenge, therefore, is to enable real-time processing of the user inputs derived from touch-sensitive keys, a touch-screen sensor and USB data communication as well as updating the display. The solution falls into two categories which are central to the underlying hardware and software.

Hardware implementation

There are a number of MCUs that combine an LCD controller and touch-sense peripheral on a single chip but, typically, the LCD controller drives a segmented display rather than a graphics LCD.

The latest generation of MCUs, such as the PIC24FJ256DA210, shown in Figure 2, takes integration to a new level by combining a graphical display controller, a USB 2.0 On-the-Go peripheral and a special analog peripheral that can be used for touch sensing. To support graphics displays, the PIC24FJ256DA210 has a built-in colour lookup table, a large 96 KB RAM, a graphics processing unit (GPU) and a direct interface to STN, TFT and OLED displays.

Figure 2. High-integration MCU with graphics controller, touch sensing and USB.
Figure 2. High-integration MCU with graphics controller, touch sensing and USB.

The large onboard RAM allows 256-colour graphics data to be stored, at 8 bits per pixel, for a 320x240 QVGA display within the on-chip RAM. Colour palettes, used in the colour lookup table, can also be switched to use a different set of 256 colours across different image frames. The GPU allows simple objects, such as lines, rectangles, ASCII text and PNG-like image decompression, to be rendered by issuing a single command. This reduces the CPU overhead to 0%.

Figure 2 also shows the charge time measurement unit (CTMU) analog peripheral. Capacitive touch-sensing is one of many applications supported by the CTMU peripheral. The CTMU provides a constant current source with a timer that can be used to charge a sensor pad. The voltage on the pad can be measured by the on-chip analogue-to-digital converter (ADC).

When a user’s finger is placed on the pad, the capacitance change at the sensor pad is recorded as a change in voltage by the ADC. In the simplest implementation, each ADC channel can be connected to a touch-sensitive key input. With 24 ADC channels, the PIC24FJ256DA210 provides sufficient


capacitive-touch channels to cover the needs of most applications.

There is one further hardware consideration: If the application has both a resistive touch-screen input as well as touch-sensitive keys, for shortcut menu functions, the graphical LCD is overlaid with a resistive touch-screen sensor. If the touch-screen controller is integrated onto the main MCU, the touch-screen sensor outputs, which are typically four or five wires, may be connected to the MCU’s analog channels. In this case, the ADC resource on the MCU is shared between the touch-sensitive key functions and the touch-screen function. The ADC measurements are used to estimate the X and Y coordinates sensed on the touch-screen.

Software implementation

Typically, the firmware for the graphics display drivers and capacitive touch-sensing will be available as separate libraries. For an effective integration of these libraries, a main routine is required, functioning like a basic real-time operating system (RTOS), to establish the priority and frequency of servicing each task.

For tasks which share common hardware resources, the main routine also needs to establish a mechanism for non-destructive updating of the control and data registers for the shared resource, prior to switching between tasks. In the example above, both the touch-screen sensors and the touch-sensitive keys feed into the ADC. The rate of sampling the ADC, the channels being sampled and the number of samples needed, differ across the touch-screen sensor and the keys. Therefore it is necessary for the main routine to save these parameters before switching between the two tasks.

Since the user may, at any time, provide input to either the touch-screen or the keys, the main routine may need to use time slicing to enable both sensors to be scanned frequently enough. The display may need periodic updates if, for example, the application is rendering animated graphics on the screen. If the display is only updated when the user makes menu selections, then there is no CPU resource contention between the touch-sensing and display-driver functions.

As the example device (PIC24FJ256DA210) has dedicated graphics acceleration hardware, time slicing between the touch and graphics functions is less of an issue. On this device, rendering a box, a line or ASCII text simply requires a single command to be issued by the CPU.

A demonstration project that showcases the integration of the touch-sensitive keys, the touch-screen sensor and the graphics display, using underlying software libraries, is available for free download with the mTouch capacitive-touch library and can be run on the PIC24FJ256DA210 development board shown in Figure 3.

Figure 3. PIC24FJ256DA210 development board with 3,2” TFT display kit.
Figure 3. PIC24FJ256DA210 development board with 3,2” TFT display kit.

There are other functions that may be integrated on a single chip, together with touch sensing. For example, the CTMU peripheral can be used for temperature sensing, medical instrumentation, time measurement or other functions. In an application such as a thermostat, it is possible to use the CTMU peripheral for temperature sensing, in addition to touch sensing, by using an external diode. Since temperature measurement only needs to be carried out infrequently, it is possible to share this peripheral across these two functions.

USB communications

Integrating USB with touch sensing is relatively easy if simple rules are followed. When the application is connected to a USB host, it goes through an enumeration phase during which the CPU bandwidth may be largely dedicated to performing the USB function.

Touch-sensing functions may be restarted in a couple of minutes, once the enumeration phase has been completed. Once enumeration is complete, the USB functions consume a very small amount of the CPU bandwidth, typically under 2%. At this point, the main routine may choose to service the USB receiver function periodically, every millisecond or so, or switch to a more interrupt-driven approach.

Many applications with touch-sensitive interfaces have begun to incorporate haptic feedback. Integrating haptics into an application is more of a mechanical challenge. Typically, haptics require a simple pulse width modulation (PWM) peripheral to drive a small vibrator or motor. It is conceivable that, in some applications, the on-chip PWM peripheral is also being used to drive an audio speaker. In such cases, an effective integration may require having separate time bases for the PWM channel that is driving the haptics motor and the one driving the audio speaker.

Conclusion

Whilst single-chip integration of graphic display and touch-sensing features can lower system cost, software complexity can be a real factor in the time to market. Implementation is simplified by selecting an MCU platform which is supported by graphics, USB and touch-sensing software libraries that have been designed and tested to be interoperable and where robust integration has been demonstrated.



Credit(s)



Share this article:
Share via emailShare via LinkedInPrint this page

Further reading:

Quad RF ADC/DAC for wideband transceiver design
Altron Arrow DSP, Micros & Memory
The AD9084 from Analog Devices integrates a quad 16-bit RF digital-to-analogue converter with a maximum sampling rate of 28 GSPS and a quad 12-bit RF analogue-to-digital converter.

Read more...
High-performance FPGA family
EBV Electrolink DSP, Micros & Memory
AMD’s Kintex UltraScale+ FPGA family delivers high-performance, mid-range field programmable gate arrays that balance price, performance, and power efficiency for demanding DSP applications.

Read more...
Compact and scalable development board
DSP, Micros & Memory
The FRDM-MCXW72 from NXP is a compact and scalable development board for rapid prototyping of the MCX W72 multiprotocol wireless MCU.

Read more...
High-performance processing for cost-aware industrial IoT
Altron Arrow DSP, Micros & Memory
STMicroelectronics has expanded its industrial processing portfolio with the new STM32MP2 series, a family of application microprocessors designed to deliver higher performance, advanced security and long-term reliability for cost-sensitive industrial IoT systems.

Read more...
Development board for secure industrial and IoT applications
DSP, Micros & Memory
The FRDM-i.MX93 Development Board from NXP is a compact, entry-level platform built around the powerful i.MX 93 applications processor, designed to accelerate prototyping and development for industrial, IoT, and edge computing applications.

Read more...
KIOXIA pioneer new 3D Flash technology
EBV Electrolink DSP, Micros & Memory
KIOXIA Corporation and Sandisk Corporation pioneered a state-of-the-art 3D flash memory technology, setting the industry benchmark with a 4,8 Gb/s NAND interface speed, superior power efficiency, and heightened density.

Read more...
Ultra-wide signal capture from a single chip
RFiber Solutions DSP, Micros & Memory
Jariet Technologies developed Electra, a chipset that enables ultra-wide, multi-function and multi-band signal capture and generation from a single component.

Read more...
High-performance processing at the edge
Altron Arrow DSP, Micros & Memory
STMicroelectronics’ STM32MP23 microprocessor is designed to meet the demands of industrial, IoT, and edge AI applications.

Read more...
High-speed Flash for system-on-chip applications
NuVision Electronics DSP, Micros & Memory
GigaDevice unveiled the GD25NE series of dual-power supply SPI NOR Flash chips, designed specifically for 1,2 V SoC applications.

Read more...
Ultra-low-power Arm Cortex MCU with FPU
Altron Arrow DSP, Micros & Memory
STMicroelectronics expanded its STM32 ultra-low-power family with the launch of the STM32U3 for cost-sensitive applications in industrial, medical, and consumer electronics devices.

Read more...









While every effort has been made to ensure the accuracy of the information contained herein, the publisher and its agents cannot be held responsible for any errors contained, or any loss incurred as a result. Articles published do not necessarily reflect the views of the publishers. The editor reserves the right to alter or cut copy. Articles submitted are deemed to have been cleared for publication. Advertisements and company contact details are published as provided by the advertiser. Technews Publishing (Pty) Ltd cannot be held responsible for the accuracy or veracity of supplied material.




© Technews Publishing (Pty) Ltd | All Rights Reserved