Browse Publications Technical Papers 2009-01-0273

Implementation of Software Timers in Model-Based Design for Body Control Software Applications 2009-01-0273

Selecting a proper implementation method for software timers in automotive body control applications is one of the crucial steps in the process of software development. We found it particularly true when model-based design (MBD) methodology and automatic code generation techniques are utilized. From our past experience and lessons learned, we have noticed that many software defects are primarily due to inappropriate implementation of software timers.
Generally, in model-based design, three options are available for implementing software timers in the application layer of a standard embedded software architecture: (a) the timers are implemented using temporal logic functions furnished in modeling toolsets (e.g., the “after” or “before” functions in Stateflow® of MATLAB® tools), (b) timer functions are hand-coded as custom C functions that are called from feature models in which timing is independent of the calling rates, and (c) custom counters are directly employed to count external timing events.
In reality, technical challenges manifest themselves in later development phases when pieces of auto-code generated from feature models are integrated and all timers are physically driven by system clocks inherited from hardware timers of a microcontroller. Moreover, it is usually the case that time-out parameters for timers are required to be configurable and the calling rate of a functional model containing software timers needs to be adjusted during software integration. This will even add more complexity to timer designs. In this work, the MathWorks’ toolset including Simulink®/Stateflow® and Real-Time Workshop Embedded Coder® was used. The methodology introduced in this paper has been successfully applied to production projects.


Subscribers can view annotate, and download all of SAE's content. Learn More »


Members save up to 16% off list price.
Login to see discount.
We also recommend:

Integrated Modeling and Analysis of Automotive Embedded Control Systems with Real-Time Scheduling


View Details


Development of a Latency Optimized Communication Device for WAVE and SAE Based V2X-Applications


View Details


Demonstration of Automotive Steering Column Lock using Multicore AutoSAR® Operating System


View Details