SENSOR DEVICE

20230080617 ยท 2023-03-16

Assignee

Inventors

Cpc classification

International classification

Abstract

There is a possibility that unauthorized writing of adjustment information occurs in a sensor device in which the adjustment information of the sensor device can be written from outside. A sensor device 1 of the present embodiment includes a detection unit 2 configured to detect a physical quantity, a nonvolatile memory 5 configured to store adjustment information 6 and protection information 7, an adjustment unit 3 configured to adjust an output signal of the detection unit 2 based on contents of the adjustment information 6, an output unit 4 configured to output an output of the adjustment unit 3 to an outside via an external terminal 12, a communication unit 11 configured to communicate with the outside of the sensor device 1 via an external terminal 13, a writing unit 8 configured to perform writing process to the nonvolatile memory 6 based on information from the communication unit 11, an erasing unit 9 configured to perform erasing process of the nonvolatile memory 5 based on information from the communication unit 11, and a reading unit 10 configured to perform reading process from the nonvolatile memory 5 based on information from the communication unit 11.

Claims

1. A sensor device comprising: a detection unit configured to detect a physical quantity; a nonvolatile memory configured to store adjustment information; an adjustment unit configured to adjust an output signal of the detection unit based on the adjustment information; an output unit configured to output an output of the adjustment unit to an outside; a communication unit configured to communicate with the outside; a writing unit configured to perform writing to the nonvolatile memory based on information from the communication unit; a reading unit configured to perform reading from the nonvolatile memory based on information from the communication unit; and an erasing unit configured to perform erasing of the nonvolatile memory based on information from the communication unit, wherein the nonvolatile memory includes an area to store protection information, and operations of the writing unit and the erasing unit are prohibited based on the protection information.

2. The sensor device according to claim 1, wherein a control terminal is provided inside or outside the sensor device, and the prohibition of operations of the writing unit and the erasing unit is canceled based on the protection information by applying a predetermined voltage to the control terminal.

3. The sensor device according to claim 1, wherein erasing of the protection information is performed by sending a specific command to the communication unit.

Description

BRIEF DESCRIPTION OF DRAWINGS

[0011] FIG. 1 is a configuration diagram of a sensor device according to a first embodiment.

[0012] FIG. 2 is a memory map of a nonvolatile memory 5.

[0013] FIG. 3 illustrates a configuration of a communication command.

[0014] FIG. 4 illustrates processing contents for a communication command instructing writing to the nonvolatile memory 5.

[0015] FIG. 5 illustrates processing contents for a communication command for instructing erasing of the nonvolatile memory 5.

[0016] FIG. 6 illustrates processing contents for a communication command for instructing reading from the nonvolatile memory 5.

[0017] FIG. 7 illustrates a flow of writing adjustment information 6 and protection information 7 into the nonvolatile memory 5.

[0018] FIG. 8 is a configuration diagram of a sensor device according to a second embodiment.

[0019] FIG. 9 illustrates a configuration of a communication command for erasing the protection information 7.

