摘要
为实现高效的代码编写和方便的系统维护,在前期研究工作的基础上,利用Matlab 7.x的Stateflow工具箱,实现了基于MSP430单片机的嵌入式系统软件开发.首先,对嵌入式系统进行基于事件驱动的建模与仿真.然后,在状态图代码生成器(Stateflow Coder)中把状态图(State chart)翻译成高效的C语言代码.最后,用基于MSP430单片机的目标系统底层驱动函数与翻译的C语言空函数进行简单替换,实现了嵌入式系统软件代码的快速生成.对比实验表明,用本文方法生成的软件代码,在嵌入式目标系统中运行状况良好,其易维护性和执行效率等方面均优于手工编写的代码.
In order to get high efficiency of code design and convenience of software debugging,based on the analysis of relevant research before,the development of the embedded system software of MSP430 was realized. Firstly,using Matlab/StateflowToolbox to model and simulate the complex event drive in the embedded system was introduced. Then using coder the stateflow was translated into high efficiency C code. By making some simple replacement to the blank C function generated with the low-layer function of the target system based MSP430,the code rapid generation of the embedded software was finished. Experiment show that the automatically code generation works well in the embedded target system. It has good performance and high code efficiency than those code generated by hand .
出处
《天津科技大学学报》
CAS
2010年第3期61-65,共5页
Journal of Tianjin University of Science & Technology
基金
天津市高等学校科技发展基金资助项目(20080808)