Method for writing data into non-volatile memory in vehicle electronic unit

Abstract: A method for writing data into a non-volatile memory employed in an on-vehicle electronic unit, in that while presently available input circuits 11 to 16 are directly utilized without newly setting an exclusively used interface circuit on the side of an electronic unit 3, such data which is desired to be written into the non-volatile memory 6 is entered into the electronic unit 3. A confirmation is made as to whether or not the data writing operation is carried out under normal condition based upon an output signal derived from a presently available output circuit 18.

Description: BACKGROUND OF THE INVENTION The present invention is related to a method for writing data into a writable non-volatile memory such as an EEPROM provided in an electronic unit mounted on an automobile. Conventionally, as to tests performed when on-vehicle electronic units on which writable non-volatile memories such as EEPROMs are mounted are shipped, there are few cases that data are written into these non-volatile memories in order to test various functions and various circuits employed in the on-vehicle electronic units. The major reason is given as follows. Originally, there are many cases that data input means cannot be connected to input terminals of these on-vehicle electronic units. Generally speaking, only switches are connected to the input terminals of the on-vehicle electronic units. These switches are constituted by door locking switches, and switches used to powered door windows for instructing that door windows ascend and/or descend. It is practically difficult to write certain data into non-volatile memories by using these switches. However, in such electronic units assembled in on-vehicle LANs, arbitrary data may be written into non-volatile memories via communication input interfaces of these electronic units by way of serial communications. Fig. 8 is a schematic block diagram for showing a method for writing data into a non-volatile memory employed in an electronic unit assembled in an on-vehicle LAN. In this on-vehicle LAN, a serial communication interface (I/F) 2 of a test apparatus 1 is connected to an on-vehicle LAN input/output circuit 4 of an on-vehicle electronic unit 3, and arbitrary data outputted from the test apparatus 1 is supplied to a microcomputer chip (simply referred to as a "microcomputer" hereinafter) 5 employed in the electronic unit 3 via the on-vehicle LAN input/output circuit 4. Then, in the microcomputer 5, the acquired data is stored into a non-volatile memory 6 such as an EEPROM provided within this microcomputer 5. As previously described, if such an electronic unit 3 applied to the on-vehicle LAN as indicated in Fig. 8 is available, then the arbitrary data can be stored into the non-volatile memory 6 by employing the on-vehicle LAN input/output circuit 4 while utilizing the serial communicating method. However, practically speaking, the electronic unit 3 itself applicable to the on-vehicle LAN is not so popular. As a consequence, when the arbitrary data is tried to be stored from the test apparatus 1 into the non-volatile memory 6 employed in the electronic unit 3 which is not applicable to such an on-vehicle LAN, an interface circuit exclusively used to this type of electronic unit 3 is newly required. In this specific case, there are problems that this electronic unit 3 would become large scale and would require high cost. US-A-5 787 381 discloses a on-vehicle electronic unit comprising a single chip CPU, i.e. a microcomputer, that is controlling an internal combustion engine of an automobile and a data writing method for reprogramming a non-volatile memory embedded in single chip CPU. According to this prior art, there is a need to be able to modify a program stored in the non-volatile memory after assembling (i.e. soldering) the microcomputer in a circuit board. In order to establish a serial communication for writing data into a non-volatile memory of the microcomputer a data transmitter is connected to a serial communication interface embedded in the microcomputer chip through input/output terminals of the chip. The serial communication interface (SCI) functions as a sort of LAN. US-A-5278759 discloses a plurality of on-board vehicle computers, such as on-board controllers for the engine or transmission, that join a vehicle signal transfer structure, such as a shared bus structure. Further, there is a diagnostic connector disclosed which is connected to an engine controller for connecting a off-board diagnostic tool with engine controller. Therefore a data writing in a non-volatile memory of the engine controller, i.e. an on-vehicle electronic unit, is performed through a diagnostic tool connected to the engine controller via the diagnostic connector. SUMMARY OF THE INVENTION The present invention has been made to solve these problems, and therefore, has an object to provide a method for readily writing arbitrary data into a non-volatile memory employed in an on-vehicle electronic unit. That is, the data writing method for the non-volatile memory is realized while avoiding a bulky electronic unit and also an increase of manufacturing cost of the electronic unit. This object is solved by the method according to claim 1. To solve the above-described problems, a data writing method of the present invention, is featured by that in a method for writing data into a non-volatile memory employed in an on-vehicle electronic unit equipped with a plurality of input circuits containing a control circuit having a non-volatile memory and connected to a plurality of external switches, into which operation signals of the respective external switches are entered; a plurality of output circuits for outputting predetermined output signals to an external unit; and a control unit for controlling the respective output signals derived from the plural output circuits in response to the respective operation signals entered via the plural input circuits, in which a predetermined test apparatus is connected to the on-vehicle electronic unit so as to test the electronic unit mounted on a vehicle, the data writing method is comprised of: a first step for outputting a specific input signal with respect to the existing input circuits of the electronic unit from the test apparatus so as to switch an operation mode of the control circuit employed in the electronic unit to a data writing mode for writing the data into the non-volatile memory; a second step for outputting a predetermined write instruction command to the input circuits from the test apparatus when the control circuit is operated in the data writing mode; a third step for transmitting arbitrary data subsequent to the write instruction command from the test apparatus to the input circuits, the arbitrary data being wanted to be written into the non-volatile memory employed in the electronic unit; and a fourth step for confirming as to whether or not the data is written into the non-volatile memory employed in the electronic unit in response to the write instruction command in the test apparatus based upon the output signals derived from the output circuits after the third step. Preferably, according to the data writing method of the present invention, the first step to the fourth step are executed when the electronic unit is shipped. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a schematic block diagram for showing a method for writing data into a non-volatile memory employed in an on-vehicle electronic unit, according to an embodiment of the present invention; Fig. 2 is a schematic block diagram for showing a method for writing data into a non-volatile memory employed in an on-vehicle electronic unit, according to an embodiment of the present invention; Fig. 3 is a diagram for representing an example of an instruction frame transmitted from a test apparatus to the electronic unit; Fig. 4 is a diagram for showing another example of the instruction frame transmitted from the test apparatus to the electronic unit; Fig. 5 is a diagram for representing an example of a response frame transmitted from the electronic unit to the test apparatus; Fig. 6 is a diagram for showing another example of the response frame transmitted from the electronic unit to the test apparatus; Fig. 7 is a flow chart for describing operations executed when the operation mode is advanced from the normal mode to the test mode; and Fig. 8 is the diagram for schematically indicating one example of the conventional method for writing the data into the non-volatile memory employed in the on-vehicle electronic unit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 is a diagram for representing an on-vehicle electronic unit 3 according to an embodiment mode of the present invention, and a test apparatus 9. It should be noted that the same reference numerals used in the conventional electronic unit will be employed as those for denoting the same, or similar elements in Fig. 1. This method for writing data into a non-volatile memory employed in an on-vehicle electronic unit is carried out as follows. As to an electronic unit which does not mount an on-vehicle LAN, as shown in Fig. 1, while using input circuits 11 to 16 and output circuits 18 to 22, which are presently provided in this electronic unit 3, a serial communication is performed between this electronic unit 3 and the test apparatus 9 so as to test the electronic unit 3. Concretely speaking, as represented in Fig. 2, this electronic unit 3 drives loads such as a dome lamp 23a, a door locking motor 23b, and a powered window motor 23c by receiving individual switch operation signals. These switch operation signals are supplied from an ignition switch 2a, a powered window up switch 2b, a powered window down switch 2c, a door locking switch 2d, a door unlocking switch 2e, and a door switch 2f. The ignition switch 2a is connected to an ignition switch input circuit (IG-SW input circuit) 11 provided in the electronic unit 3. The powered window up switch 2b is connected to a powered window up switch input circuit (POWER-WINDOW-UP-SW input circuit) 12 employed in the electronic unit 3. The powered window down switch 2c is connected to a powered window down switch input circuit (POWER-WINDOW-DOWN-SW input circuit) 13 employed in the electronic unit 3. The door locking switch 2d is connected to a door locking switch input circuit (DOOR-LOCK-SW input circuit) 14 employed in the electronic unit 3. The door unlocking switch 2e is connected to a door unlocking switch input circuit (DOOR-UNLOCKING-SW input circuit) 15 provided in the electronic unit 3. Then, the door switch 2f is connected to a door switch input circuit (DOOR-SW input circuit) 16 employed in the electronic unit 3. Also, the signals which are acquired via these input circuits 11 to 16 are entered into a microcomputer (control circuit) 17 containing a ROM, a RAM, and a CPU. While a dome (ceiling) lamp circuit 18, a door locking output circuit 19, a door unlocking output circuit 20, a powered window up output circuit 21, and a powered window down output circuit 22 are controlled by this microcomputer 17, these output circuits 18 to 22 are operated, so that the dome lamp 23a, the door locking motor 23b, and the powered window motors 23c are driven, respectively. It should be understood that in Fig. 2, reference numeral 24 denotes a power supply circuit, and reference numeral 25 represents a watch dog circuit for testing a power supply level. Then, a junction point (port) P0 between the ignition switch 2a and the ignition switch input circuit 11 is connected to a serial communication input/output interface 32 of the test apparatus 9. A serial communication signal transmitted from this test apparatus 9 is entered via the ignition switch input circuit 11 to the microcomputer 17. The test apparatus 9 is equipped with a serial communication input/output interface (serial communication input/output interface I/F) 32. This test apparatus 9 contains a function for issuing an instruction capable of switching the operation mode of the microcomputer 17 of the electronic unit 3 into a "data writing mode" in which data is written into the non-volatile memory 6 in response to a serial communication signal; and another function for outputting write instruction commands ID1a and ID2a (see Fig. 3 and Fig. 4) contained in the serial communication signal to the electronic unit 3 when the microcomputer 17 is operated in "data writing mode". The test apparatus 9 further contains a function for transmitting arbitrary data subsequent to the above-explained write instruction commands ID1a and ID2a, which is desired to be written into the non-volatile memory 6; and another function for receiving the output signals derived from these output circuits 18 to 22 when the test apparatus 9 is connected to the respective output circuits 18 to 22 of the electronic unit 3; and furthermore, another function for confirming as to whether or not the data is written into the non-volatile memory 6 employed in the electronic unit 3 in response to the above-explained write instruction commands ID1a and ID2a based upon the output signals derived from the output circuits 18 to 22. It should be noted that both the write instruction commands and the arbitrary data which is desired to be written into the non-volatile memory 6 will be referred to as an "instruction frame" (see Fig. 3, tables 1 and 2) in the below-mentioned description. It is so assumed that in response to this instruction frame, process operations executed in the electronic unit 3 are reported/returned to the test apparatus 9, and then, a signal reported/returned to the test apparatus will be referred to a "response frame " (see Fig. 5, tables 3 and 4). As the serial communication system executed between the test apparatus 9 and the electronic unit 3, a specific communication protocol of such a serial communication system is employed in which the test apparatus 9 is used as a master unit and the electronic unit 3 is used as a slave unit. Basically, the below-mentioned communication system is employed. That is, first, a write instruction commend is sent from the test apparatus 9 to the electronic unit 3, and upon receipt of this write instruction command, the electronic unit 3 waits for data. Subsequently, after the data sent from the test apparatus 9 has been stored into the non-volatile memory 6, the electronic unit 5 returns a response frame indicative of this fact to the test apparatus 9. At this time, the electronic unit 3 receives an instruction frame via the presently available input circuits 11 to 16, and transmits a response frame corresponding this instruction frame by using the presently available output circuits 18 to 22. The above-explained operation is executed in accordance with a software program dedicated to the test purpose, which is prepared in the microcomputer 17 employed in the electronic unit 3. It should be noted that this test apparatus 9 is originally intended to test as to whether or not the operations of the respective input circuits 11 to 16 and the respective output circuits 18 to 22 employed in the electronic unit 3 are carried out under normal conditions. Practically speaking, the serial communication input/output interface 32 is also connected not only to the junction point P0 between the ignition switch 2a and the ignition switch input circuit 11, but also a junction point between the powered window up switch 2b and the powered window up switch input circuit 12; another junction point between the powered window down switch 2c and the powered window down switch input circuit 13 employed in the electronic unit 3; another junction point between the door locking switch 2d and the door locking switch input circuit 14 employed in the electronic unit 3; and another junction point between the door unlocking switch 2e and the door unlocking switch input circuit 15 employed in the electronic unit 3; and also, another junction point between the door switch 2f and the door switch input circuit 16 employed in the electronic unit 3. The signals similar to the normal operation signals derived from the respective switches 2a to 2f are transmitted to these junction points in order that the input circuits 11 to 16 and the output circuits 18 to 22 are tested. It should be noted these connection relationships are omitted from Fig. 2, for the sake of convenient. Next, a description will now be made of the serial communication protocol. First, as indicated in Fig. 3, the instruction frame sent from the test apparatus 9 to the electronic unit 3 is constituted by the write instruction command ID1a having an 8-bit length and indicative of a content of an instruction, and data DATA1a having an 8-bit length. This data DATA1a is used to designate an output port and an input port which is wanted to be read, and also is desired to be written into the non-volatile memory 6. In this case, a table 1 represents a list of the write instruction command ID1a, and a table 2 indicates a list of the data DATA1a which is desirably written into the non-volatile memory 6. ID1 content of write data D7 D6 D5 D4 D3 D2 D1 D0 write serial No. 0 0 0 0 0 0 0 0 write test date 0 0 0 0 0 0 0 1 write test OK/NG result 0 0 0 0 0 0 1 0 request ending of write mode 1 1 1 1 1 1 1 1 DATA1 Serial No. DAT7 DAT6 DAT5 DAT4 DAT3 DAT2 DAT1 DAT0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 1 0 255 1 1 1 1 1 1 1 1 In this table 1, symbols "D0" to "D7" indicate the respective bit data contained in the write instruction command ID1a which implies attributes (profiles) of write data. In the table 2, symbols "DAT0" to "DAT7" indicate the respective bit data contained in the data DATA1a which is wanted to be written into the non-volatile memory 6. In this case, an example of the table 2 corresponds to such an example that serial numbers applied to the respective products when the produces are test/shipped are shown. In addition, test date/time, and test OK/NG results may be written into the non-volatile memory. As to the instruction commands and the data which are wanted to be written into the non-volatile memory 6, there are some possibilities that a total number of instructions is desirably increased and the data themselves are increased, depending upon the unit scale of the electronic unit 3. As a result, as illustrated in Fig. 4, another write instruction command ID2a and another data DATA2a desirably written into the non-volatile memory 6 may be added to the frame, if required. Similar to the above-described instruction frame, the response frame supplied from the electronic unit 3 to the test > apparatus 9 is constituted by response information ID1b having an 8-bit length and indicative of a content of a response; and also DATA1b having an 8-bit length and written into the non-volatile memory 6. In this case, a table 3 indicates a list of the response information ID1b, and another table 4 represents a list of the data DATA1b written into the non-volatile memory 6. ID1 content of written data D7 D6 D5 D4 D3 D2 D1 D0 serial No. 0 0 0 0 0 0 0 0 test date 0 0 0 0 0 0 0 1 test OK/NG result 0 0 0 0 0 0 1 0 request ending of write mode 1 1 1 1 1 1 1 1 DATA1 Serial No. DAT7 DAT6 DAT5 DAT4 DAT3 DAT2 DAT1 DAT0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 1 0 255 1 1 1 1 1 1 1 1 It should be understood that symbols "D0" to "D7" shown in the table 3 indicate the respective bit data contained in the response information ID1b, and symbols "DAT0" to "DAT7" represent the respective bit data contained in the data DATA1b written into the non-volatile memory 6. In this case, the example of the table 3 corresponds to the example of the above-explained table 1, whereas the example of the table 4 corresponds to the example of the above-described table 2. It should also be noted that as shown in these tables 3 and 4, these data need not be identical to those of the tables 1 and 2. It should further be noted that reference numeral "10" shown in Fig. 2 indicates an A/D voltmeter for detecting voltage levels appearing in the respective circuit portions to thereby transfer the detected voltage levels to the test apparatus 1. Now, a description will be made of a method for writing data into the non-volatile memory 6 employed in the on-vehicle electronic unit with employment of the above-explained arrangement. First of all, a commencement of the data writing mode to the non-volatile memory 6 is instructed to the electronic unit 3. In this case, a specific input is applied to the ignition switch input circuit 11 of the electronic unit 3 by way of the serial communication signal derived from the test apparatus 9. In this case, such a waveform signal having a constant complex pulse shape is applied to this ignition switch input circuit 11 in order not to confuse this specific input operation from the normal operation executed in the ignition switch 2a. Alternatively, such an operation signal corresponding to the simultaneous operations of the plural switches 2a to 2f may be inputted to the ignition switch input circuit 11. In this alternative example, the key input may be confirmed as a "specific input" in the case that a complex switch operation is carried out which is not actually carried out while driving the automobile, and then this complex switch operation produces such a specific signal. Then, at a step S1 shown in Fig. 7, when the microcomputer 17 once confirms the execution of the specific input based upon the signal entered via the ignition switch input circuit 11 of the electronic unit 3, the present mode processed in the microcomputer 17 is switched into "data writing mode" at a step S2. Then, such a serial communication signal (instruction frame) as represented in Fig. 3, the table 1, and the table 2 is transmitted from the test apparatus 1 to the electronic unit 3. At will be discussed later, the data writing operation to the non-volatile memory 6 is carried out. In this case, the microcomputer 17 produces a response frame (see Fig. 5, table 3 and table 4) in response to the instruction frame, and then returns this response frame via, for example, the dome lamp circuit 18 to the serial communication input/output interface 32 of the test apparatus 9. As indicated in the table 3 and the table 4, both the content (ID1 : table 3) of the data written into the non-volatile memory 6, and the serial No. (DATA1 : table 4) functioning as the data stream are stored into this response frame, and then the resultant response frame is outputted from the microcomputer 17. Now, in such a case that "an instruction frame request of ending write mode" defined in the bottommost of the table 1 is contained in the serial communication signal sent from the test apparatus 9, the microcomputer 17 executes the ending instruction at the step S3, and then switches the present mode "data writing mode" into the "normal mode". Then, the process operation is advanced to a step S4. At this step S4, the microcomputer 17 receives instructions which imply the original operations of the switches 2a to 2f, and then controls the output circuits 18 to 22 based upon these instructions so as to perform the normal process operations such as the window up/down operations and the door locking operations at the respective loads 23a to 23c. On the other hand, in the case that an instruction frame other than "request for ending of write mode" described in the bottommost instruction of the table 1 is received from the serial communication signal sent from the test apparatus 9, the process operations defined at the steps S2 and S3 are repeatedly carried out. The test apparatus 9 confirms such a fact that the data has been written into the non-volatile memory 6 employed in the electronic unit 3 under normal condition based upon the response frame sent from the electronic unit 3, and thereafter the process operation is accomplished. Concretely speaking, the test apparatus 9 judges as to whether or not an instruction frame sent from the test apparatus 1 to the electronic unit 3 is made coincident with a response frame received from the electronic unit 3. If these instructions are made coincident with each other, then the test apparatus 9 can judge that the data has been written into the non-volatile memory under normal condition. It should be understood that this judgment can be established when both the instruction frame and the response frame own the same forms as represented in the table 1 to the table 4, whereas when the data are produced by using different forms, the test apparatus 9 may judge these frames based upon a preselected judgement logical idea. As previously explained, in accordance with this embodiment mode, since the data is written into the non-volatile memory 6 by way of the serial communication system while directly using the presently available input circuits 11 to 16 and also output circuits 18 to 22 without any modification in such a case that the arbitrary data is stored from the test apparatus 1 into the non-volatile memory 6 employed in the electronic unit 3 even as to the electronic unit 3 which is not adapted to the on-vehicle LAN, there is no need to newly prepare the interface circuit dedicated to the data writing operation. As a consequence, it is possible to avoid the bulky electronic unit 3 and also high cost thereof. Furthermore, since the serial number of product, the test date/time of this product, and the test OK/NG result thereof are written when the product is tested/shipped, there is such a merit that the products can be readily managed in the lot unit. In accordance with the present, the data writing method for the non-volatile memory is carried out by outputting a specific input signal with respect to the existing input circuits of the electronic unit from the test apparatus so as to switch an operation mode of the control circuit employed in the electronic unit to a data writing mode for writing the data into the non-volatile memory; outputting a predetermined write instruction command to the input circuits from the test apparatus when the control circuit is operated in the data writing mode; transmitting arbitrary data subsequent to the write instruction command from the test apparatus to the input circuits, the arbitrary data being wanted to be written into the non-volatile memory employed in the electronic unit; and confirming as to whether or not the data is written into the non-volatile memory employed in the electronic unit in response to the write instruction command in the test apparatus side. As a consequence, while the presently available input circuits and also output circuits are directly utilized without newly setting the interface circuit exclusively employed on the side of the electronic unit, these input circuits and output circuits can be readily tested. Therefore, it is possible to avoid the bulky electronic unit 3 and also high cost thereof. Furthermore, since the serial number of product, the test date/time of this product, and the test OK/NG result thereof are written when the product is tested/shipped, there is such a merit that the products can be readily managed in the lot unit.

