节点文献

一种应用于汽车ECU的通用底层驱动软件设计

A Common Used Low-level Driver Software Design Used in Automotive ECU

【作者】 杨佳宇

【导师】 秦贵和;

【作者基本信息】 吉林大学 , 软件工程, 2011, 硕士

【摘要】 随着现代汽车技术发展,研发者对于动力总成的功能需求越来越高,传统的纯机械式控制系统已经逐渐淡出历史舞台,取代其地位的是电控的车身动力总成系统。电控系统可以通过其强大的采样能力采集转化为电信号的其他物理量,同时对于时间控制能力比传统的纯机械式系统更为强大。在这样的时代背景下越来越多的工程师加入了汽车电子的队伍,并逐渐分化为了驱动层工程师和应用层工程师两支队伍。应用层工程师负责控制策略的制定,他们使用成型的底层驱动以构筑拟定的策略,他们不需要对于驱动程序的具体实现有所了解而只关心其是否能够实现既定的功能。驱动层的工程师负责根据具体的单片机机型以及应用层工程师的需求编写底层驱动程序,支持应用层工程师的开发工作。本文作者针对汽车电子领域应用层软件开发者的实际需求,对飞思卡尔MC9S08SG8型单片机的使用手册进行了研究,综合考虑实际硬件连接环境,并借鉴AUTOSAR架构及其他架构的成型代码,在该机型单片机上开发了一套底层通用驱动软件,该系列软件包括时钟模块、AD转换模块、AD比较模块、IO模块、实时时钟模块、定时器模块、SPI模块、FLASH模块的驱动。对于模块的寄存器功能作者加以了分析,对于具体的函数的参数及功能设置,作者给出了合理的解释,并以流程图的形式加以说明。本文实现的驱动覆盖了已有需求提出的所有模块,具备了驱动平台的完备性,同时作者考虑到长远的需求,对未有明确需求的模块也进行了合理的开发设计。在研发过程中考虑到实际使用中驱动程序往往以库文件形式交付应用软件开发者,加强了对于错误输入值的检测及反馈体系。在对于AUTOSAR架构的学习中,作者引入了DET功能,并可以使用宏定义取消该功能,方便了开发调试。同时作者对于从设备的SPI模块进行了较为深入的思考和研究,对比总结了两种方案的优点及不足,选择了合适的实现方法。对于AD采样模块,作者设计了自检功能,并根据需求实现了可选择的简单的滤波算法。基于安全性的考虑,作者对于实现的代码进行了较为严格的测试,测试内容包括边界测试和功能测试。经测试,所编写代码符合设计初衷,可以交付使用。本文提出了一种对于汽车电子ECU底层驱动程序的设计实现,该实现具有一定的完备性和实际应用性。本文对于各个模块及其寄存器的分析对于后续同机型开发者有一定的参考作用,其中对于SPI模块的思考有一定的创造性,符合特定需求下的开发需要。

【Abstract】 With the development of modern automotive technology, developers demand for better performance of powertrain functions, the traditional purely mechanical control system has been gradually fading out the stage of history and the electronic control systems take its place. The electronic control System is able to collects and samples other physical quantities into electrical signals, while the time control ability is more powerful than the traditional purely mechanical systems. In this background condition, more and more engineers took part in the development of automotive electronics, and gradually differentiate to driver engineers and the application-level engineers. Application-layer focuses on control strategy, they use the underlying drive to build the development of strategies. they do not need to know the detail of the drivers, and care only about their ability to achieve the established functions. Driver level engineers write low-level drivers to support the development of application-level engineers depending on the MCU hardware and application layer requirements.The author studyed the datasheet of the freescale MCU MC9S08SG8 focused on the need of the developer of the automotive electronic area. considering the real hardware conection environment, referring to the AUTOSAR driver structure and driver of other structures to design a series of basic driver software of the MC9S08SG8 ECU. including clock module. AD module. ACMP module.IO module. RTC module. MTIM module. SPI module and Flash module. The author analysesd the register of the modules and gave introduction and flow chart of the functions.The driver designed by the author covered the existing need of the user, which made it a complete driver platform, while the author considered the further need of the user and designed the drivers of the modules which is not ordered.Considering that in real condition the drivers are handled to the users as a library, the ability of checking error input value and return errors are improved. As the result of studing Autosar structure, author took in the DET function to facality the development of driver users.which can be disabled by Macro settings.The author researched on the SPI slave mode and compared two strategy of slave working mode, and a choice was made between them. The author also designed a self_test function and a filter function for the AD module. As the security of code is considered, the author made a severe test of the drivers designed, including function test and marginal test. According to the test result, the driver deisgned fits the designed requirement and can be handled to user.This paper developed a series of low-level driver software of ECU in automotive area, which is complete and able to be used in reality. The analysis of the module and registers of the MCU may be helpful for the following developer of the same MCU. The analysis of the Spi module is creative to some extent, which would meet the need of some special conditions.

【关键词】 嵌入式底层驱动平台
【Key words】 Embedded systemlow-level driverplatform
  • 【网络出版投稿人】 吉林大学
  • 【网络出版年期】2011年 09期
  • 【分类号】TP311.52
  • 【被引频次】3
  • 【下载频次】283
节点文献中: