Master-slave communication system and control method thereof

By changing slave node addresses to unique ones and using initial address trials, the system efficiently determines node states, preventing control disruptions.

JP7547079B2Active Publication Date: 2024-09-09CANON KK
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
JP2020085945
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-05-15
Publication Date
2024-09-09
Estimated Expiration
2040-05-15

AI Technical Summary

Technical Problem

Determining the operating states of multiple slave nodes in a master-slave communication system takes a long time, which can disrupt smooth control of the entire device.

Method used

The system employs a master node that changes the initial, non-unique addresses of slave nodes to unique addresses and uses trial communication with the initial address to quickly determine the operating states of the slave nodes.

Benefits of technology

This approach allows for rapid determination of the operating states of multiple slave nodes, ensuring timely detection of abnormal nodes and maintaining system control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007547079000001
    Figure 0007547079000001
  • Figure 0007547079000006
    Figure 0007547079000006
  • Figure 0007547079000007
    Figure 0007547079000007
Patent Text Reader

Abstract

To determine the operation state of a plurality of slave nodes in a short time.SOLUTION: A master CPU 100 changes, from an initial address, the slave address of each of a plurality of slave nodes to an intrinsic address different from the initial address, then uses the initial address to try communication with each of the plurality of slave nodes. The master CPU 100 determines the operation state of each slave node on the basis of the result of the try.SELECTED DRAWING: Figure 7
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a master-slave communication system. and It relates to a control method. [Background technology]

[0002] There is known a master-slave communication system in which a master node as an electronic device communicates with multiple slave nodes. In general, communication between a master node and a slave node is established by specifying an address (slave address) assigned to the slave node. In I2C communication, which is one of the master-slave communication systems, a communication method as shown in Figure 10 is adopted.

[0003] First, the master node sends a start condition (S) signal, a signal for the slave address to be connected, and an R / W signal indicating whether the master side will be reading or writing. When the slave node receives the signal, it replies with an ACK. After that, if the master side will be writing, the master node sends a data signal, and when the slave node receives the signal, it replies with an ACK. On the other hand, if the master side will be reading, the slave node sends a data signal, and when the master node receives the signal, it replies with an ACK. Finally, the master node sends a stop condition signal (P), ending communication with the slave node.

[0004] If the signal receiving side does not receive the signal correctly, no ACK is returned and the state becomes NCK. In this master-slave communication system, each of the multiple slave nodes must be assigned a unique address. As a method for this, as described in Patent Document 1, a method is known in which the master node sets a unique slave address for each slave node, enabling communication with each slave node. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] Japanese Patent Application Publication No. 5-292098 Summary of the Invention [Problem to be solved by the invention]

[0006] However, in order for the master node to determine the operating status of each slave node, i.e., whether it is operating normally, it must specify the slave address of each slave node, communicate with it, and check whether communication is established. For example, as shown in Figure 9, it must check the establishment of communication with each of slave nodes A, B, and C one by one, that is, it must check that an ACK is returned from each slave node. If there are a large number of slave nodes, this check takes a long time. If it takes a long time to determine the operating status of multiple slave nodes, there is a risk that smooth control of the entire device equipped with the master-slave communication system cannot be achieved.

[0007] An object of the present invention is to determine the operating states of a plurality of slave nodes in a short period of time. [Means for solving the problem]

[0008] In order to achieve the above object, the present invention provides a master-slave communication system including a master node and a plurality of slave nodes each having an initial address that is a non-unique address, No Rebnode Each The address is converted from the initial address to the Multiple Slave node Corresponding to each Change to a unique address Execute the change process A change means and a change means The address of each of the plurality of slave nodes is changed to a corresponding unique address. Then, using the initial address, Multiple An attempt means for attempting communication with a slave node; The change means includes: A result of the trial performed by the trial means indicates that communication has been established, the change process is executed again.It is characterized by: Effect of the Invention

[0009] According to the present invention, the operating states of a plurality of slave nodes can be determined in a short period of time. [Brief description of the drawings]

