|
|
|
|
In this paper we briefly analyze the applicability of prototyping to some of the areas an embedded systems designer might encounter. We will review the development areas suited for prototyping, the prototyping approaches and tools available and their potential benefits and pitfalls. We will also review one user interface prototyping tool the Viper from Signum Systems in more detail. 2. The Embedded Development Cycle The development cycle in embedded systems varies. It may be highly structured, with rigidly divided phases, resembling the waterfall model of software development. It may also be evolutionary, developing the new project on the basis of other existing projects. Finally, it may also be completely chaotic, emerging as a result of an extended brainstorming session. All approaches have been known to work very well or produce disasters. Regardless of the methodology, however, all areas of the system will have to be addressed at some point during development. Hence, we will ignore the development methodology used and simply examine a hypothetical system element by element. In this section we will review the basic elements of an embedded design The elements chosen do not constitute an exhaustive list that is impossible. They do present, however, a collection likely to cover many of the designs encountered in engineering practice. Given these elements we will be able to discuss prototyping options for each of them. 3.1 Software Elements 3.2
Hardware Elements In summary, we have distinguished the following basic embedded system elements:
In principle, all of the elements we have just outlined lend themselves to prototyping. In practice, however, not all options may be available. Before we consider these options lets talk a little bit about prototyping. The easy answer is something like: rigging things together so they look like the real thing without actually doing the real thing. Sounds a bit ad hoc, but it actually covers most of the story. Lets look at the second part of that answer, which addresses a different question: 5. What is the Goal of Prototyping? The goal of prototyping is to achieve a system functionality identical to the desired system or as close to it as necessary in key areas determining system performance and cost prior to committing to a final solution. What this means is that during prototyping we modify the design to get a decent approximation of the real system at (hopefully) a fraction of the cost. This approximation may be a goal in itself, for example for the purposes of evaluating a design. The design modifications (or shifts) performed during prototyping can take on different forms, each leading to a different form of prototyping.
Given event the most rudimentary dissection of an embedded system into its components performed above and these three basic forms of prototyping it becomes immediately clear that we have quite a few choices. Any form of prototyping could potentially be applied to any of the software and hardware components of a system. Later on we will review the choices available for each element in more detail. Now, however, we will examine what issues should be considered when choosing elements to be prototyped.
Having reviewed prototyping basics we can now discuss the specific options available for each of the components of an embedded system. 7. Embedded System Component Prototyping Options Each element of an embedded systems could potentially be prototyped, using any of the forms described above. We will now consider each element of the system and review its potential for prototyping. In each case we will provide a few examples of various prototyping approaches. They are by no means exhaustive and we expect our readers will have many examples from their own experience to relate to. 7.1 Software
7.1.2 Custom Components
7.2 Hardware 7.2.1 Processor Section
7.2.2 Power Supply Section
7.2.3 External Interface Section
7.2.4 User Interface Section
8. Prototyping Tools for Embedded Systems Having described some of the prototyping options available to embedded systems developers we will now consider the tools that he or she might use during this process. There are some tools specifically aimed at prototyping we will examine one of them in more detail. Many of the general embedded systems development tools, however, can be successfully applied to prototyping. 8.1 Software Elements Some debuggers are capable of supporting different code execution environments from simulators to in-circuit emulators. Such a capability allows the system development to proceed more smoothly. Software development can begin before any actual hardware is available, using a simulator or an inexpensive evaluation board. Once hardware is available, development can shift to an in-circuit emulator. Once completed, the designers may have the option of incorporating a debug monitor into the final product allowing the debugger to communicate with the final system for testing purposes. The Chameleon Debugger from Signum Systems provides all of the above capabilities. 8.2 In-Circuit Emulators In-Circuit Emulators (ICEs) are natural prototyping tools. By their very design they are intended to allow a developer to access and manipulate objects that cannot be accessed in a standard system. An ICE provides an excellent software development vehicle it is the ultimate processor simulator. It executes native code, at real speed while providing real-time trace information and specialized hardware for the purpose of tracking down critical or erroneous code sections. Most good ICEs are capable of executing code without a target they can provide their own memory, power and clock. Sections of memory can be mapped to reside in either the ICE or the user's target (if one is connected). Some ICEs, such as Signum Systems USP-51 series, provide dual-ported memory, which can be modified while the target processor is running. ICEs can be used to prototype other system elements, besides the CPU and memory. The dual ported memory can be used to simulate memory-mapped peripherals. The real-time trace buffer in combination with the debug logic can be used to capture the values written to a certain memory location, which, again, can act as a memory mapped peripheral. Even the simplest system without dual ported memory capable of a single breakpoint can be used to stop the CPU just before it is about to read a prototyped (i.e. nonexistent) peripheral register, place the desired value in that memory location and restart the CPU. The above three-step transaction can be automated by using a command macro a simple yet powerful facility available in many systems. 8.3 ROM Emulators ROM emulators, while much more limited than ICEs, can also provide rudimentary prototyping functions. Some ROM emulators, for example the NetROM from Applied Microsystems or the PromICE from Grammar Engine Inc. provide a serial communication channel (a "virtual UART") mappable within the address space of the device being emulated. This channel can be used to simulate a future hardware channel or as an additional debugging channel. 9.
Viper 9.1 A
Sample Session with Viper |
|
![]() |
|
We are not terribly impressed, but we go ahead and write the software to support it. We do not worry, however, how the value to appear on the display actually gets there, how the progress indicator gets activated or how the power switch is read. We just assume that they are read from and written to from some variables, as they will be once our hardware is completed. For now, however, we want to concentrate of WHAT the system does, not HOW it does it. Lets assume that values to be displayed and read are declared as follows:
int displayVar; /* display
value */ Instead of spending time building a mockup of a hardware interface panel we use Viper. We start by creating a blank Viper panel: |
|
|
|
|
The icon in the lower-right corner indicates that the panel is still under construction. We drag-and-drop the controls we need and place them on the panel roughly where George wanted them: |
|
|
|
|
To make him even happier we take his sketch, digitize it and use it as a background for the panel: |
|
|
|
|
He can't say we don't use his ideas! Now all that is left is connecting each control to the appropriate variable. To do that for every control we open its property window. It allows us to set a number of appearance-related parameters, such as font, color, optional titles, etc., as well as the source-level expression each control is connected to. For display controls there is a single expression used to obtain the value to be displayed. For user-activated controls, such as push buttons or switches the expression is evaluated whenever the control is activated. Here is the property window for the display control: |
|
|
|
|
We have specified that the variable displayVar is to be displayed once every second. Similarly, we set the properties of the switch control: |
|
|
|
|
Whenever the switch is toggled to the ON position the "powerOn = 1" expression will be evaluated, whenever the switch is toggled to the OFF position the "powerOn = 0" expression will be evaluated. All that remains to make our panel functional is connecting it to a Chameleon debugger session. Each Viper panel can communicate with a different debugger session to connect we simply specify the network address of the debugger session we want a given panel to communicate with. Once activated, the panel is constant communication with the debugger, and through it with the target system. In our example, the LED display request the value of the displayVar variable from the target system via the debugger once a second. Whenever the power switch gets toggled, an appropriate expression is sent to the debugger resulting in the powerOn variable being set to the appropriate value. To complete our story, we should also mention that Jack, one of our engineers, had a different vision that he also chose to express using Viper: |
|
|
|
|
For some reason, however, our customer didn't care for either vision and chose the following solution instead: |
|
|
|
|
Using Viper we were able to show our customer the interface in action and modify it on-the-fly, without having to touch any hardware or software. The sample scenario we have just described is somewhat simplistic, yet it demonstrates many of Viper's applications and its strengths. Viper provides a rich set of user interface objects, including digital LED and alphanumerical LCD displays, toggle switches, push buttons, text logs and 2-D data plotters. |
|
|
|
|
Since Viper operates by sending commands to a debugger, it is not limited to the display and setting of user variables it has access to all functions of the debugger. It can be used to develop a completely custom debugger user interface, including CPU start, stop and reset controls or controlling the real-time trace buffer of an in-circuit emulator: |
|
|
|
|
This can be useful in testing applications, where only relevant controls and feedback information need to be provided, without exposing the operator to the complexities of a source-level debugger or an ICE. We haven't explored all of Viper's features and applications. If you would like more information, please visit the Signum Systems web page at http://www.signum.com. In this article we have discussed some of the prototyping options available to embedded systems designers. We didn't hope to exhaust the subject that wasn't our goal. We have tried to bring to our readers' attention the possibilities for reducing the development effort through prototyping a generally simple yet often overlooked alternative. |
|
Viper and Chameleon Debugger are trademark of Signum Systems Corporation. Other brands and products are trademarks of their respective holders. |
|