CMP EMBEDDED.COM

Login | Register     Welcome Guest  
HOME DESIGN PRODUCTS COLUMNS E-LEARNING CONFERENCES CODE FORUMS/BLOGS NEWSLETTERS CONTACT FEATURES RSS RSS

An architecture for designing reusable embedded systems software, Part 1
Want to make your application software more reusable? Don't change the hardware, operating system, or your tools. Instead change the architectural framework within which you do your design.



Embedded.com

When applying this model to an antilock braking system (ABS) on an automotive vehicle (see Figure 2), the outer layer is the level that the user interacts with the system. The main input at this level is the brake pedal that translates the force applied at the pedal to braking torque at the wheels. The core software determines if a wheel lock-up is imminent and regulates the individual wheel brake pressures to maintain the maximum traction forces at the tire-to-road contact patch. The perceived system behavior is added stability, increased steering ability of the vehicle, and in most cases, reduced stopping distance.

The hardware layer that interfaces to the core processor consists of four wheel-speed sensors and valves at each of the wheels to regulate the brake pressure. The hardware layer may also contain a communication interface for system diagnostics. The electronic control unit and the microcontroller(s) make up the processing intelligence for the system. Keep in mind that the interface layer is hardware dependent. The interface layer handles the methods for transferring the information necessary to the core software and for converting the core software's calculated output signals into a usable signal by the various peripherals that drive the loads.

For example, an accelerometer sensor signal supplying a voltage that is proportional to an acceleration, given in either meters/sec^2 or units of gravity (Gs), would have a specification that translates voltage into acceleration. A one-volt signal might be equivalent to the sensor measuring 1G. The interface layer would convert a voltage from the analog signal to a mathematical unit of measurement that best represents the desired signal. Since many systems are designed around a fixed-point central processing unit, the interface layer should also be responsible for taking the "real" units signal and converting it into a scaled integer value that is easily processed by the microcontroller.

The same approach can be taken for an output variable calculated by the core software. For this example, let's assume that the core software calculates a desired current that flows through a solenoid/load that is controlled within some desired tolerance. The output from the core software is a current value that is desired to flow through the solenoid/load. The hardware-software interface circuit may consist of a pulse-width modulated output port from the microcontroller that regulates the current through the load by modulating the on/off time for the solenoid. Therefore, the output from the core software is in units of current (amps), which the interface software takes and converts into the required pulse-width modulated signal, in percent on-time or duty cycle, for achieving that current.

Table 1 defines a few systems' hardware layer, interface layer, and the core software responsibility.

View the full-size image

If the software architecture takes on the defined structure that is illustrated in Figure 3, the core software can be designed to be independent of the hardware implementation. It's still necessary to define the input/output ranges and resolution requirements for processing the data. This is especially important when designing a system that is base on a fixed-point processor. When using a floating-point processor, the interface layer is a simple conversion layer that takes a raw measured signal and converts it to a desired unit of measurement.

View the full-size image

1 | 2 | 3

Rate this article: Low High
Current rating
  • .
Embedded.com Career Center
Looking for a new job?
SEARCH JOBS

Browse all jobs

SPONSOR
RECENT JOB POSTINGS





 :