[0010] [Figure 1] 1 is a block diagram illustrating a schematic configuration of a master-slave communication system. [Diagram 2] FIG. 2 is a block diagram illustrating a schematic configuration of a slave node A. [Diagram 3] This is a timing chart of I2C communication. [Figure 4] 13 is a flowchart showing a slave address setting process. [Diagram 5] 5 is a flowchart showing the slave address setting process, which is a continuation of FIG. 4; [Figure 6] FIG. 13 is a diagram for explaining a change of a slave address. [Figure 7] 13 is a flowchart showing a state determination process. [Figure 8] FIG. 1 is an explanatory diagram of the I2C communication method. [Figure 9] FIG. 1 is an explanatory diagram of a conventional I2C communication method. [Figure 10] FIG. 1 is an explanatory diagram of a conventional I2C communication method. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

[0012] FIG. 1 is a block diagram showing a schematic configuration of a master-slave communication system according to an embodiment of the present invention. In FIG. 1, a master-slave communication system 1000 (hereinafter, communication system 1000) includes a master CPU 100 and a plurality of slave nodes. In this embodiment, as an example, a configuration will be described in which the communication system 1000 includes three slave nodes, specifically, a slave node A 111, a slave node B 112, and a slave node C 113. Note that the number of slave nodes included in the communication system 1000 is not limited to three, and may be two, or four or more. For example, when the data length of the address of a slave node is 8 bits, the maximum number of slave nodes is 2. 8 -1, or 255.

[0013] The master CPU 100 as an electronic device includes one or more master nodes and a master ROM 104. In this embodiment, as an example, a configuration in which the communication system 1000 includes one master node, specifically, the master node 101, will be described.

[0014] The master node 101 has a data output terminal (SDA) and a clock output terminal (CLKout). The data output terminal is connected to a serial data bus 102, and the clock output terminal is connected to a clock signal line 103. A slave node A 111, a slave node B 112, and a slave node C 113 are connected in parallel to the serial data bus 102 and the clock signal line 103, respectively. In this manner, in the communication system 1000, a plurality of slave nodes are connected so as to dangle from one master node.

[0015] In the communication system 1000, for example, I2C communication is used as a communication method. In I2C communication, the master node 101 outputs a clock signal for serial communication from a clock output terminal to a clock signal line 103. Serial data is determined by the logic of the serial data bus 102 at the rising edge of the clock signal. That is, among the slave node A 111, the slave node B 112, and the slave node C 113, the slave node designated by the master node 101 reads the data signal of the serial data bus 102 at the rising edge of the clock signal. Hereinafter, the communication that the master node 101 performs with each slave node via the serial data bus 102 and the clock signal line 103 is referred to as "master-slave communication."

[0016] The master CPU 100 supplies power to the slave node A 111, the slave node B 112, and the slave node C 113. In FIG. 1, the master CPU 100 supplies power to the slave node A 111 from the power line 121, supplies power to the slave node B 112 from the power line 122, and supplies power to the slave node C 113 from the power line 123. In the following, the power supplied to the slave node A 111 from the power line 121 is referred to as "Vcc-A". The power supplied to the slave node B 112 from the power line 122 is referred to as "Vcc-B". The power supplied to the slave node C 113 from the power line 123 is referred to as "Vcc-C". The master CPU 100 can individually control the on / off of the power supply for each of the power lines 121 to 123. The master ROM 104 stores a plurality of change addresses. Each changed address is used in the slave address setting process (FIGS. 4 and 5) described later, which sets the address of each slave node used in master-slave communication. The changed address is a unique address (unique address) corresponding to each slave node, and the changed addresses of each slave node are different from each other.

[0017] In I2C communication, slave node A111, slave node B112, and slave node C113 each have a unique slave address used for communication within the communication system 1000. The master node 101 selects one of slave node A111, slave node B112, or slave node C113 as the communication target by specifying the slave address of the slave node with which it is to communicate. The master node 101 communicates with the selected slave node.

[0018] In I2C communication, the serial data bus 102 and the clock signal line 103 are pulled up to the power supply Vdd via resistors. The voltage of this power supply Vdd is equivalent to the voltage (Vcc) supplied to the master node 101 and the slave nodes. Since multiple slave nodes are connected to the serial data bus 102 and the clock signal line 103, the terminals connected to the serial data bus 102 and the clock signal line 103 of each node have an open-drain configuration. The terminals of each slave node are normally in input mode and in a high-impedance state.

[0019] In this embodiment, since the slave nodes A111, B112, and C113 have the same configuration, the configuration of the slave node A111 will be described below as a representative. In the following, for the components of the slave node B112, the "A" at the end of the reference numerals of the components of the slave node A111 will be read as "B". In addition, for the components of the slave node C113, the "A" at the end of the reference numerals of the components of the slave node A111 will be read as "C".

