Summary of the invention
The present invention has designed a kind of pure electric automobile entire car controller refresh tool and method for refreshing; The technical matters of its solution is the mode that tradition refreshes through the BDM interface, have only dismantled the entire car controller shell after, just can write with a brush dipped in Chinese ink; Suitable wastes time and energy; In the face of large quantities of automobile controllers of having loaded onto car, carry out software refreshing, progress is quite slow; Refresh through instruments such as INCA in addition, refresh rate is slower, and configuration is comparatively complicated.
In order to solve the technical matters of above-mentioned existence, the present invention has adopted following scheme:
A kind of pure electric automobile entire car controller refresh tool is characterized in that: between entire car controller and host computer, be provided with a refresh tool.
Further, said refresh tool mainly comprise have the USB chip, microcontroller chip and CAN transceiver; Wherein, the USB chip has usb data changes the function of parallel port data and microcontroller chip and host computer is carried out exchanges data; Microcontroller chip sends and receives CAN message to the CAN transceiver; There are two communication lines of CANH and CANL between CAN transceiver and the entire car controller.
Further, said USB chip is the FT245BL chip, and said microcontroller chip is the Mpc5607b master chip, and said CAN transceiver is the JTA1050 transceiver.
A kind of method for refreshing of pure electric automobile entire car controller refresh tool may further comprise the steps:
Step 1, choose through upper computer software and will brush the executable file of waiting to refresh in the entire car controller, give the FT245BL chip with data transmission through usb bus;
Step 2, FT245BL chip are passed to the Mpc5607b master chip with data through 8 tunnel parallel ports; Master chip changes through the RXF# pin level of FT245BL chip; The parallel port data are read collection; And with the data of the data of gathering as CAN message, the JTA1050 transceiver through CAN passes to entire car controller to be refreshed;
Step 3, entire car controller to be refreshed receive the CAN message of sending, and make corresponding response; The response of making is passed through the CAN bus with the form of CAN message, is received by the Mpc5607b master chip;
Step 4, Mpc5607b master chip convert the data in the CAN message data of 8 tunnel parallel ports to again, through the level of TXE# pin of monitoring FT245BL, on the com port that data transmission is invented to USB;
The data of step 5, upper machine-readable com port judge whether entire car controller feedback data to be refreshed is correct, whether can carry out next step refresh operation.
This pure electric automobile entire car controller refresh tool and method for refreshing have following beneficial effect:
The present invention has overcome the trouble of dismounting controller when BDM writes with a brush dipped in Chinese ink,, link to each other with entire car controller through the diagnostics lines that has the CAN interface; Going up USB interface through PC supplies power to refresh tool; And the USB mouth is invented com port carry out data transmission, directly refresh through the CAN communication, convenient and swift.
Embodiment
Below in conjunction with Fig. 1 and Fig. 2, the present invention is further specified:
As shown in Figure 1:
(1) chooses through upper computer software and will brush the executable file of waiting to refresh in the entire car controller, give the FT245BL chip with data transmission through usb bus;
(2) the FT245BL chip is passed to the Mpc5607b master chip with data through 8 tunnel parallel ports; Master chip changes through the RXF# pin level of FT245BL chip; The parallel port data are read collection; And with the data of the data of gathering as CAN message, the JTA1050 transceiver through CAN passes to entire car controller to be refreshed;
(3) entire car controller to be refreshed receives the CAN message of sending, and makes corresponding response; The response of making is passed through the CAN bus with the form of CAN message, is received by the Mpc5607b master chip;
(4) the Mpc5607b master chip converts the data in the CAN message data of 8 tunnel parallel ports to again, through the level of TXE# pin of monitoring FT245BL, on the com port that data transmission is invented to USB;
(5) data of upper machine-readable com port judge whether entire car controller feedback data to be refreshed is correct, whether can carry out next step refresh operation.
Specifically:
1, the FT245BL chip invents com port;
Chip in the pure electric automobile entire car controller refresh tool hardware is FT245BL chip and Freescale Mpc5607b master chip.When refresh tool was linked on the computer through the USB mouth, computer can be checked through a kind of new hardware, promptly has been checked through the FT245BL chip, and this moment, the drive installation with this chip got final product.When in use, can that USB mouth that refresh tool is connected with computer be invented com port uses.
2, upper computer software and FT245BL set up communication;
Upper computer software is write through VC++6.0, realizes the communication with the FT245BL chip through the comm control.Upper computer software is selected to write with a brush dipped in Chinese ink the executable file (like the file of .s19 form) in the entire car controller; Click refresh button; To read the data of executable file then; Form with CAN message data is combined into one group of data, is passed in the refresh tool hardware through the USB oral instructions, and whether the variation of the master chip in the refresh tool hardware through FT245BL chip RXF# pin level can be checked through has data transmission to come.
Upper computer software is MFC (the Microsoft Foundation Classes) program that adopts VC++ 6.0 to write, and mainly is reception and the transmission that realizes com port (COM) data; The refresh tool bottom software mainly comprises the driving of CAN communication, the read-write of FT245BL chip data, and the conversion of parallel port data and CAN data.
3, receive parallel port data and convert CAN message data form to;
The Mpc5607b master chip can be carried out from FT245BL reception data or to the FT245BL write data according to reception, the transmission chip selection signal of FT245BL chip.When host computer was passed to refresh tool with data through the USB oral instructions, the RXF# pin level of FT245BL chip changed.The Mpc5607b master chip changes according to this, and the parallel port data are read collection, 8 tunnel parallel port data is done merge to be handled then, and be stored in a length and be in 8 the variable, and with the data storage of this variable as CAN message.
4, the Mpc5607b master chip sends and receives CAN message;
The Mpc5607b master chip will pass through the CAN communication with the parallel port data of CAN message data storage, pass to entire car controller to be refreshed; Entire car controller to be refreshed receives the CAN message data that has transformed, and to this CAN message, makes corresponding response.The response of making is passed through the CAN bus with the form of CAN message, is received by the refresh tool master chip.
5, CAN message data converts the parallel port data to;
The Mpc5607b master chip converts the data in the CAN message data of 8 tunnel parallel ports to again, and the level of the TXE# pin through monitoring FT245BL chip is on the com port that data transmission is invented to USB.
6, host computer receives data and handles;
The data of upper machine-readable com port judge that whether entire car controller feedback data to be refreshed is correct, whether can carry out next step refresh operation, does different responses according to condition of different.
If the data of returning are correct, then carry out next step data transmission, up to the whole end of transmissions of this executable file that will write with a brush dipped in Chinese ink; If the data of returning are incorrect, then refresh and stop, according to stopping at, which refreshes the stage, report different informations.
As shown in Figure 2, program circuit of the present invention is following:
(1) numeral input and output of initialization Mpc5607b master chip and CAN driver;
(2) the Mpc5607b master chip judges through the RXF# signal of FT245BL chip whether host computer has data to send to refresh tool;
(3) if host computer has data to send to refresh tool, the Mpc5607b master chip is merged into a byte with the data that 8 tunnel parallel ports receive, and the data that will receive continuously are put among the array ParallelData [];
(4) with the data of the data in the ParallelData [] array, send to entire car controller as CAN message;
(5) the Mpc5607b master chip receives the CAN message of the feedback that entire car controller to be refreshed provides;
(6) the CAN message data with feedback unpacks, and is put into successively among the CanReceiveData [];
(7) the Mpc5607b master chip is judged the TXE# signal of FT245BL chip, determines whether to transmit data;
(8) if the Mpc5607b master chip is confirmed the transmission data, the Mpc5607b master chip is transferred to the FT245BL chip with data among the CanReceiveData [] through the parallel port;
(9) on the com port that the FT245BL chip invents the parallel port data to the FT245BL chip through the USB oral instructions, supply host computer to receive;
(10) host computer judges whether the data that receive are correct; If incorrect, will give through message box etc. and refresh personnel relevant error message is provided;
(11) if correct, host computer will be carried out next step refresh operation, judge whether data are sent completion;
(12) if judgment data has been sent completion, refresh end; If judgment data is not sent completion, data are transferred to refresh tool through the com port that the FT245BL chip invents, and the program of getting back to occur again and handle in (2).
Combine accompanying drawing that the present invention has been carried out exemplary description above; Obvious realization of the present invention does not receive the restriction of aforesaid way; As long as the various improvement of having adopted method design of the present invention and technical scheme to carry out; Or design of the present invention and technical scheme are directly applied to other occasion without improving, all in protection scope of the present invention.