Windows CE
on an Embedded PC
 
Written July 7, 1998
by Warren Postma
Introduction

My employer produces Remote Monitoring and Control Products. Like most of the industry, we started out using Programmable Logic Controllers (PLCs) as the heart of our products.   Other similar products used PLCs as well, or else they used proprietary micro-controller boards, usually designed in house or sold by a single manufacturer.  There are still a lot of proprietary hardware devices used in this field running specially designed hardware, and totally custom software.  These systems can be expensive to purchase and support, and are often very limited in their capabilities.  The success of the PC Compatible marketplace demonstrates that an open technology will always do better than a monolithic closed technology in the marketplace. Software and hardware designers need a choice. Even now, most control systems use a wide variety of closed and uncooperative technologies that limit the flexiblity and reliability of control system solutions.

We have noticed that this trend is now starting to reverse itself.  The introduction of Windows CE appears to be a catalyst in the controls marketplace.  Controls system vendors are starting to sit up and take notice.  Already the PLC marketplace is drying up, as control product designers seek more standardized hardware, and software.  Many engineers are looking to embedded computers to replace PLCs and other proprietary devices.

Embedded DOS Compatibles

In the last five years embedded DOS compatibles have been available as PLC alternatives. We started using them in our products about three years ago. These computers are much smaller than typical desktop computers, and they are designed to be compatible with the software, hardware, and programming tools most people already use on their desktop PCs.   We found it very nice to be able to write code for our embedded controller using the same Borland C++ compiler and DOS C libraries that we used for writing regular DOS programs.  With some work, all the development and most of the testing can be done right on a regular desktop PC, and only integration testing needs to be done on the actual target device.  In addition, very little storage was required to provide these systems, and they could be made to withstand harsh temperatures, shock and vibration by not using floppy or hard drives. The machine boots an MS-DOS compatible operating system from a ROM, and mounts a Flash ROM as a solid state disk drive. The application program loads and runs from as little as 256K of Flash ROM. When the application runs it has access to RAM disks and ROM disks instead hard drives, but very little needs to be written differently to make the program operate on the embedded device.

Unfortunately, DOS is very limited.  DOS has only 640K of directly accessible memory, uses a segmented memory architecture that sometimes gets in the way, it doesn't provide any multitasking, and has generally poor networking abilities.  However, because of it's size and the fact that most manufacturers still provide it in ROM, it is still the defacto choice for embedded controllers.

Other Options

QNX, VXWORKS and other realtime operating systems are available from some vendors for use on PC Compatible hardware, but both of these mean leaving the familiar world of DOS behind, and learning a new operating system, C compiler, debugger, and libraries. Development is either done by booting the operating system on your own PC, or else by using a cross compiler with remote debugging tools.  We would have probably adopted QNX if we really needed it's realtime performance and native networking, but we avoided taking the plunge because of the learning curve.

Other operating systems that run on PC compatible hardware can be run, but none of them are ideal for small embedded systems. Some embedded CPUs have enough RAM, speed, and storage to run Windows 95 or even Windows NT, but this is not always practical.  If flash storage must be used, then storage space is at a premium. A 16 MB flash disk card still costs more than a 4 GB conventional hard drive.  Clearly, it is not very feasible to load Windows 95 or NT onto a system that can't have a hard drive, due to space or environmental conditions. Even if you could run it, Windows 95 would be a poor choice for embedded systems. It is large, unstable, and it still depends heavily on code left over from MS DOS.  Some companies have made good progress with stripping down Windows NT for embedded use with as little as 8 MB of Flash space, but that is still too large for many embedded systems.
 

Windows CE

Like most people, I first heard about Windows CE as an operating system for handheld computers.  Although the first wave of Windows CE devices (running CE 1.0) had much in common with embedded systems, such as limited file storage space, no moving parts or magnetic media, and ability to run on battery power, they had little in common hardware wise. Some thought had been given to embedded use for Windows CE even in the first version, but not for use on small embedded PC compatibles.  Unfortunately for those who were hoping it would, Windows CE 1.0 did not support the Intel x86 processor family. It was however designed as a very small and modular system and support for multiple processors was there even in the first version.  The most visible aspect of Windows CE was the Windows-95-like user interface, but unfortunately that lead people to think of Windows CE as a stripped down version of Windows 95.  Microsoft maintains that Windows CE is really a completely new technology, and that it has more in common with Windows NT that Windows 95.   For example, Windows CE achieves a great deal of hardware and processor independance through the use of a HAL (Hardware Abstraction Layer), an architectural detail borrowed from Windows NT.  Some things are completely redesigned.  For example, Windows CE does not even use drive letters anymore.  All storage on a Windows CE device is part of a single file system, which more like Unix than either Windows 95 or NT.  Even the user interface components which look like Windows 95 were implemented as optional modules. The designers gave some thought to the possibility of a device running Windows CE with no display at all, or with a customized display system that worked nothing like Windows 95.

The development environment is very powerful. Microsoft Visual C++ is the leading programming tool for 32 bit desktop applications.  An add-on toolkit containing the Windows CE SDK, and cross-compilers for the non-Intel processors that CE was designed to support is all you need to start writing applications to run on a Windows CE machine.  For applications writers targeting the palm and handheld PC market, this was something of a revolution, because the APIs that Windows CE uses are largely compatible with the standard Win32 APIs used by Windows 95, Windows 98 and NT.

A few people inside and outside Microsoft saw the obvious potential for use on x86 systems and other embedded hardware. Windows CE 2.0, which included support for x86 code generation, and a simulation environment that would run Windows CE applications on your Windows NT desktop was already most of the way to an embedded solution. Shortly after the release of Windows CE 2.0, Microsoft released the Windows CE Embedded Toolkit, which was designed to bring the powerful tools Microsoft created for Windows CE to the embedded market.  A kernel build utility allows boot images and ROMs to be made to boot Windows CE on a custom embedded device, or on a standard PC compatible 80486 or Pentium CPU board.  Unfortunately for those who already have hardware out in the field, the 80386 and other old Intel CPUs are not supported.

Windows CE also supports pre-emptive multitasking, and supports TCP/IP over ethernet networks, and PPP dial-up connections.  It includes a rich set of services, including a structured object-oriented file storage system, and if desired, a full Windows graphical user interface.

For use in timing-important control sytems, Microsoft has stated that Windows CE is suitable for soft-realtime systems, and that a future release will provide the sub-50 microsecond interrupt latency required for hard realtime systems.

Although much needs to be done in proving and applying Windows CE, it is clear that Windows CE is poised for great success in the embedded marketplace.  Our systems, which are still PC hardware based for now, will also be able to shed processor and hardware restraints in the future, because of the portability of Windows CE solutions to mulitiple hardware types.  More applications for embedded computing will become cost effective, as prices go down and features increase.  Windows CE may well drive forward the use of embedded PC technology in all areas of automation and control systems.   Although I don't believe that PLCs and proprietary controllers will entirely vanish, I would not be too surprised to see a PLC running Windows CE in a year or two.


Some Further Reading:
Microsoft White Paper on Windows CE for Embedded Systems
Press Release: Hard Realtime Extensions for Windows CE Announced
Microsoft Product Pages:
Windows CE
Windows CE Embedded Toolkit (ETK)
 

Product and company names used in this document are registered trademarks of their respective owners.