[0020] Fig. 2 is a block diagram showing a schematic configuration of the slave node A111. In Fig. 2, the slave node A111 includes a serial / parallel conversion unit 201A, a receiving address register 202A, an internal address register 203A, a slave CPU 204A, and a slave ROM 205A. The serial / parallel conversion unit 201A, the receiving address register 202A, and the slave CPU 204A are connected to each other via an internal bus 206A. The slave ROM 205A and the internal address register 203A are connected to the slave CPU 204A.

[0021] The serial / parallel conversion unit 201A is connected to the serial data bus 102 and the clock signal line 103. The serial / parallel conversion unit 201A captures the data signal output from the master node 101 at the timing of the rising edge of the clock signal output from the master node 101. The serial / parallel conversion unit 201A converts serial data based on the captured data signal into parallel data and outputs the parallel data to the internal bus 206A. The serial / parallel conversion unit 201A also converts parallel data received via the internal bus 206A into serial data and outputs the serial data signal to the serial data bus 102.

[0022] The receiving address register 202A holds the changed address included in the serial information received from the master node 101. The slave CPU 204A is a calculation device that controls the overall operation of the slave node A 111. The slave ROM 205A stores various information required for control by the slave CPU 204A. The various information includes, for example, the initial address of the slave node A 111. The initial address is used to establish initial communication with the master node 101. The initial address is common to each slave node, but is different from any changed address.

[0023] Power (Vcc-A) is supplied to the slave node A111 from the master CPU 100 via the power line 121. When power is not supplied from the master CPU 100 (Vcc off), the blocks in the slave node A111, such as the slave CPU 204A and the serial / parallel conversion unit 201A, do not operate. Therefore, the slave node A111 is disconnected from the serial data bus 102 and the clock signal line 103, and is unable to communicate with the master node 101. This state is essentially a state in which the slave node A111 is not connected to the master node 101.

[0024] When power is supplied from the master CPU 100 (Vcc on), the slave CPU 204A starts up and the initial slave address stored in the slave ROM 205A is transferred to the internal address register 203A. In addition, each block in the slave node A 111, such as the serial / parallel conversion unit 201A, becomes operable. Therefore, the slave node A 111 is connected to the serial data bus 102 and the clock signal line 103, and is able to communicate with the master node 101. This state is essentially a state in which the slave node A 111 is connected to the master node 101.

[0025] The communication timing in the I2C communication method is explained using Figures 3(a) and (b). Figure 3(a) is a timing chart of I2C communication. Here, a case where communication is performed with 8 bits as one set is explained. First, the master node 101 outputs a start condition (S) signal. The start condition is a state in which the master node 101 makes the serial data logic on the serial data bus 102 low when the clock signal logic on the clock signal line 103 is high. Outputting the start condition (S) signal is the signal to start I2C communication.

[0026] Next, the master node 101 outputs 8 bits of data to the serial data bus 102 in synchronization with the output of a clock signal to the clock signal line 103. The slave node determines the serial data according to the serial data logic of the serial data bus 102 at the rising edge of the clock signal. After that, when it is confirmed that the required data has been received, the slave node outputs an ACK onto the serial data bus 102. Here, outputting an ACK means that the signal level of the serial data bus 102 is set to Low. The serial data bus 102 enters the ACK state.

[0027] On the other hand, if the slave node cannot confirm that it has received the required data, it does not control anything on the serial data bus 102. Therefore, the serial data bus 102 is in an NCK state. As shown in Fig. 1, the serial data bus 102 is pulled up via a resistor, so if no control is given to the serial data bus 102, the signal level of the serial data bus 102 becomes High. In other words, the serial data bus 102 is in an NCK state.

[0028] Fig. 3(b) is a timing chart of communication when I2C communication is performed by specifying a slave address from the master side. First, the master node 101 outputs a start condition (S) signal. The master node 101 outputs the most significant 7 bits of the slave address value (A6 to A0) to the serial data bus 102 in synchronization with the output of a clock signal to the clock signal line 103. Next, the master node 101 outputs an R / W signal to indicate whether the master side will be transmitting or receiving in the subsequent communication. When the master side is transmitting, the R / W signal is Low, and when the master side is receiving, the R / W signal is High.

