Using MCUs with an Embedded GPU to Get the Most Out of Display-Based User Interfaces

投稿人:DigiKey 北美编辑

Embedded systems of all types are becoming more connected and data-centric, to the point that end users are expecting high-resolution, full color displays of graphs, indicators, and even analytics. The days of simple knobs and dials for user interfaces are disappearing fast.

For designers tasked with making complex embedded systems simple and intuitive for the end user while also making them aesthetically pleasing, a lot of back-end design questions and tradeoffs need to be thought through carefully. Take resolution, for example.

High resolution translates to higher power consumption in what should ordinarily be a low-power system. Along with minimizing power, designers need to factor in space, cost, and time-to-market issues, while also selecting the optimum screen technology and configuring their system accordingly.

In many cases, embedded engineers have no experience working with LCD screens, and few embedded programmers have designed a graphical user interface (GUI). How, then, are these developers supposed to modernize their products within what are often tight time, budget, and space constraints?

Stacking the human machine GUI problems

To the end user, a graphical interface should be intuitive. For its developers, it’s anything but that. Attractive and usable interfaces can be remarkably difficult to design, calibrate, and deploy in the field. Quite apart from the sometimes non-intuitive hardware problems, there’s the issue of designing the graphical aspect of the interface itself. How should data be presented? How big should the indicators be? Is the display equally visible in bright daylight and dim conditions? Should the display update rapidly, or should it present static content that the user can easily find? Should real-time information be presented as a “virtual gauge” or dial, or is it better presented as numbers, bar graphs, or colors? All these design decisions – and many more – quickly present themselves to often stressed and inexperienced developers and their team.

Starting with the hardware seems logical enough. Decisions like display size, color support, and resolution are often decisions made by the marketing team, not the design engineers who have to deal with the repercussions. If the marketing department decrees that the LCD screen shall measure 5 inches on a side and support 16 million colors, the developers must make it so. Exacerbating the situation, the decisions regarding screen size, shape, and capability will change several times over the lifetime of the product’s development.

The good news is that there are many choices of LCD screens: several manufacturers around the world offer them in different shapes, sizes, and color depths. The bad news is there are many choices of LCD screens: different manufacturers use different interface timing, voltage levels, memory allocations, and raster scanning regimens. The interface options are bewildering, and most first-time LCD users will try to narrow their choices to one vendor’s products to minimize the proliferation of options and the level of confusion.

Most microprocessors and microcontrollers don’t have a built-in LCD controller, so selecting a compatible controller presents another design challenge. Will the controller chip support the favored LCD screen, and will it still support the inevitable next generation of displays? How much headroom for growth (or marketing-driven design alteration) does the current hardware support, and how difficult will it be to update/upgrade to the next iteration?

Once the hardware has been selected, it’s time to move on to the software development. Programming a GUI is equal parts art and science. It needs to look good, be as effective as the buttons and dials it’s replacing, and be reliable. Moving pixels around on a screen can be harder than it looks, and simple two-dimensional “flat” displays don’t look enticing anyway.

Today’s color interfaces need to “wow” the customer, even in industrial settings. Rich color palettes, sharply defined curves and shapes, accurate color representation, subtle shading, and overlapping elements are all de rigueur for a modern GUI. It won’t do to have an expensive industrial controller be less aesthetically appealing than a $99 Android tablet.  

Hardware design by the numbers

As LCD screens and graphical displays become more popular and demanding, the hardware support for them has followed along and become a bit more widespread. Standalone LCD controllers are readily available, and certain microcontroller (MCU) chips even come with LCD controllers built in. It’s just now becoming possible to design a single-chip system with MCU, LCD controller, and needed peripherals in one.

A prime example of this is Microchip Technology’s newest PIC32MZDA family of microcontrollers. Although the Microchip PIC32 family has been around for decades, the -MZDA variants are new, and the only devices in the family to include an LCD controller, analog peripherals, Ethernet, and – most remarkably – the on-chip DRAM required to contain the entire LCD screen buffer within the chip itself.

The self-contained -MZDA line of MCUs enables designers to package almost all the hardware they need in a single chip. The LCD display itself is likely to be larger than the circuit board controlling it (Figure 1).

Diagram of Microchip PIC32MZ-DA MCU family

Figure 1: A typical PIC32MZ-DA MCU family has a 32-bit MIPS processor core, an LCD controller with graphics engine, serial and analog interfaces, optional crypto acceleration, and up to 32 Mbytes of DDR2 memory for graphics storage. (Image source: Microchip Technology)

The LCD controller inside the MCU is unusually flexible, supporting virtually any LCD screen. This is a boon for first-time LCD users, as well as those who anticipate design changes along the way. Most LCD screens have finicky timing requirements, and they’re different from one screen to the next, and from one manufacturer to the next.

To simplify these interface requirements, Microchip provides a simple software configuration tool that enables LCD timing configuration “by the book.” Designers simply type in a few key parameters from the LCD screen’s datasheet, and the tool does the rest (Figure 2). There’s no drop-down list of approved manufacturers or supported screen resolutions, and no need to download the appropriate drivers.

Image of Microchip’s Display Manager software (click for full-size)

Figure 2: Microchip’s Display Manager is software plug-in for its MPLAB IDE that auto-generates driver support for LCD screens based on simple datasheet parameters. (Image source: Microchip Technology)

