The present invention relates to an arithmetic unit.
For example, in a vehicle, various loads such as a lamp, an electric motor, and a heater, and switches for manipulating these loads are arranged in a state where they are distributed at various places of the vehicle body. Therefore, it has been conceived that a plurality of ECUs (arithmetic devices) that can communicate with each other is arranged at various places of the vehicle body, and these ECUs control loads or switches (see Patent Documents 1 and 2).
The above-mentioned ECU differs depending on types of switch to be connected (alternate switch, momentary switch, sensor input switch, and the like). The input processing logic also differs depending on types of operation to detect (short press, long press, fast press etc.) even for switches of the same type.
However, conventionally, a plurality of types of ECUs having input processing logic corresponding to the type of switch and the type of operation to detect was prepared and the ECU that was applied to switches to be connected among a plurality of types was installed. For this reason, there posed a problem that a software product number of the ECU increases.
The present invention has been made in view of the above background, and an object of the present invention is to provide an arithmetic device aimed at reducing a software product number.
An arithmetic device which is an aspect of the present invention is an arithmetic device which executes input processing of a switch, and includes a storage unit in which a plurality of types of input processing logics is stored, a selection unit configured to select one of the plurality of types of input processing logics and an arithmetic unit configured to execute the input processing of the switch according to the input processing logic selected by the selection unit.
Preferably, the device further includes a communication unit communicable with an external device, and the selection unit selects, based on communication with the external device, the input processing designated by the external device.
Preferably, the storage unit stores the input processing logic for detecting switching on or off of an alternate switch, and the input processing logic for detecting on or off of the alternate switch and a switching interval from switching on to switching off or from switching off to switching on of the alternate switch.
Preferably, the storage unit stores the input processing logic for detecting switching off from switching on or switching on from switching off of a momentary switch, and the input processing logic for detecting switching off from switching on or switching on from switching off of the momentary switch, and switching on for more than a specified time of the momentary switch.
Preferably, the storage unit store at least one of input processing logics, for alternate switch, for momentary switch, and for a switch that outputs pulses, a number of the pulses corresponding to an operation amount.
An input processing program which is another aspect of the present invention is an input processing program for letting an arithmetic device execute input processing of a switch, the arithmetic device includes a selection unit that selects one of a plurality of types of input processing logics stored in a storage unit, and an arithmetic unit that executes the input process of the switch according to the input processing logic selected by the selection unit.
According to the above-described mode, since it is unnecessary to prepare an arithmetic unit for each input processing logic, the software part number can be reduced.
Hereinafter, an embodiment of the present invention will be described with reference to
The switch SW is connected in series with the resistor R between a power supply and ground. A voltage at a connection point of a resistor R and a switch SW is input to the in-vehicle ECU 2.
A plurality of in-vehicle ECUs 2 is arranged at various locations of the vehicle body and is communicably connected to each other via a communication line L. The in-vehicle ECU 2 has a CPU 2A, a well-known microcomputer including ROM 2B and a RAM 2C. The CPU 2A performs various processing and controls for predetermined program. The ROM 2B is a read-only memory in which programs for the CPU 2A are stored. The RAM 2C stores various kinds of data and is a readable and writable memory having an area necessary for the processing work of the CPU 2A.
In the ROM 2B (storage unit) of the in-vehicle ECU 2, for example, as shown in the following Table 1, various types of input processing logics A to E are stored. CPU 2A of the in-vehicle ECU 2 (hereinafter, simply referred to as vehicle ECU 2) functions as a selecting unit and an arithmetic unit, and selects one of the plurality of input processing logics A to E and executes the selected one.
The input processing logics A and B are logics for an alternate switch SW 11 (
As shown in Table 1, the input processing logic A has the in-vehicle ECU 2 detect a state of the alternate switch SW 11, and not detect an edge interval (equal to switching interval). When the input processing logic A is selected, the in-vehicle ECU 2, as shown in
As shown in Table 1, an input processing logic B is a logic which has the in-vehicle ECU 2 detect the state of the alternate switch SW 11 and detect the edge interval. When the logic B is selected, the in-vehicle ECU 2 executes state detection as shown in
When the edge interval is equal to or shorter than a specified time, the in-vehicle ECU 2 detects three consecutive short presses of the alternate switch SW 11. That is, when the input processing logic B is selected, the in-vehicle ECU 2 can distinguishably detect switching ON or OFF and short press of the alternate switch SW 11. Thus, for example, in the case that the alternate switch SW 11 is an operation switch for lighting, switching on or off of the alternate switch SW 11 can turn the light on or off, controlling dimming of the light and the like for example with short press.
Input processing logics C and D are logics for a momentary switch SW 12 (
As shown in Table 1, the input processing logic C is a logic that has the in-vehicle ECU 2 detect a falling edge of the input potential (switching on from off of the momentary switch SW 12) and execute detection of short press of the momentary switch SW 12. When the input processing logic C is selected, the in-vehicle ECU 2, as shown in
As shown in Table 1, the input processing logic D is a logic that has the in-vehicle ECU 2 both detect an rising edge of the input potential (switching off from on of the momentary switch SW 12) and a long press. When the input processing logic D is selected, the in-vehicle ECU 2, as shown in
An input processing logic E is a logic for a sensor input switch SW 13 (
As shown in Table 1 and
Next, the operation of the in-vehicle ECU 2 having the above-described configuration will be described below. The in-vehicle system 1 executes an initial process, for example, when an in-vehicle battery is connected and power is turned on. In the initial process, for example, the ECU 2 (external device) serving as a master transmits a signal designating one of the input processing logics A to E to the ECU 2 that is a slave, via the communication line L. The ECU 2 to be a slave which received the signal operates according to the input processing program of the present invention, and selects one designated by the signal among the plurality of input processing logics A to E stored in ROM 2B. Thereafter, in the normal process, the ECU 2 executes input processing logics A to E selected in the initial processing.
According to the embodiment described above, the plurality of types of input processing logics is stored in the ROM 2B, the CPU 2A selects one of the plurality of types of input processing logics, and performs the input processing according to the selected input processing logic. As a result, since there is no need to prepare the ECU 2 for each input processing logic, it is possible to reduce the software part number.
Further, according to the above-described embodiment, the CPU 2A selects the input processing logic designated by the master ECU 2 in communication with the ECU 2 as the master. It follows from this that it is possible to easily select the input processing logic.
According to the above-described embodiment, the ROM 2B stores the input detection processing logic for detecting whether the alternate switch SW 11 is ON or OFF, an input processing logic for detecting ON or OFF of the alternate switch SW 11 and the edge interval of the alternate switch SW 11. Thereby, since ECU 2 for storing these two types of input processing logics is not necessary to prepare separately, it is possible to reduce the software part number.
According to the above-described embodiment, the ROM 2B stores the input processing logic for detecting the falling edge of the momentary switch SW 12, and the input processing logic for detecting rising edge of the momentary switch SW 12 and ON for a predetermined time or more of the momentary switch SW 12. As a result, since the ECU 2 that separately stores these two types of input processing logics is not necessary to prepare separately, it is possible to reduce the software part number.
According to the above-described embodiment, the ROM 2B stores the input processing logic for the alternate switch SW 11, the input processing logic for the momentary switch SW 12, and the input processing logic for the sensor input switch SW 13. As a result, since the ECU 2 that stores these two input processing logics is not necessary to separately prepare, it is possible to reduce the software part number.
According to the above-described embodiment, the ECU 2 selects one of the plural types of input processing logics A to E by communication with the ECU 2 that is external device and becomes master, but is limited to this. For example, a dip switch or the like is provided in the ECU 2, and ON or OFF of the dip switch can select the input processing logics A to E.
Further, in the above-described embodiment, in the input processing logic B, the interval of the falling edges is detected, but is not limited to this. The interval of the rising edges may be detected.
Further, in the above-described embodiment, the input processing logic C detects the falling edge of the input potential, but is not limited to this. The interval of the rising edges may be detected.
Further, in the above-described embodiment, the alternate switch SW 11, the momentary switch SW 12, and the sensor input switch SW 13 are taken as the type of the switch, but is not limited to this. Any switch that needs to execute input processing may be used.
It should be noted that the present invention is not limited to the above embodiment. That is, various modifications can be made within a range that does not deviate from the gist of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
JP2017-233477 | Dec 2017 | JP | national |
Number | Name | Date | Kind |
---|---|---|---|
4379973 | Turner | Apr 1983 | A |
5382791 | Leff | Jan 1995 | A |
20040217649 | Rouleau | Nov 2004 | A1 |
20110037323 | Buerer | Feb 2011 | A1 |
20160366336 | Kuehnle | Dec 2016 | A1 |
Number | Date | Country |
---|---|---|
02118701 | May 1990 | JP |
2015105056 | Jun 2015 | JP |
2016-013649 | Jan 2016 | JP |
2017-114228 | Jun 2017 | JP |
Entry |
---|
Ishizawa, T. ,et al., “A computing platform for developing an application in real-space”, IEICE Technical Report, vol. 106, No. 44, MoMuC2006—May 2, 2006, pp. 7-12. |
Mitsuiwa, Y., “GCC Embedding Programming part 5”, Software Design, vol. 151, No. 5, 2003, pp. 236-243. |
Number | Date | Country | |
---|---|---|---|
20190171614 A1 | Jun 2019 | US |