| With the raising performance requirement of modern automobile,ECU has been applied as a main control unit to various components in the car.In the stage of automotive research and production,the measurement and calibration functions of calibration system can realize real-time observation and debugging of ECU control parameters to find the best performance of automobile components.In the after-sales phase of the car,online upgrade function of calibration system can replace the application program running in ECU through the reserved bus interface of car,and it do not need to disassemble or reassemble ECU on a large scale,which reduces cost and workload of vehicle maintenance.At present,the foreign calibration technology is mature,but its price is very expensive.While the development of the domestic calibration system is still in its infancy.Based on CAN bus and the mainstream CCP calibration protocol,a measurement calibration and online upgrading system with strong universality and functions is designed in this paper.The main research contents are as follows:According to the actual requirements of the project,the overall design scheme of system is proposed,which can be divided into two parts:the PC side and the ECU side.According to the operating environment and CAN bus communication requirement of automotive ECU,the ECU hardware circuit which use freescale MC9S12XET256 as main chip is designed.The bottom-level driver program of ECU is written on integrated development environment—CodeWarrior,which mainly consists of CCP driver,CAN driver,FLASH driver.For the FLASH data erasing and writing characteristics of MC9S12XET256,the command program related to the FLASH operation in the CCP driver is designed to ensure the command basis for the FLASH calibration and on-line upgrade function.The PC-side calibration software is designed on the VS2010 software.And its emphasis is the order of CCP commands sent by each function module,which interact with the ECU bottom-level driver program to achieve Polling mode measurement,DAQ mode measurement,RAM calibration,and FLASH calibration.Since FLASH calibration is restricted by hardware platform,the MCU adaptive strategy is designed in the FLASH calibration function module on the PC side to enhance the versatility of the system.On the basis of CAN bus and CCP protocol,The Bootloader program of MC9S12XET256 chip is developed to realize the online upgrade function.According to the MCU program operating mechanism and memory distribution,new CCP command should be defined to trigger BootLoader and convert the the program running in ECU.The method of importing the BootLoader into the RAM area not only can increase the online upgrade rate,but also make it easy to erase BootLoader program,thus the FLASH drive code may not be stored in the ECU to prevent the problem of erroneous erasure caused by running out of the program and make automotive ECU safer.Finally,the experiment platform is equipped to test the functions of the system.The experimental results show that the system can measure ECU parameters with Polling mode and DAQ mode which use 10 ms or 100 ms as cycle,calibrate RAM and FLASH data,and stably update the ECU running program through CAN bus,meeting the needs of the project. |