Graphics Libraries Support Complex GUIs on MCUs with Integrated LCD Controllers

作者:Maury Wright

投稿人:电子产品

More and more microcontrollers (MCUs), in both the 16- and 32-bit space, offer integrated graphics controllers that can drive relatively-high-resolution LCDs. Moreover, many 32-bit MCUs have the bandwidth to handle graphics in the CPU. Indeed MCU-based designs can readily support VGA-level graphics or beyond. Taking advantage of graphics capabilities, however, can be extremely time consuming in the development cycle.

Even embedded applications in industrial and other segments far from the living room can benefit from a GUI. But many electronic engineers do not have experience developing GUIs. Fortunately the MCU vendors are offering in-house-developed and third-party tools and libraries that simplify the process. Let's examine some mainstream MCUs with graphics capability and the tools you might leverage to quickly develop an easy-to-use and compelling user interface.

Let's start with a look at a 16-bit MCU that includes a graphics controller designed to accelerate the drawing of typical 2D objects. Microchip integrated the controller depicted in the block diagram in Figure 1 in the 16-bit PIC24FJ256DA210 MCU. The controller relies on three Graphics Processing Units (GPUs) to off-load pixel-processing tasks from the CPU. The Character Graphical Processing Unit (CHRGPU) serves primarily to render text and other characters. The Rectangle Copy Graphics Processing Unit (RCCGPU) operates on shapes. The Inflate Processing Unit (IPU) handles decompression of the data used to represent objects in a compacted format.

Microchip's graphics controller

Figure 1: Microchip's graphics controller, which is integrated in some 16-bit PIC24F MCUs, includes three graphic processing units.

In operation, the MCU simply issues high-level commands to the GPUs. The GPUs then execute the graphics operation in parallel with the main CPU running application code. The GPUs can directly access frame–buffer memory either on the MCU or via a dedicated interface to as much as 16 Mbytes of off-chip RAM.

Microchip graphics library

While the dedicated graphic hardware allows the 16-bit MCU to render compelling images at run time, the development of the software is a challenge. Microchip offers two software-development products that can greatly simplify such a development project. First, the company offers the Microchip Graphics Library. Figure 2 depicts the layered structure of that library. The library supports multiple fonts and languages. It includes common graphics objects and can support the use of images and animations. Also, it includes support for touch-based displays for user control.

The free Microchip Graphics Library

Figure 2: A graphics library, such as the free Microchip Graphics Library, can accelerate the design cycle for GUI-based systems with built-in support for common objects such as buttons and sliders.

As you can see from the layered diagram, the library includes support for objects such as buttons and slider controls at one level and that capability is built upon a set of graphics primitives. Still, a design team would spend considerable time developing the application code for a GUI. And for that purpose, Microchip offers the Microchip Graphics Display Designer (GDD) tool.

The GDD visual tool includes the ability to draw and manipulate screen objects. For example, it can create, size, and delete objects. The tool also handles all object placement so that the software developer does not need to worry about the screen coordinates of an object.

Microchip provides the Graphics Library and the GDD tools free to customers. You can use the tools with any 16-bit Microchip MCU that includes a graphics controller. That includes the PIC24F family members, which also include DA in the model number. You can also use the tools with the entire portfolio of 32-bit MIPS-based MCUs that comprise the PIC32 family. Those products do not include a dedicated graphics controller, but the CPU is capable of rendering a GUI and handling a typical application program.

In the 16- or 32-bit case, the Microchip MCUs can support 640 x 480-pixel VGA resolution, although 240 x 320-pixel QVGA designs would be more common in part due to frame-buffer size. Design teams that want to jumpstart a graphics-oriented project can turn to development boards offered by Microchip. The DM240312 development board is based on the PIC24FJ256DA210 and can be used with a number of LCD displays specified by Microchip. The DV164039 development kit, meanwhile, includes the DM240312 board, a 3.2-in. 240 x 320-pixel display, and other accessories that will allow a design team to prototype a complete GUI-based application.

ARM-based MCUs

Now let's take a look at how you might accelerate a GUI-based design using an MCU based on the ARM architecture. A number of companies have adopted various ARM cores as the basis for 32-bit MCU offerings. For example, Freescale uses the Cortex-M4 core as the basis for its Kinetis family of MCUs. STMicroelectronics is using the Cortex-M0, -M3, and -M4 cores across its STM32 MCU family. Texas Instruments is using the Cortex-M3 in its Stellaris MCU family. NXP is using the Cortex-M0 core in its LPC11xx and 12xx families and the Cortex-M3 in its LPC13xx, 17xx, and 18xx families.

The broad industry support for ARM cores provides a key advantage when it comes to developing GUI-based applications. There is a quickly growing ecosystem of third-party technology that supports almost every element of ARM-based system development, and the graphics area is no exception.

NXP, for example, recently announced that it would provide a third-party GUI development tool free to its ARM-based MCU customers. The company signed an agreement with Segger Microcontroller to offer the emWin graphics library across its ARM portfolio.

The emWin library supports a variety of LCD types ranging from monochrome to full color and is configurable for different display sizes. The software supports anti-aliased text and shapes. A design team would typically partition the GUI part of the development process relying on the standalone emWin tool and in fact the application and GUI developments can run concurrently. Figure 3 is a screen shot of the emWin tool.

NXP emWin graphics library

Figure 3: NXP is offering the emWin graphics library from Segger Microcontroller to customers of its broad portfolio of ARM-based MCUs including products based on the Cortex-M0, -M3, and -M4 cores.

 While NXP will supply the tool across its ARM product line, the company has also pointed out that emWin is a good match to the LPC178x family of MCUs. That family of Cortex-M3-based products integrates a dedicated graphics controller. The controller has direct access to frame-buffer memory via a master implementation of ARM's Advanced High-performance Bus (AHB). Setup and control is handled via a slave AHB interface. The controller can support single- or dual-display applications with resolutions as high as 1,024 x 768 pixels.

Lower cost

The combination of faster, more-capable MCUs, dedicated graphics controllers in some cases, and easy-to-use GUI development tools is fundamentally changing the embedded-system-design landscape. Not every application requires a GUI, but a compelling user interface can add value in many applications. In the past however, developers have often turned to simpler user interfaces to save money – the cost of hardware that could host a GUI and even more so the cost impact to the development cycle. You can now consider a GUI on systems that use low-cost MCUs with access to free tools and truly optimize a system design for the application at hand.

免责声明:各个作者和/或论坛参与者在本网站发表的观点、看法和意见不代表 DigiKey 的观点、看法和意见,也不代表 DigiKey 官方政策。

关于此作者

Maury Wright

Maury Wright is an electronics engineer turned technology journalist and industry consultant with broad experience in technology areas ranging from microprocessors to digital media to wireless to power management. Wright worked at EDN Magazine for 22 years, serving as editor-in-chief and editorial director for five years. Wright also served as editor of EE Times' Digital Home and Power Management websites.

Currently, Wright is working as a consultant for a number of technology companies and writing under his own byline for the Intel Embedded Community website and for LEDs Magazine.

Wright has won numerous industry awards, including ASBPE national wards for EDN's 50th Anniversary Issue and a similar award for the EDN Prying Eyes department. Wright is an expert in the area of digital media and the connected home, having covered the wired and wireless service-provider and in-home networks extensively. This expertise extends from processors and ASSPs all the way up through the end application. Wright graduated from Auburn University in 1978 with a BSEE and a curriculum emphasis on digital design and development with early microprocessors.

关于此出版商

电子产品

《电子产品》杂志和 ElectronicProducts.com 网站服务于负责电子设备和系统设计的工程师和工程管理人员。