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

Event
SAE World Congress & Exhibition
Authors Abstract
Content
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.
Meta TagsDetails
DOI
https://doi.org/10.4271/2009-01-0273
Pages
7
Citation
Yang, J., Bauman, J., and Beydoun, A., "Implementation of Software Timers in Model-Based Design for Body Control Software Applications," SAE Int. J. Passeng. Cars – Electron. Electr. Syst. 2(1):87-93, 2009, https://doi.org/10.4271/2009-01-0273.
Additional Details
Publisher
Published
Apr 20, 2009
Product Code
2009-01-0273
Content Type
Journal Article
Language
English