[0029] A slave node outputs an ACK if the slave address received from the serial data bus 102 matches its own slave address. For example, the slave node A 111 stores address information of the parallel data converted through the serial / parallel conversion unit 201A shown in FIG. 2 in the receiving address register 202A. Then, the slave node A 111 outputs an ACK if the address information stored in the receiving address register 202A matches the address information stored in the internal address register 203A. Therefore, the serial data bus 102 enters the ACK state.

[0030] On the other hand, if the slave address data received from the serial data bus 102 does not match the address information stored in the internal address register 203A, the slave node A 111 does not control the serial data bus 102. Therefore, the serial data bus 102 enters the NCK state. The data transmission operation thereafter is the same as the slave address transmission described above, so a description thereof will be omitted.

[0031] 4 and 5 are flow charts showing the slave address setting process executed by communication system 1000. This process is realized by cooperation between master CPU 100 and each slave CPU. For this purpose, master CPU 100 loads a program stored in master ROM 104 into a RAM provided in master CPU 100 and executes the program. In addition, each slave CPU loads a program stored in each slave ROM into a RAM provided in each slave node and executes the program. In this process, master CPU 100 plays the role of a change means in the present invention.

[0032] This process is started, for example, when a command to start communication is input to the master CPU 100. In the initial state of this process, it is assumed that the supply of power from the master CPU 100 to all slave nodes is stopped. In other words, the slave node A 111, the slave node B 112, and the slave node C 113 are not connected to the master node 101.

[0033] In step S301, the communication system 1000 supplies power (Vcc-A) from the master CPU 100 to one of the slave node A 111, the slave node B 112, and the slave node C 113, for example, the slave node A 111.

[0034] In step S302, the communication system 1000 performs initial setting of the slave node A111 to which power has been supplied. Specifically, in the slave node A111, the slave CPU 204A transfers the initial address stored in the slave ROM 205A to the internal address register 203A. This sets the initial address as the slave address of the slave node A111. The initial address is, for example, a value expressed in binary. In this embodiment, as an example, the initial address is "0000100".

[0035] In step S303, the communication system 1000 starts master-slave communication between the master node 101 and the slave node A111 by specifying the slave address "0000100" of the slave node A111 by the master node 101. To this end, the master node 101 outputs a data signal indicating the address "0000100" of the slave node A111 to the serial data bus 102. In the slave node A111, when the serial / parallel conversion unit 201A receives the data signal, the address indicated by the data signal (hereinafter referred to as the "specified address") is stored in the receiving address register 202A.

[0036] In step S304, the communication system 1000 executes a process for establishing master-slave communication between the master node 101 and the slave node A111. To this end, in the slave node A111, the slave CPU 204A compares the designated address stored in the receiving address register 202A with the address held in the internal address register 203A. Here, the address held in the internal address register 203A is the initial address "0000100" set as the slave address of the slave node A111. Then, as a result of comparing these two addresses, if the two addresses match, the communication system 1000 establishes master-slave communication between the master node 101 and the slave node A111.

[0037] In step S305, the communication system 1000 changes the slave address of the slave node A111. Specifically, the master node 101 transmits the first changed address stored in the master ROM 104 to the slave node A111 via the serial data bus 102. Here, the first changed address is an address different from the initial address and is an address unique to the slave node A111 in the master-slave communication, for example, "0000101". The slave node A111 transfers the received first changed address to the internal address register 203A. As a result, the slave address of the slave node A111 is switched from the initial address "0000100" to the changed address "0000101" as shown in FIG. 6.

[0038] In step S306, the communication system 1000 executes a process of starting master-slave communication between the master node 101 and the slave node A111 by specifying the first changed address "0000101".

[0039] In step S307, the communication system 1000 determines whether or not master-slave communication has been established between the master node 101 and the slave node A 111. If the slave address of the slave node A 111 has been successfully switched from the initial address "0000100" to the first changed address "0000101", communication is established.

[0040] If the master-slave communication between the master node 101 and the slave node A111 is not established as a result of the determination in step S307, the slave address of the slave node A111 has not been switched normally from the initial address to the first changed address. In this case, the master CPU 100 returns to the process of step S303. On the other hand, if the master-slave communication between the master node 101 and the slave node A111 is established, the slave address of the slave node A111 has been switched normally from the initial address to the first changed address. In this case, the communication system 1000 advances the process to step S308.

[0041] In step S308, the communication system 1000 starts setting the address of a slave node other than the slave node A 111, for example, the slave node B 112. Specifically, the communication system 1000 supplies power (Vcc-B) from the master CPU 100 to the slave node B 112. At this time, power continues to be supplied to the slave node A 111, and the setting of the slave address "000101" of the slave node A 111 is maintained.