Claims: Method for writing data into a non-volatile memory (6) employed in an on-vehicle electronic unit (3) comprising: a) a plurality of input circuits (11 to 16) connected to a plurality of external switches (2a to 2f), into which operation signals of the respective external switches (2a to 2f) are entered; b) a plurality of output circuits (18 to 22) for outputting predetermined output signals to an external unit (23a to 23c); and c) a control circuit (17) for controlling said respective output signals derived from said plural output circuits (18 to 22) in response to said respective operation signals entered via said plural input circuits (11 to 16), said control circuit (17) having the non-volatile memory (6) therein, said data writing method comprises the steps of: d) connecting a test apparatus (9) via a serial communication input/output interface (32) to said on-vehicle electronic unit (3); characterized by e) connecting said serial communication input/output interface (32) of said test apparatus (9) with said existing input circuits (11 to 16) and said existing output circuits (18 to 22); f) providing a first step for outputting a specific input signal to the existing input circuits (11 to 16) of said electronic unit (3) from said test apparatus (9) so as to switch an operation mode of said control circuit (17) employed in said electronic unit (3) to a data writing mode for writing data into said non-volatile memory (6); g) providing a second step for outputting a predetermined write instruction command to said input circuits (11 to 16) from said test apparatus (9) when said control circuit (17) is operated in the data writing mode; h) providing a third step for transmitting arbitrary data subsequent to said write instruction command from said test apparatus (9) to said input circuits (11 to 16), said arbitrary data being wanted to be written into said non-volatile memory (6) employed in said electronic unit (3); i) providing a fourth step of receiving output signals derived from said output circuits (18 to 22) at said test apparatus (9); and j) providing a fifth step for confirming as to whether or not said data is written into said non-volatile memory (6) employed in said electronic unit (3) in response to said write instruction command in said test apparatus (9) based upon the output signals derived from said output circuits (18 to 22) after said fourth step. A method for writing data into a non-volatile memory (6) employed in an on-vehicle electronic unit (3) as claimed in Claim 1 wherein said first step to said fifth step are executed when said electronic unit (3) is shipped.

Inventors: HIRAMATSU SHINYA, HIRAMATSU,SHINYA, Hiramatsu,Shinya, Harness System Tech Research Ltd
Applicants: AUTONETWORKS TECHNOLOGIES LTD, SUMITOMO ELECTRIC INDUSTRIES, SUMITOMO WIRING SYSTEMS, AUTONETWORKS TECHNOLOGIES, LTD., SUMITOMO ELECTRIC INDUSTRIES, LTD., SUMITOMO WIRING SYSTEMS, LTD.
Application year: 1999
Main classification: G11C16
IPC codes: G06F9, B60R16, G11C16