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:

ESP32-C6 achieves PSA-L2
iCorp Technologies DSP, Micros & Memory
Espressif Systems recently announced that its ESP32-C6 microcontroller has achieved PSA Certified Level 2 (PSA-L2) security certification, making it the first RISC-V-based MCU to reach this level.

Read more...
Microprocessor with integrated NPU
Avnet Silica DSP, Micros & Memory
The RZ/G3E from Renesas is a microprocessor integrated with quad CPU and NPU in one chip, improving power efficiency, reliability, and security.

Read more...
Nordic Semiconductor launches nRF Connect SDK Bare Metal option for nRF54L series
Avnet Silica DSP, Micros & Memory
This is a new, RTOS-independent software solution for Bluetooth LE development, designed to ease developers’ migration from the legacy nRF5 SDK and nRF52 series to the next-generation nRF54L series.

Read more...
Dual-core support in NECTO Studio
DSP, Micros & Memory
MIKROE recently announced that version 7.3.0 of its NECTO Studio Integrated Development Environment now supports dual-core MCUs, allowing designers to program and debug each core independently.

Read more...
Post Quantum Cryptographic firmware library
DSP, Micros & Memory
The STM32 post-quantum cryptographic library enables developers to satisfy application requirements for any combination of data integrity, confidentiality, identification/authentication, and nonrepudiation.

Read more...
MultiVolt series of oscillators
Future Electronics DSP, Micros & Memory
The ECS-3225MVQ from ECS Inc. is a compact, quartz-based MultiVolt oscillator designed for precision timing in automotive, industrial, and portable electronic systems.

Read more...
MCU platform for battery-powered devices
Altron Arrow DSP, Micros & Memory
The MCX W23 is a new dedicated wireless MCU platform from NXP for battery-powered sensing devices.

Read more...
Drive innovation with AURIX TriCore MCUs
Future Electronics DSP, Micros & Memory
Infineon’s AURIX TriCore family balances safety, performance, and energy efficiency to offer a scalable and future-ready portfolio.

Read more...
Elevate your motor control designs
EBV Electrolink DSP, Micros & Memory
Built on an Arm Cortex-M33 core running up to 180 MHz, the MCX A34 family combines high-performance math acceleration and advanced motor control subsystems to unlock efficient motor drive solutions.

Read more...
Embedded platform for compute-intensive applications
iCorp Technologies DSP, Micros & Memory
The Quectel QSM368ZP-WF is a fully featured embedded ARM platform optimised for compute-intensive industrial and IoT applications.

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