[0042] In step S309, the communication system 1000 performs initial settings for the slave node B 112 to which power has been supplied. Specifically, similar to step S302, in the slave node B 112, the slave CPU sets the initial address stored in the slave ROM as the slave address of the slave node B 112. Here, the initial address stored in the slave ROM of the slave node B 112 is the same address "0000100" as the initial address stored in the slave ROM 205A of the slave node A 111.

[0043] In step S310, the communication system 1000 causes the master node 101 to specify the slave address "0000100" of the slave node B 112, and starts master-slave communication between the master node 101 and the slave node B 112. To this end, the master node 101 outputs a data signal indicating the address "0000100" of the slave node B 112 to the serial data bus 102. In the slave node B 112, the specified address indicated by the received data signal is stored in the receiving address register.

[0044] In step S311, a process is executed to establish master-slave communication between the master node 101 and the slave node B 112. To this end, in the slave node B 112, the slave CPU compares the designated address stored in the receiving address register with the address (initial address) held in the internal address register. If the comparison of these two addresses shows that the two addresses match, the communication system 1000 establishes master-slave communication between the master node 101 and the slave node B 112.

[0045] In step S312, the communication system 1000 changes the slave address of the slave node B112. Specifically, the master node 101 transmits the second changed address stored in the master ROM 104 to the slave node B112 via the serial data bus 102. Here, the second changed address is an address different from both the initial address and the first changed address, and is an address unique to the slave node B112 in the master-slave communication system, for example, "0000110". The slave node B112 transfers the received second changed address to an internal address register. As a result, the slave address of the slave node B112 switches from the initial address "0000100" to the second changed address "0000110" as shown in FIG. 6.

[0046] In step S313, the communication system 1000 executes a process of starting master-slave communication between the master node 101 and the slave node B112 by specifying the second changed address "0000110".

[0047] In step S314, the communication system 1000 determines whether or not master-slave communication is established between the master node 101 and the slave node B 112. If the slave address of the slave node B 112 has been successfully switched from the initial address "0000100" to the second changed address "0000110", communication is established.

[0048] If the master-slave communication between the master node 101 and the slave node B 112 is not established as a result of the determination in step S314, the address of the slave node B 112 has not been switched normally from the initial address to the second changed address. In this case, the communication system 1000 returns to the process of step S310. On the other hand, if the master-slave communication between the master node 101 and the slave node B 112 is established, the address of the slave node B 112 has been switched normally from the initial address to the second changed address. In this case, the communication system 1000 proceeds to the process of step S315.

[0049] In step S315, the communication system 1000 starts setting the address of the slave node C 113, which is a slave node other than the slave node A 111 and the slave node B 112. Specifically, the communication system 1000 supplies power (Vcc-C) from the master CPU 100 to the slave node C 113. At this time, power continues to be supplied to the slave node A 111 and the slave node B 112, and the setting of the address "0000101" of the slave node A 111 and the setting of the address "0000110" of the slave node B 112 are maintained.

[0050] In step S316, the communication system 1000 performs initial settings for the slave node C113 to which power has been supplied. Specifically, similar to step S309, in the slave node C113, the slave CPU sets the initial address stored in the slave ROM as the slave address of the slave node C113. Here, the initial address stored in the slave ROM of the slave node C113 is the same address "0000100" as the initial address stored in the slave ROM 205A of the slave node A111.

[0051] In step S317, the communication system 1000 specifies the slave address "0000100" of the slave node C113 by the master node 101, and starts master-slave communication between the master node 101 and the slave node C113. To this end, the master node 101 outputs a data signal indicating the address "0000100" of the slave node C113 to the serial data bus 102. In the slave node C113, the specified address indicated by the received data signal is stored in the receiving address register.

[0052] In step S318, a process is executed to establish master-slave communication between the master node 101 and the slave node C113. To this end, in the slave node C113, the slave CPU compares the designated address stored in the receiving address register with the address (initial address) held in the internal address register. If the comparison of these two addresses shows that the two addresses match, the communication system 1000 establishes master-slave communication between the master node 101 and the slave node C113.