[0020] [FIG. 10 illustrates processing contents of a communication command for erasing the protection information 7.

DESCRIPTION OF EMBODIMENTS

[0021] Hereinafter, embodiments of the present invention will be described with reference to the drawings. Note that the embodiments can be combined as long as there is no contradiction.

First Embodiment

[0022] First, a sensor device according to the first embodiment of the present invention will be described with reference to FIG. 1 to FIG. 7. FIG. 1 is a configuration diagram of the sensor device according to the first embodiment, FIG. 2 is a memory map of a nonvolatile memory 5, FIG. 3 is a configuration of a communication command, FIG. 4 illustrates processing contents for a communication command instructing writing to the nonvolatile memory 5, FIG. 5 illustrates processing contents for a communication command for instructing erasing of the nonvolatile memory 5, FIG. 6 illustrates processing contents for a communication command for instructing reading from the nonvolatile memory 5, and FIG. 7 illustrates a flow of writing adjustment information 6 and protection information 7 into the nonvolatile memory 5.

[0023] A sensor device 1 of the present embodiment includes a detection unit 2 configured to detect a physical quantity, a nonvolatile memory 5 configured to store adjustment information 6 and protection information 7, an adjustment unit 3 configured to adjust an output signal of the detection unit 2 based on contents of the adjustment information 6, an output unit 4 configured to output an output of the adjustment unit 3 to an outside via an external terminal 12, a communication unit 11 configured to communicate with the outside of the sensor device 1 via an external terminal 13, a writing unit 8 configured to perform writing process to the nonvolatile memory 5 based on information from the communication unit 11, an erasing unit 9 configured to perform erasing process of the nonvolatile memory 5 based on information from the communication unit 11, and a reading unit 10 configured to perform reading process from the nonvolatile memory 5 based on information from the communication unit 11.

[0024] Note that, an example of the detection unit 2 configured to detect a physical quantity includes a semiconductor element such as a flow rate measurement element molded by MEMS design. In addition, the adjustment unit 3, the output unit 4, the communication unit 11, the nonvolatile memory 5, the writing unit 8, the erasing unit 9, and the reading unit 10 are formed in the same integrated circuit (LSI). The semiconductor element and the integrated circuit may be formed by the same semiconductor element, or may be formed as different semiconductor elements.

[0025] The nonvolatile memory 5 includes a flash memory or an EEPROM. As illustrated in FIG. 2, the adjustment information 6 is arranged from an address 00 to an address FE, and the protection information 7 is arranged in an address FF. Furthermore, the communication device 11 processes a communication command as illustrated in FIG. 3. The communication command includes an operand part 14, an address part 15, and a data part 16, indicating operations (read, write, erase for each address, erase all, etc.) on the nonvolatile memory 5.

[0026] Next, processing contents of a communication command for instructing writing to the nonvolatile memory 5 in the present embodiment will be described with reference to FIG. 4. The communication command sent via the external terminal 13 is processed by the communication unit 11, and when it is determined as a write command, the writing unit 8 reads the protection information 7, and writes data to a predetermined address of the nonvolatile memory 5 when the protection information 7 is 0.

[0027] The initial value of the nonvolatile memory 5 is set to 0, so that writing and erasing to the nonvolatile memory 5 are not protected in the initial state. That is, when the protection information 7 is 0, writing process to the nonvolatile memory 5 is performed, and in other cases, the writing process is prohibited. In other words, the writing process is prohibited by the protection information 7.

[0028] Next, processing contents for a communication command for instructing erasure of the nonvolatile memory 5 in the present embodiment will be described with reference to FIG. 5. The communication command sent via the external terminal 13 is processed by the communication unit 11, and when it is determined as an erase command, the erasing unit 9 reads the protection information 7, and erases a predetermined address of the nonvolatile memory 5 or erases all when the protection information 7 is 0. That is, when the protection information 7 is 0, erasing process of the nonvolatile memory 5 is performed, and in other cases, the erasing process is prohibited. In other words, the erasing process is prohibited by the protection information 7.

[0029] Next, processing contents for a communication command for instructing reading from the nonvolatile memory 5 in the present embodiment will be described with reference to FIG. 6. The communication command sent via the external terminal 13 is processed by the communication unit 11, and when it is determined as a read command, the reading unit 10 reads data from a predetermined address of the nonvolatile memory 5, and the communication unit 11 outputs the data to the outside via the external terminal 13. That is, the reading process is always performed without being protected by the protection information 7.

[0030] Next, a writing procedure to the nonvolatile memory 5 in the present embodiment will be described with reference to FIG. 7. As shown in FIG. 7, writing to the nonvolatile memory 5 is performed by first writing to the adjustment information 6 arranged from the address 00 to the address FE of the nonvolatile memory 5, then reading the contents of the adjustment information 6 for verification, determining that writing to the adjustment information 6 is appropriate when the contents written to the adjustment information 6 matches the contents read from the adjustment information 6, completing writing of the protection information 7 if appropriate, and erasing the adjustment information 6 and redoing from the beginning if not appropriate. In this manner, the adjustment information 6 is first written, the verification of the adjustment information 6 is performed, and the protection information 7 is finally written, thereby prohibiting writing and erasing of the nonvolatile memory 5.

[0031] In this embodiment, after writing to the protection information 7 is performed, writing and erasing to the nonvolatile memory 5 can be completely prohibited. As a result, it is possible to prevent the adjustment information 6 of the sensor device 1 from being rewritten by an unauthorized operation from the external terminal 13, and as a result, it is possible to prevent malfunction of the entire system which uses the sensor device by preventing malfunction of the sensor device.

[0032] In this embodiment, even after writing to the protection information 7 is performed to protect the nonvolatile memory 5, the nonvolatile memory 5 can be read out. As a result, even if the contents of the nonvolatile memory 5 are rewritten by any chance, the contents of the nonvolatile memory 5 can be confirmed by sending a read command from the external terminal 13. In addition, it is possible to store a product identification code for ensuring traceability of the sensor device 1 in the adjustment information 6, and this product identification code can also be confirmed even after the protection of the nonvolatile memory 5 is performed, which can contribute to improvement in reliability of the sensor device 1.

[0033] Furthermore, since the protection information 7 for performing protection of the nonvolatile memory 5 is stored in the nonvolatile memory 5, the writing unit 8 for performing writing to the adjustment information 6, the erasing unit 9, and the reading unit 10 can be used in common with a circuit for writing and reading to the protection information 7, so that the scale of the circuit and the cost can be reduced.

Second Embodiment

[0034] Next, a sensor device according to the second embodiment of the present invention will be described with reference to FIG. 8. FIG. 8 is a configuration diagram of the sensor device according to the second embodiment.

[0035] The sensor device of this embodiment is basically the same as the sensor device of the first embodiment, but as shown in FIG. 8, a switch 17 for prohibiting reading from the protection information 7 and an internal terminal 18 for controlling the switch 17 are added.

[0036] In this embodiment, the switch 17 and the internal terminal 18 are added, and the protection of the nonvolatile memory 5 can be temporarily canceled by applying a predetermined voltage to the internal terminal 18 to control the switch 17. Thus, the protection information 7 can be erased, and the sensor device 1 can be reused. As a result, even when the protection information 7 is erroneously written in the manufacturing line, the manufacturing yield of the sensor device 1 can be improved by making it possible to reuse it. The internal terminal 18 is arranged inside the sensor device 1 so as not to be accessed from the outside, thereby preventing unauthorized access from the outside. Specifically, the internal terminal 18 is not connected to a connector terminal for communication with an external device, and is arranged in the housing so that the internal terminal 18 cannot be accessed unless the sensor device is disassembled.

Third Embodiment

[0037] Next, a sensor device according to the third embodiment of the present invention will be described with reference to FIG. 9 and FIG. 10. FIG. 9 illustrates a configuration of a communication command for erasing the protection information 7, and FIG. 10 illustrates processing contents for a communication command for erasing the protection information 7.

[0038] The sensor device of this embodiment is basically the same as the sensor device of the first embodiment, but processing for a communication command for erasing the protection information 7 as shown in FIG. 9 and processing for a communication command for erasing the protection information 7 as shown in FIG. 10 are added. As shown in FIG. 9, the communication command for erasing the protection information 7 is set to a communication command such as 3C33C in hexadecimal in which specific values are arranged in an operand part 14, an address part 15, and a data part 16. Thus, access from the outside is made difficult and unauthorized access from the outside can be prevented.

[0039] Next, processing contents for a communication command for erasing the protection information 7 of the nonvolatile memory 5 in this embodiment will be described with reference to FIG. 10. The communication command sent via the external terminal 13 is processed by the communication unit 11, and when it is determined as a protection information erase command, the erasing unit 9 erases the protection information 7.

[0040] In the present embodiment, by adding a communication command for erasing the protection information 7 and a process corresponding thereto, even when the protection information 7 is erroneously written in the manufacturing line of the sensor device 1, the sensor device 1 can be reused by erasing the protection information 7. As a result, even when the protection information 7 is erroneously written in the manufacturing line, the manufacturing yield of the sensor device 1 can be improved by making it possible to reuse it.

REFERENCE SIGNS LIST

[0041] 1 sensor device [0042] 2 detection unit [0043] 3 adjustment unit [0044] 4 output unit [0045] 5 nonvolatile memory [0046] 6 adjustment information [0047] 7 protection information [0048] 8 writing unit [0049] 9 erasing unit [0050] 10 reading unit [0051] 11 communication unit [0052] 12 external terminal [0053] 13 external terminal [0054] 14 operand part [0055] 15 address part [0056] 16 data part [0057] 17 switch [0058] 18 internal terminal