If there’s a change in LCD size, resolution, color depth, manufacturer, or specifications, designers can simply type in new numbers and the MCU drives the new screen. Theoretically, even new or as-yet-unknown LCD screens that haven’t been produced could also be supported, making it a future-proof LCD controller.

On-chip DRAM

High resolution and rich color depth translate to large screen buffer memory requirements. It’s not unusual for developers to set aside 10 to 20 megabytes or more just for screen buffer, not counting the system’s code, stack, and data space. That means a couple of external DRAMs or SRAMs, plus all the data, address, and control pins that go with them. Toggling external pins at high frequency also consumes energy, of course. Finally, an external RAM exposes the system to hackers and reverse engineering, as all the data must travel on external pins “in the clear,” since LCD controllers can’t encrypt/decrypt data on the fly.

Microchip’s -MZDA family sidesteps all of these problems by encapsulating 16 or 32 megabytes of DDR2 (DRAM) memory within the MCU itself. This keeps the data under cover (literally), reduces pin count substantially, and reduces power consumption. It also gives the on-chip LCD controller a performance boost, as its frame buffer is now sitting just microns away.

The chip is not limited to its on-chip DRAM. If designers feel that 32 megabytes isn’t enough, they can expand that capacity with up to 128 Mbytes of external DRAM, as with other MCUs. Of course, both the on-chip and the off-chip memory can also be used for code storage, data, stack, or any other use the programmer desires.

With that much frame buffer, the -MZDA devices can support resolutions up to 1280 x 1024 (SVGA) and 24-bit color (“true color”), in either horizontal (landscape) or vertical (portrait) orientations.

The high resolution, combined with the rich color depth, means the -MZDA devices can accurately represent company logos, render subtle shadows, display photos or photorealistic images, or match font styles. The controller also supports sprites, image scaling, transparency, convolution, image rotation, zoom, and more. To a large extent, the effects are limited only by the programmers’ imagination.

Software support simplifies graphics implementation

Realizing that many of its customers have never designed a GUI before, Microchip provides a free graphical-design tool, called Graphics Composer (Figure 3). It allows developers to create, code, and simulate their LCD display on their PC. (Since even a large-scale 1280 x 1024 LCD display is smaller than the average PC screen, the entire display fits easily.)

Image of Microchip’s MPLAB Harmony Graphics Composer software (click for full-size)

Figure 3: Microchip’s MPLAB Harmony Graphics Composer software allows developers to design and simulate their GUI before actual hardware is available. (Image source: Microchip Technology)

Graphics Composer allows developers to prototype and experiment with their chosen LCD display, or to experiment with alternative displays they might use. Does it look better turned this way or that way? Does the marketing department prefer these icons or those ones? It could even be used to do A/B testing with customers to see which GUI options they prefer.

Naturally, there’s more to programming an embedded GUI than managing the LCD itself. There’s also the MCU’s processor and its peripheral features. Microchip has that covered as well, with its popular MPLAB programing environment. MPLAB covers every PIC microcontroller the company makes with the same desktop environment. Changing chips is as simple as clicking a different configuration option. The compiler, debugger, and other tools all stay the same.

Hardware starter kits

Microchip offers two evaluation boards and a display board for the -MZDA. The two evaluation boards are nearly identical. One, the DM320010, relies on the MCU’s internal DRAM, and the other, the DM320008, supports an external 128 megabytes of DDR2 memory. An included plug-in daughter card adds an Ethernet PHY and connector. The USB interface is included on the base board, along with test headers and power connections. CAT5 and USB cables are also included in the package. Both boards are available either with or without the MCU’s on-chip crypto-acceleration features, for a total of four permutations (Figure 4).

Image of Microchip’s DM320010 evaluation board for the PIC32MZDA MCU family

Figure 4: Microchip’s DM320010 evaluation board for the PIC32MZDA MCU family includes the microcontroller itself, Ethernet and USB interfaces, and (optionally) support for cryptographic acceleration. (Image source: Microchip Technology)

The 48-page user’s guide is a free download from Microchip, as is a free version of the company’s MPLAB development software, including sample code, drivers, crypto libraries, demonstration applications, peripheral code, TCP/IP stacks, and documentation.

The DM320005-5 Multimedia Expansion Board II completes the set, adding a 4.3 inch LCD, VGA camera, 802.11 b/g (Wi-Fi) wireless module, Bluetooth, audio codecs, and more. It plugs directly into the DM3200xx development boards, so between the two, a developer has everything they need to get started (Figure 5).

Image of Microchip’s DM3200055-5 Multimedia Expansion Board II

Figure 5: Microchip’s DM3200055-5 Multimedia Expansion Board II is a ready-made LCD display compatible with the new DM3200xx development boards for the company’s new -MZDA microcontrollers. (Image source: Microchip Technology)

Conclusion

There’s no doubt that new, embedded, Internet-connected devices are proliferating and that they are getting graphics upgrades to make them more appealing and more flexible. That requires a whole new design paradigm that many experienced embedded designers and programmers are unprepared to handle. The schedules and the budgets are just as tight, but the job requirements just changed.

Microchip’s PIC32MZDA family of low-cost MCUs provide a hardware and software package that helps developers quickly and easily incorporate full color, high-resolution, highly attractive interfaces for next generation human machine interfaces.

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

关于此出版商

DigiKey 北美编辑