[0053] In step S319, the communication system 1000 changes the slave address of the slave node C113. Specifically, the master node 101 transmits the third changed address stored in the master ROM 104 to the slave node C113 via the serial data bus 102. Here, the third changed address is an address different from any of the initial address, the first and the second changed addresses, and is an address unique to the slave node C113 in the master-slave communication system, for example, "0000111". The slave node C113 transfers the received third changed address to its internal address register. As a result, the slave address of the slave node C113 is switched from the initial address "0000100" to the third changed address "0000111" as shown in FIG. 6.

[0054] In step S320, the communication system 1000 executes a process of starting master-slave communication between the master node 101 and the slave node C113 by specifying the third changed address "0000111".

[0055] In step S321, the communication system 1000 determines whether or not master-slave communication is established between the master node 101 and the slave node C 113. If the slave address of the slave node C 113 has been successfully switched from the initial address "0000100" to the third changed address "0000111", the communication is established.

[0056] If the master-slave communication between the master node 101 and the slave node C113 is not established as a result of the determination in step S321, the address of the slave node C113 has not been switched normally from the initial address to the third changed address. In this case, the communication system 1000 returns to the process of step S317. On the other hand, if the master-slave communication between the master node 101 and the slave node C113 has been established, the address of the slave node C113 has been switched normally from the initial address to the third changed address. In this case, the communication system 1000 ends the process shown in FIG. 4 and FIG. 5.

[0057] 7 is a flow chart showing the state determination process. This process is realized by the master CPU 100 expanding a program stored in the master ROM 104 into the RAM provided in the master CPU 100 and executing it. This process is executed after the slave address setting process (FIGS. 4 and 5) is executed, that is, after the slave address of each slave node is changed to a unique address. This process is started immediately after the slave address setting process is executed, or before data transmission / reception is attempted. Note that this process may be started when a command for state determination is input. In this process, the master CPU 100 plays the role of a trial means and a determination means in the present invention.

[0058] Incidentally, each slave node is reset to its initial state when the power supply is cut off or when it is affected by external noise, and is also reset when the power is momentarily interrupted for some reason. When each slave node is reset, its own slave address (stored in the internal address register) returns from its unique address to its initial address. In the reset state of the slave node, the slave address is maintained at the initial address. Normally, after the slave address setting process (Figs. 4 and 5) is executed, the slave addresses of all slave nodes are changed from the initial addresses to unique addresses. However, if the slave address change is not performed properly or if the above-mentioned reset or other circumstances occur, the slave address may have returned to the initial address.

[0059] On the other hand, it takes a long time to check the establishment of communication with each slave node one by one. Therefore, in this embodiment, the master CPU 100 checks for the presence of abnormal slave nodes by attempting communication using the initial address.

[0060] First, in step S701, the master CPU 100 supplies power to all slave nodes with which it is attempting to communicate, and also attempts to communicate with all slave nodes using their initial addresses. That is, as shown in Fig. 8, the master CPU 100 transmits the initial address to the serial data bus 102. This essentially transmits the initial address to all slave nodes (here, slave nodes A111, B112, and C113) at once. In each slave node, the initial address is stored in the receiving address register.

[0061] In step S702, the master CPU 100 determines whether the serial data bus 102 is in the ACK state. Here, each slave CPU outputs an ACK to the serial data bus 102 if the initial address stored in the receive address register and the slave address (the address held in the internal address register) match. If each slave node is operating normally, the slave address is a unique address, so an ACK is output. However, the slave CPU of a slave node where the two do not match outputs an NCK to the serial data bus 102. Therefore, if there is even one slave node whose slave address is the initial address, the serial data bus 102 is in the ACK state. However, if the slave addresses are unique addresses in all slave nodes, the serial data bus 102 is in the NCK state.

[0062] If it is determined in step S702 that the serial data bus 102 is not in the ACK state, the master CPU 100 advances the process to step S703. Therefore, if the serial data bus 102 is in the NCK state, the master CPU 100 advances the process to step S703. The fact that the serial data bus 102 is not in the ACK state corresponds to the case where the trial result indicates "communication unsuccessful." This means that there was not even one slave node that output an ACK. Therefore, in step S703, the master CPU 100 determines that the operating status of all slave nodes is normal. Thereafter, the master CPU 100 ends the process shown in FIG. 7.

[0063] On the other hand, if the result of the determination in step S702 is that the serial data bus 102 is in the ACK state, the master CPU 100 advances the process to step S704. The fact that the serial data bus 102 is in the ACK state corresponds to the case where the trial result indicates "establishment of communication." This means that there was at least one slave node that output an ACK. Therefore, in step S704, the master CPU 100 determines that the operating state of at least one slave node is not normal. In other words, the master CPU 100 determines that at least one of the slave nodes has been reset to the initial state.

