一种应用于汽车ECU的通用底层驱动软件设计
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着现代汽车技术发展,研发者对于动力总成的功能需求越来越高,传统的纯机械式控制系统已经逐渐淡出历史舞台,取代其地位的是电控的车身动力总成系统。电控系统可以通过其强大的采样能力采集转化为电信号的其他物理量,同时对于时间控制能力比传统的纯机械式系统更为强大。在这样的时代背景下越来越多的工程师加入了汽车电子的队伍,并逐渐分化为了驱动层工程师和应用层工程师两支队伍。应用层工程师负责控制策略的制定,他们使用成型的底层驱动以构筑拟定的策略,他们不需要对于驱动程序的具体实现有所了解而只关心其是否能够实现既定的功能。驱动层的工程师负责根据具体的单片机机型以及应用层工程师的需求编写底层驱动程序,支持应用层工程师的开发工作。
     本文作者针对汽车电子领域应用层软件开发者的实际需求,对飞思卡尔MC9S08SG8型单片机的使用手册进行了研究,综合考虑实际硬件连接环境,并借鉴AUTOSAR架构及其他架构的成型代码,在该机型单片机上开发了一套底层通用驱动软件,该系列软件包括时钟模块、AD转换模块、AD比较模块、IO模块、实时时钟模块、定时器模块、SPI模块、FLASH模块的驱动。对于模块的寄存器功能作者加以了分析,对于具体的函数的参数及功能设置,作者给出了合理的解释,并以流程图的形式加以说明。
     本文实现的驱动覆盖了已有需求提出的所有模块,具备了驱动平台的完备性,同时作者考虑到长远的需求,对未有明确需求的模块也进行了合理的开发设计。在研发过程中考虑到实际使用中驱动程序往往以库文件形式交付应用软件开发者,加强了对于错误输入值的检测及反馈体系。在对于AUTOSAR架构的学习中,作者引入了DET功能,并可以使用宏定义取消该功能,方便了开发调试。同时作者对于从设备的SPI模块进行了较为深入的思考和研究,对比总结了两种方案的优点及不足,选择了合适的实现方法。对于AD采样模块,作者设计了自检功能,并根据需求实现了可选择的简单的滤波算法。
     基于安全性的考虑,作者对于实现的代码进行了较为严格的测试,测试内容包括边界测试和功能测试。经测试,所编写代码符合设计初衷,可以交付使用。
     本文提出了一种对于汽车电子ECU底层驱动程序的设计实现,该实现具有一定的完备性和实际应用性。本文对于各个模块及其寄存器的分析对于后续同机型开发者有一定的参考作用,其中对于SPI模块的思考有一定的创造性,符合特定需求下的开发需要。
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.
引文
[1]飞思卡尔半导体MC9S08SG8 Datasheet[OL]. http://www.alldatasheet.com
    [2]ATMEL.AT25640AN Datasheet [OL]. http://www.alldatasheet.com
    [3]张楠.打印机驱动自动安装系统的设计及实现[D]. 大连理工大学,2009年.
    [4]赵鹏兵.装载机静压行驶驱动系统设计及控制算法研究[D].西安科技大学,2010年.
    [5]孟玲丽.一种数字化接收模块的软件设计[D]. 电子科技大学.2008年
    [6]王勇.韦良芬,王忠群.以计算机语言为驱动的计算机应用人才培养课程群的探索与实践[C]2010 Third International Conference on Education Technology and Training (ETT 2010).2010-11-27
    [7]顾桃峰.岳海燕,顾伟.胡锦前.便携式存储器安全管理平台的研究与实现[J]. 计算机应用与软件,2011/02
    [8]唐力强,王行祥.嵌入式VxWorks系统下的CPCI设备驱动程序开发[J]. 计算机与数字工程.2011/01
    [9]董小喜,薛立勤,王功翠Linux驱动开发研究[J]. 电脑知识与技术
    [10]邓中亮.肖冠兰Windows CE 6.0下LCD驱动程序移植[J]. 计算机与现代化2011/01
    [11]魏瑞瑞,伍岳庆,史承毅WinCE下Mifare射频卡读写模块驱动程序的设计与实现[J].计算机应用,2010/S2
    [12]徐沛,黄俊EPON系统中ONU设备驱动程序的设计与实现[J]. 数字通信2010/06
    [13]罗睿,孙靓.一种快速开发硬件设备驱动程序的方法[J]. 雷达与对抗,2010/04
    [14]杨柳,蔡超,周成平,张圆,钟达雄TMS320C6455 PCI协处理卡WDM驱动程序设计[J].现代电子技术.2010/24
    [15]唐敏,宋杰,李敬仕.基于MiniGUI的触摸屏驱动程序开发与应用[J], 微计算机信息.2010/35
    [16]李永哲,何子述,贾可新,程婷.高速数据传输系统的WDM驱动程序的封装设计.计算机工程与应用[J],2010/35
    [17]胡涛,刘颖娟.用类/微驱动模型开发DSP视频驱动程序[J]. 西安理工大学,单片 机与嵌入式系统应用,2007-05-01
    [18]赵洪杰,刘琳岚.基于流接口驱动模型设计USB设备的驱动程序[J]. 南昌航空大学,南昌航空大学学报(自然科学版)2007-06-15
    [19]况凌.析设备驱动程序通知应用程序的几种方法[J] 中船重工集团第722研究所,中小企业管理与科技(上旬刊)2008-11-05
    [20]李军.基于I/O设备驱动机制的CAN设备驱动程序设计[J]. 中国航空计算技术研究所,航空计算技术,2008-03-15
    [21]豆路标,叶梧,冯穗力,刘旸.基于H.263视频卡的驱动程序及应用程序设计与实现[J]华南理工大学电子与通信工程系,华南理工大学电子与通信工程系计算机工程,2003-08-20
    [22]高文会.使用Type4 JDBC驱动程序编写SQLServer通用查询实例程序[J]. 广州民航职业技术学院信息中心,陕西师范大学学报(自然科学版),2003-12-30
    [23]吴鹏,陶正苏,胡宇贞.基于单片机USB接口的PC主机驱动程序和应用程序设计[J].上海交通大学信息检测技术与仪器系.上海交通大学信息检测技术与仪器系,电子器件2005-09-26

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700