Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Bailey O.H.Embedded systems.Desktop integration.2005

.pdf
Скачиваний:
70
Добавлен:
23.08.2013
Размер:
9.53 Mб
Скачать

150

Chapter 5 / Developing the Desktop User Application

 

 

due to the integration of the editor and debugger within the C++BuilderX product. It is worth noting that the Intel C++ compiler is included with C++BuilderX.

C++BuilderX scores slightly higher alone than when used with the Intel C++ compiler. This is due to the additional support for Microsoft C++ 6 and 7 and GNU C++ (3.2.3), and the inclusion of the Intel C++ compilers for Windows and Linux. In both evaluations we used wxWindows as the cross-platform GUI builder of choice.

We wrap the highest scores up with Delphi/C++Builder/ Kylix for Windows/Linux. These products work identically when using the CLX (Cross-platform Libraries) on Windows and Linux. No other tools include a compiler, debugger, visual designer, and visual libraries for both platforms with support for a singlesource code base.

And the Winners Are…

We are going to take two different approaches for the prototype development. Our first approach is to use commercial products

— the Delphi/C++Builder/Kylix combination. By using the visual design capabilities of these products and the cross-plat- form support for the visual components, the majority of our work has been greatly reduced. Our second approach is to use the personal version of C++BuilderX with the GNU compiler suite, and wxWindows. In deciding to use wxWindows there were several factors to consider. Qt, wxWindows, GTK+, and Zinc are all great tools. While Zinc is very well documented and mature, it is not currently being publicly supported and that means any problems encountered will be left to our developers to fix. Qt is also a great product with excellent documentation and support. If we needed support for the Macintosh, this would certainly give Qt an edge, but to produce the prototype we want to keep our costs down. Remember, we have not decided at this point if the same tools used in the prototype will also make the final product. If we choose to sell a prototype and use the noncommercial version of

Chapter 5 / Developing the Desktop User Application

151

 

 

Qt, we will end up violating the license agreement and be required to purchase the Qt libraries. wxWindows is available on all the required platforms. It also supports the Macintosh should support for that platform be added at a later time. While wxWindows does not include a visual forms designer, several are available for minimal cost. wxWindows is also included in the preview edition of C++BuilderX. This means in a short time there will be a commercial product that offers wxWindows support from both a visual design view and on the source code level. The personal edition of C++BuilderX allows us to sell a prototype without being in license violation. If we like the product we can simply purchase the product and enjoy the additional features and compilers included with the commercial license.

While GTK+ may work, the learning curve of the libraries and becoming familiar with the visual designer would take more time than the other chosen solutions. This is still a very good alternative to explore for future projects. While we are not officially developing for the .NET framework, we will explore whether a single application can be run in both Windows and UNIX. This information will be used for future development and would allow Internet integration of programs with minimal changes.

Chapter Summary

In this chapter we’ve examined our options for cross-platform development. Much to our surprise, we have found there are many options when choosing a cross-platform workbench. We’ve also learned that direct costs of a product can quickly be offset by support or documentation issues. If an average developer makes $20 to $30 an hour, it doesn’t take long to recover the cost of a commercial product in support or documentations issues. Finally, we can see that product licensing can affect the end cost of a product development cycle by thousands of dollars. Project

Chapter 5

152

Chapter 5 / Developing the Desktop User Application

 

 

requirements play a big role in the tools needed to do the job right. Had our requirements been different, the tools selected for our workbench would also have been different. The next chapter is a recap of our design.

Chapter 6

Final Design

Overview

Everything we’ve learned so far will be applied in this chapter. The result will be the master design document and master flowchart. This will serve as a summary of Chapters 1 through 5. The next chapter begins Part II, where we will build the embedded system and actually integrate it to the host systems.

Master Design Document

Purpose

This document will serve as the verbal road map through the development process. It provides the guidelines and standards to which the end product will be developed and measured. We will begin with the design definition of the embedded system, followed by the host interfaces, host integration design, user application design, and protocol design. Each interface will be covered in depth, as will hardware definitions and component selection for each chosen processor. The master flowchart will follow the design documentation.

153

154

Chapter 6 / Final Design

 

 

Embedded System Final Design

Design Overview

This product is designed to monitor and control temperature and air flow within a given area. This area can be a room, a group of rooms, or a complete building. Each system will manage a given zone and control airflow and temperature through single or multiple temperature inputs. Each unit can perform alone or as part of a group, or interact with a host computer running Windows, Linux, or UNIX. This product will have the following features:

Independent microprocessor control

Remote temperature monitoring capabilities

High and low temperature thresholds used as reporting triggers

Multiple temperature sensor input

Optional fan control outputs

Network capabilities

RS-232 serial interface support

USB interface support

Ethernet interface support

Onboard time and date management

Battery backup option

Future expansion pins

Optional software development kit

Host integration software support for:

Windows 2000

Windows XP

Chapter 6 / Final Design

155

 

 

Linux

FreeBSD (UNIX)

Our research indicates a wide variety of products are suitable for this type of system. Each component and tool has associated benefits and costs in terms of technology, time, and learning curve.

After a close review of these components and tools we have decided to build three prototypes. Each will use a different processor, USB, and Ethernet interface. Each of these three prototypes will incorporate RS-232 serial interfaces, USB interfaces, and Ethernet interfaces. Three processor platforms have been chosen for the prototypes. They are:

The BASIC Stamp 2p from Parallax

The dsPIC from Microchip

The PSoC from Cypress MicroSystems

These three processors offer a variety of cost and development benefits that range from high-level language support and integrated interfaces to dynamically configurable hardware.

External Device Interfaces

Due to current market, legacy support, and emerging technologies, three different hardware interfaces have been chosen for host communications. They are:

RS-232 serial communications

Universal serial bus (USB)

Ethernet

Each prototype will support each of these three interface methods. A wide variety of commercial products were evaluated. After a close inspection of cost and development effort, the following three products have been chosen for the prototype. They are:

Chapter 6

156

Chapter 6 / Final Design

 

 

USB-232M from FTDI

PIC 16C765 from Microchip

EZ-USB from Cypress MicroSystems

Each of these devices has a different cost or development benefit associated with its use.

Three different approaches using two different types of Ethernet hardware will be used. They are:

Ethernet Development System from NetBurner

Embedded Ethernet from Systor

The NetBurner product uses an AMD Ethernet chip coupled with a Motorola Coldfire processor. While using a second processor may seem redundant, this does provide expansion capabilities. Again, we have chosen this as a launch pad for our prototype. There are several other microprocessor manufacturers that have embedded Ethernet. The choice was made by a combination of costs, functionality, and usable features for our product. We have consciously chosen to use microcontrollers instead of microprocessors due to pin count and intelligence. While microprocessors offer more in intelligence and expandability, they also contain much more power than needed in this project. Due to the added complexity, simpler products were chosen as a development platform.

Temperature Measurement

Since a major function of this device is temperature measurement and the ability to read multiple temperature sensors, the Dallas DS1822 1-Wire sensor was chosen for the prototype. This device was chosen because it is a part of the 1-Wire network product line that allows multiple devices to be attached to a single pair of wires. The 1-Wire scheme also allows additional sensors to be added on the same bus, conserving components and board space. While the 1-Wire protocol is complex, it is reliable and other device types that support the 1-Wire bus can be added without additional hardware. In short, the 1-Wire is mostly

Chapter 6 / Final Design

157

 

 

software dependent once the hardware interface has been refined. Other 1-Wire temperature sensors can replace the DS1822, providing higher temperature resolution without any hardware changes. This allows us to offer a variety of products with varying degrees of temperature accuracy without any hardware changes at all.

Output Display

The system communicates with the user through a 2-line by 20-character LCD display. A keypad is used to edit and update system parameters. There are also two LEDs for displaying temperature alarm and power conditions. A red LED is turned on when a temperature limit has been exceeded. A green LED indicates that external power is being provided to power the unit.

User Input

User input is accomplished via a seven-key keypad. There are three control keys and four cursor keys. The control keys are:

Function/Menu

Set/Select

Clear

The four cursor keys are defined as:

Up Arrow/Increase

Down Arrow/Decrease

Left Arrow

Right Arrow

Chapter 6

158

Chapter 6 / Final Design

 

 

Command Mode

To view or change a setting, the user will press and hold the Function/Menu key for five seconds. When command mode is entered the unit will sound a single beep through the internal speaker. Command mode is exited automatically upon 30 seconds of keyboard inactivity. Any changes not saved with the Set key are lost upon leaving command mode.

Menu Navigation

Once command mode is entered, a main menu will be displayed. Each menu selection is identified by a single uppercase letter. The currently defined selections are:

Time — Set time of day

Date — Set current date

Interface — Choose host interface

High Temperature — Set high temperature alarm

Low temperature — Set low temperature alarm

Exit Command Mode — Return to display mode

Sensor Reset — Reset temperature sensor network

Unit Reset — Reset entire unit

Cursor movement is obtained via the up, down, left, and right arrow keys as shown in Figure 6-1.

Figure 6-1

Chapter 6 / Final Design

159

 

 

To change or view a specific function, press the left or right arrow keys to highlight the letter that identifies the chosen function and press the Set button. A new menu will be displayed with only function-dependent features.

Following is an illustration of the control keys.

Figure 6-2

After entering command mode the display will look similar to the following:

Figure 6-3

Once again, the left and right arrow keys move the cursor over the various selections. When the cursor is over the selection you wish to view or change, simply press the Set (or Select) button to display the menu for that selection. The following sections explain each menu selection and available choices.

Chapter 6

Соседние файлы в предмете Электротехника