[0064] In step S705, the master CPU 100 stops the supply of power to all slave nodes with which it has attempted communication (powers off). Then, in step S706, the master CPU 100 executes again a process similar to the slave address setting process shown in Figs. 4 and 5. As a result, the master CPU 100 causes the internal address registers of each slave node to hold their own unique addresses. Then, the master CPU 100 returns the process to step S701. Note that if the process of returning to step S701 is repeated a predetermined number of times without proceeding to step S703, an error may be notified and the process shown in Fig. 7 may be terminated.

[0065] In this way, by checking whether the serial data bus 102 is in the ACK state, the master CPU 100 can determine whether at least one slave node is abnormal or whether all slave nodes are normal.

[0066] According to this embodiment, the master CPU 100 attempts to communicate with each slave node using the initial address after changing the slave address of the slave node from the initial address to a unique address. Then, based on the result of the attempt, the operating state of each slave node is determined. That is, depending on whether the state of the serial data bus 102 connected to each slave node is ACK or not, it is possible to determine whether at least one slave node is abnormal or whether all slave nodes are normal. Therefore, the operating states of multiple slave nodes can be determined in a short time.

[0067] The present invention has been described above in detail based on preferred embodiments thereof, but the present invention is not limited to these specific embodiments, and various forms that do not deviate from the gist of the present invention are also included in the present invention. [Explanation of symbols]

[0068] 100 Master CPU 101 Master Node 111 Slave node A 112 Slave Node B 113 Slave Node C 1000 Master-slave communication system

Claims

1. A master-slave communication system including a master node and a plurality of slave nodes each having an initial address that is a non-unique address, A change means for executing a change process for changing the address of each of the plurality of slave nodes from the initial address to a unique address corresponding to each of the plurality of slave nodes, the unique address being different from the initial address; and a trial means for attempting communication with the plurality of slave nodes by using the initial address after the address of each of the plurality of slave nodes has been changed to a corresponding unique address by the change means, A master-slave communication system, wherein the change means executes the change process again when a result of the trial by the trial means indicates establishment of communication.

2. A master-slave communication system as described in claim 1, further characterized in that it further has a discrimination means for determining that the operating status of each of the multiple slave nodes is normal if the trial result indicates that communication has not been established.

3. 3. The master-slave communication system according to claim 2, wherein the determining means determines that the operating status of at least one of the plurality of slave nodes is not normal when the trial result indicates that communication has been established.

4. 3. The master-slave communication system according to claim 2, wherein the determination means determines that at least one of the plurality of slave nodes has been reset to an initial state when the trial result indicates that communication has been established.

5. The master node and the plurality of slave nodes communicate with each other using an I2C communication method, 2. The master-slave communication system according to claim 1, wherein the change means executes the change process again when, as a result of the attempt by the attempt means, the state of the serial data bus connected to the plurality of slave nodes is an ACK indicating that data has been normally received.

6. the attempting means attempts to communicate with the plurality of slave nodes by using the initial addresses while power is being supplied to all of the plurality of slave nodes; 2. The master-slave communication system according to claim 1, wherein, when the attempt result indicates that communication has been established, the attempt means stops the supply of power to each of the plurality of slave nodes, and then attempts to communicate with the plurality of slave nodes using the initial addresses while again supplying power to each of the plurality of slave nodes.

7. A communication system described in any one of claims 1 to 6, characterized in that the master node is an electronic device that communicates with the multiple slave nodes.

8. A method for controlling a master-slave communication system including a master node and a plurality of slave nodes each having an initial address that is a non-unique address, comprising the steps of: execute a change process for changing the address of each of the plurality of slave nodes from the initial address to a unique address corresponding to each of the plurality of slave nodes that is different from the initial address; After the change process is completed, attempting to communicate with the plurality of slave nodes using the initial addresses; A method for controlling a master-slave communication system, comprising the steps of: executing the change process again when a result of a communication trial using the initial address after completion of the change process indicates establishment of communication.

Citation Information

Patent Citations

  • Address setting method

    JP1993292098A

  • Transmission system

    JP1998271138A

  • Address setting method in network system

    JP2012195659A

  • Lighting device unit address initialization

    JP2014503970A

  • Communication system and communication device

    JP2015109608A