Independent address setting device and independent address setting method for multiple slave devices
By installing Hall sensors on the IC chip and dynamically allocating addresses using magnetic components, the problem of address conflicts in the I2C bus system is solved, and separate address settings of multiple slave devices and simplified inventory management are realized.
Patent Information
- Application Number
- CN202411538808.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-05-21
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-11
AI Technical Summary
In the I2C bus system, the same structure may be assigned the same address, resulting in address conflict problems; at the same time, the traditional address setting method is complicated and is not convenient to manage multiple IC chips with the same configuration.
By installing a Hall sensor on the IC chip and equipped with magnetic components on the test board, the Hall sensor is used to detect the polarity and magnetic field strength of the magnetic components, dynamically allocate and store pre-set different addresses.
The separate address setting of multiple slave devices is realized, which avoids address conflicts, simplifies the address setting process, and can allocate different addresses to each device, reducing the complexity of inventory management.
Smart Images

Figure CN119420732A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a device and method for setting individual addresses of multiple slave devices, and in particular to a device and method for setting individual addresses of multiple slave devices connected on the same bus interface and transmitting commands for operation.
[0002] This application claims priority, and its priority date is May 21, 2024, and the priority number is 10-2024-0065750. This application refers to the above priority document. Background Art
[0003] Generally speaking, in an electrical system, when information or signals need to be transmitted between components within the system, interconnection is often used. This type of interconnection is composed of one or more signal lines, also known as a bus. For example, some systems use a small number of communication lines to provide a communication environment for multiple ICs, so the I2C (Inter-Integrated Circuit) bus protocol is widely used.
[0004] The I2C bus is composed of a clock signal line (Serial Clock Line, SCL) and a data signal line (Serial Data line, SDA). Its function is to transmit data, and the data will be sent and received with the transmission of the clock. This I2C bus realizes data exchange between IC chips through two wires. The devices connected to the I2C bus communicate in a master (master) and slave (slave) relationship. Figure 1 As shown, the I2C bus is a serial bus protocol that can be used to communicate with multiple slave devices 21, 22, 23, and 24. These slave devices are connected to the master device 10 through the power line VDD, the clock signal line SCL, and the data signal line SDA to transmit and receive data. In this way, the I2C bus only needs two lines to control multiple chips in parallel.
[0005] The master device 10 generates a clock signal to control data transmission between the master device and the slave device. The master device 10 communicates with the required slave devices 21, 22, 23, 24 by assigning a slave address to each slave device 21, 22, 23, 24. The master device 10 specifies the address of the slave device 21, 22, 23, 24 by sending a plurality of bits of information (usually 1 byte) including an N-bit slave address and a command bit for specifying a read (Read) or write (Write) operation on the bus.
[0006] When two or more identical slave devices sharing the same address are connected to the bus, the master device 10 cannot access these slave devices individually. Therefore, each device connected to the bus must have its own unique bus address in order to achieve normal bus operation. In other words, since the master device and the slave device each have a unique address, the master device 10 calls a specific slave device by sending a given address to the data signal line SDA. For example, after the master device 10 generates a start condition on the bus, it will output the slave device address of the communication target. The slave device with the corresponding target slave device address will respond with an ACK signal (acknowledgement signal) to start communication.
[0007] During the communication process, the device receiving the data will respond to the ACK signal. The master device 10 terminates the communication with the slave device by generating a stop condition on the bus. Therefore, the master device 10 can communicate with the required slave device by assigning the slave device address to each slave device. However, when two or more devices composed of the same chip communicate data through the I2C bus, although they are each assigned a different address and can communicate with the master device, when two or more devices composed of chips of the same structure are connected to the bus, they may be assigned the same address, which leads to the generation of conflict problems.
[0008] In addition, the data signal line SDA of the slave device can be used as both input and output, while the clock signal line SCL is usually used only as input. Due to operator errors and other reasons, the signal lines are sometimes mistakenly cross-connected, resulting in the problem that the data transmitted from the master device cannot be received normally. Therefore, according to the characteristics of the I2C protocol, the clock signal line SCL and the data signal line SDA must accurately define the direction in order to enable communication. In I2C communication, the SCL and SDA pins of all slave devices must be connected in the same way.
[0009] In short, when using IC chips or IC chips with the same structure, problems will be encountered in connection and address allocation. It is necessary to use internal memory to modify the address, which may bring some complicated work. In particular, in order to drive multiple devices, the possibility of using IC chips with the same structure at the same time is limited, so it may be necessary to reserve multiple chips, which will also cause problems in inventory management. In addition, although the circuit design can be changed to set the address during the manufacturing stage, it is extremely difficult to make structural changes to the circuit design that has been manufactured, which has restrictive problems in the manufacturing process. Summary of the invention
[0010] The present invention aims to solve the above-mentioned problems. The purpose of the present invention is to provide a multiple slave device individual address setting device and an individual address setting method for individually setting unique addresses for multiple slave devices connected to a bus, so that a master device can individually access each slave device among the multiple slave devices connected to the bus.
[0011] In order to achieve the above-mentioned purpose, the device for setting individual addresses of multiple slave devices provided by the present invention includes multiple slave devices connected to a bus interface having a clock signal line and a data signal line and a test board, the IC chip of the multiple slave devices is equipped with a Hall sensor capable of detecting a magnetic field, the test board is equipped with a magnetic element, and the magnetic element is arranged at a position corresponding to the IC chip of the multiple slave devices, the IC chip of the multiple slave devices includes an address register, and the address register allocates and stores pre-set different addresses according to the polarity and magnetic field strength detected by the Hall sensor.
[0012] Optionally, the test board is equipped with at least two magnetic elements, and the at least two magnetic elements have different polarities and magnetic field strengths.
[0013] Optionally, the magnetic component of the test board is arranged at a position corresponding to each Hall sensor, and the magnetic components are separated from each other to prevent mutual interference.
[0014] Optionally, the multiple slave devices have at least two IC chips that share the same address.
[0015] Optionally, the IC chip includes: an address reference module, used to store address information pre-set according to the polarity and magnetic field strength of the magnetic component; a comparison module, used to compare the polarity and magnetic field strength of the magnetic component detected by the Hall sensor with the information stored in the address reference module, thereby determining the address, and transmitting the determined address to the address register.
[0016] To achieve the above object, the present invention further provides a method for setting individual addresses of multiple slave devices connected to a bus, which includes the following steps:
[0017] Align each Hall sensor mounted on the IC chip of the multi-slave device and the test board with the corresponding magnetic component;
[0018] activating the multiple slave devices according to the power supply and the generated signal of the test board;
[0019] detecting the polarity and magnetic field strength of the magnetic component by the Hall sensor on the multi-slave device; and
[0020] The multiple slave devices allocate and store different preset addresses according to the polarity and magnetic field strength of the magnetic component detected by each Hall sensor.
[0021] Optionally, in the step of activating the multiple slave devices according to the power supply signal and the generation signal of the test board, the step of sending an I2C / I3C command for changing the address can be executed.
[0022] Optionally, the test board is equipped with at least two magnetic elements, and the at least two magnetic elements have different polarities and magnetic field strengths.
[0023] Optionally, in the step of aligning each Hall sensor in the IC chip mounted on the multi-slave device and a test board having a corresponding magnetic component, the magnetic component aligns each Hall sensor with a different polarity.
[0024] Compared with the prior art, the device and method for setting individual addresses of multiple slave devices provided by the present invention have the following beneficial effects:
[0025] As described above, the present invention sets the addresses of multiple slave devices by equipping the IC chip with a function that can identify the environment and change the address, thereby achieving the effect of conveniently setting the addresses of multiple slave devices. By adopting the present invention, even if multiple IC chips with the same configuration are used as slave devices, different addresses can be assigned to each device, so the same chip can be used without using different chips to drive different drivers, thereby making it easier to perform inventory management compared to the traditional inventory management method that requires holding and managing multiple types of chips. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of a general device driver.
[0027] Figure 2 A schematic diagram of a device for setting individual addresses of multiple slave devices provided by an embodiment of the present invention.
[0028] Figure 3 A schematic diagram of a device for setting individual addresses of multiple slave devices provided by another embodiment of the present invention.
[0029] Figure 4 The figure is a block diagram of the IC chip structure of multiple slave devices in the apparatus for setting individual addresses for multiple slave devices according to an embodiment of the present invention.
[0030] Figure 5 The present invention is a flowchart of a method for setting individual addresses for multiple slave devices provided by an embodiment of the present invention.
[0031] Description of reference numerals:
[0032] 1000-Multiple slave devices with individual address setting device;
[0033] 100-multiple slave devices;
[0034] 110-IC chip;
[0035] 111-Hall sensor;
[0036] 112-address reference module;
[0037] 113- comparison module;
[0038] 114-address register;
[0039] 120-single slave device;
[0040] 130-Flexible printed circuit board;
[0041] 200-test board;
[0042] 210-Magnetic components. DETAILED DESCRIPTION
[0043] The advantages, features and ways to achieve them of the invention will be clearly presented in the detailed embodiments and drawings. However, the present invention is not limited to the embodiments mentioned below, but can be implemented in a variety of different forms. The terms used in this specification are only used to describe the embodiments and are not intended to limit the present invention. In this specification, unless otherwise specified, the singular form also covers the plural form. The use of terms such as "comprises" and "comprising" does not exclude the existence of one or more other components or additions to the components described. Throughout the specification, the same graphic symbols represent the same components, and the term "and / or" covers each and all combinations of the components. Although the terms "first", "second" and the like are used to describe various components, these components are not subject to these terms. These terms are only used to distinguish one component from another. Therefore, the first component mentioned below may be the second component within the technical concept of the present invention, and vice versa.
[0044] In this specification, the word "exemplary" is used to indicate that it is used as an example or example. Any embodiment described as "exemplary" in this specification should not be interpreted as necessarily ideal or more advantageous than other embodiments. In addition, the term "module" used in this specification refers to software, hardware such as FPGA or ASIC, and "module" can perform various roles. However, "module" is not limited to the meaning of software or hardware. "Module" can be configured as an addressable part in a storage medium, and can also be configured to drive one or more processors. Therefore, for example, "module" can cover software elements, object-oriented software elements, class elements and task elements, as well as processes, functions, attributes, procedures, subroutines, program code segments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays and variables. The functions provided in elements and "modules" can be combined into fewer elements and "modules", or decomposed into more additional elements and "modules".
[0045] Each "module" herein can be controlled by at least one processor, and at least one processor can execute the operation performed by the "module" started this time. The embodiments herein can be achieved by at least one software program running on at least one hardware device, and can perform network management functions to control elements.
[0046] All terms (including technical and scientific terms) used in this specification can be understood as meanings that are generally understood by ordinary technicians in the conventional technical field. In addition, terms that are generally used and have been defined in dictionaries are not ideally over- or over-interpreted without clear and special definitions. Unless otherwise defined, all terms (including technical and scientific terms) used in this specification can be regarded as meanings that are generally understood by ordinary technicians in the conventional technical field. In addition, terms that are generally used and have been defined in dictionaries should not be over- or over-interpreted in an ideal situation when no special definition is clearly given.
[0047] Next, the technical features of the present invention are specifically described with reference to the accompanying drawings. In the environment of I2C and I3C communication protocols, if two or more slave devices use the same IC chip (same model), they may have the same address. This may result in the need to assign different addresses to these slave devices when driving the device.
[0048] The present invention provides a device and method for setting individual addresses of multiple slave devices, which provide a bus interface for individually setting addresses of multiple slave devices. The interface integrates a clock signal line and a data model line to connect a master device so that the master device can individually access each slave device.
[0049] In one embodiment, the present invention can conveniently set addresses even when slave devices with the same configuration are used simultaneously.
[0050] Specifically, please refer to Figure 2 and Figure 3 ,in, Figure 2 A schematic diagram of a device for setting individual addresses of multiple slave devices (two) provided by an embodiment of the present invention. Figure 3 A schematic diagram of a device for setting individual addresses of multiple slave devices (four) provided in another embodiment of the present invention.
[0051] like Figure 2 and Figure 3 As shown, the device 1000 for setting individual addresses of multiple slave devices provided by the present invention comprises multiple slave devices 100 and a test plate 200. The multiple slave devices 100 are composed of IC chips 110 that share the same address and are equipped with a magnetic field detection device.
[0052] In fact, in addition to the IC chip 110 for detecting magnetic fields, the multi-slave device 100 may also include components that perform other functions. However, in the embodiment of the present invention, the address of the IC chip 110 with address information needs to be set, so the description of other configurations is omitted.
[0053] That is, in the embodiment of the present invention, the multi-slave device 100 can be described as a collection of multiple IC chips. More specifically, the multi-slave device 100 refers to a situation where each slave device has an IC chip 110 with the same address installed inside. Figure 2 and Figure 3 As shown, the multi-slave device 100 can be formed by equipping a flexible printed circuit board (FPCB) 130, but this is only an embodiment, and the device can be formed in other forms, and is not limited to the form of a board. Figure 2 As shown, in addition to the multiple slave devices 100 sharing the same address, a separate single slave device 120 can also be provided. In this case, the single slave device 120 is assigned a unique address, so there is no need to set a separate address. In the multiple slave devices 100, the component that stores the address is the IC chip 110. In order to set the address, the IC chip 110 is equipped with a function that can recognize the environment and can change the address, and the address of the multiple slave devices 100 is set by means of this function.
[0054] Figure 4 FIG. 1 is a block diagram of the IC chip structure of multiple slave devices in a device for setting individual addresses for multiple slave devices according to an embodiment of the present invention. Figure 4 As shown, the IC chip 110 includes a Hall sensor 111 , an address reference module 112 , a comparison module 113 and an address register 114 .
[0055] Here, the structure of the IC chip 110 is described by modularizing the functional components for setting the address, and does not represent a functional structure diagram of the entire IC chip 110 .
[0056] The Hall sensor 111 is used to detect the polarity and magnetic field strength of the magnetic component. For example, it can distinguish whether the polarity of the contacted magnetic component is N pole or S pole, and can detect the strength of the magnetic field according to the polarity.
[0057] The address reference module 112 stores the pre-set address information according to the polarity and magnetic field strength information of the magnetic component (that is, the address is set in advance according to the polarity and magnetic field strength of the magnetic component). For example, the information stored in the address reference module 112 may be: when the polarity of the magnetic component is N pole, the address is set to 1; when the polarity of the magnetic component is S pole, the address is set to 2.
[0058] The comparison module 113 compares the information of the polarity and magnetic field strength of the magnetic component obtained from the Hall sensor 111 with the information preset by the address reference module 112, thereby determining the address, and transmitting the determined address to the address register 114. The address register 114 is used to store the address assigned by the comparison module 113, thereby setting the address of the IC chip 110.
[0059] The test board 200 is electrically connected to the flexible printed circuit board (FPCB) 130 of the multiple slave devices 100 or the single slave device 120 equipped according to the embodiment of the present invention, and a magnetic component 210 is provided at the corresponding position of each IC chip 110 on the multiple slave devices 100 sharing the same address. That is, the test board 200 is placed at the bottom of the flexible printed circuit board (FPCB) 130 equipped with multiple slave devices 100 or the single slave device 120, so that the flexible printed circuit board (FPCB) 130 and the test board 200 are aligned in the vertical direction, so that a magnetic component 210 is installed at a position corresponding to each position of the multiple slave devices 100 where the IC chip 110 is installed. In this embodiment, the magnetic component 210 is composed of a magnet (Magnet) as an example for explanation, but it is not limited to this. For example, the magnetic component 210 can be implemented as a device that imparts magnetism, such as a device that generates a magnetic field.
[0060] Furthermore, the number of magnetic components 210 on the test board 200 may vary according to the number of multiple slave devices 100, but at least two or more magnetic components 210 are provided, and these magnetic components 210 have different polarities and magnetic field strengths. Figure 2 In the embodiment, for a multi-slave device having two IC chips, the test board is equipped with two magnetic components 210 having different polarities, one is an N-pole magnetic component 211, and the other is an S-pole magnetic component 212. Figure 3 In the embodiment, for a multi-slave device having four IC chips, the test board 200 is equipped with four magnetic components 210 having different polarities and magnetic field strengths, which are respectively an N-pole magnetic component 211, an S-pole magnetic component 212, an N / 2-pole magnetic component 213, and an S / 2-pole magnetic component 214. At this time, the magnetic components 210 are distinguished according to their polarities and magnetic field strengths, so the polarity order of the magnetic components 210 is irrelevant.
[0061] In addition, the magnetic components 210 on the test board 200 are arranged at positions corresponding to the Hall sensors 111 on the IC chips 110 of the multi-slave devices 100, but each magnetic component 210 is placed at a sufficiently far distance to avoid being affected by the surrounding magnetic field. Here, the test board 20 can be configured as an actual master device role, and can activate the multi-slave devices 100 on the flexible printed circuit board (FPCB) through the supply power and the generated signal of the test board 200.
[0062] In the embodiment of the present invention, since setting addresses on the IC chips of the multi-slave devices 100 is the key, descriptions of other functions of the test board 200 are omitted.
[0063] The method for setting multiple slave device individual addresses using the device 1000 configured as above is as follows: Figure 5 As shown, it is a flow chart of a method for setting individual addresses of multiple slave devices provided by an embodiment of the present invention. Figure 5 As shown, the method includes the following steps S100 to S400.
[0064] Step S100 , aligning each Hall sensor 111 mounted on the IC chip 110 of the multi-slave device 100 and the test board 200 having the corresponding magnetic component 210 .
[0065] Furthermore, the IC chip 110 is equipped with a function of being able to sense the environment and change the address, and the number of magnetic components 210 on the test board 200 is at least two or more, and different magnetic components 210 have different polarities and magnetic field strengths. When aligning each Hall sensor 111 of the multi-slave device 100 with the test board 200 having the corresponding magnetic component 210, it is best to use a magnetic component 210 with different polarities and magnetic field strengths for each Hall sensor 111 for alignment.
[0066] Furthermore, the magnetic components 210 on the test board 200 are configured to be sufficiently far away from each other to avoid being affected by adjacent magnetic components and their magnetic fields.
[0067] Step S200 : activating multiple slave devices 100 according to the power supply and the generated signal of the test board 200 .
[0068] With the test board 200 electrically connected to the flexible printed circuit board (FPCB) 130 with multiple slave devices 100, the power supply of the test board 200 supplies power to the flexible printed circuit board (FPCB) 130 and receives an I2C / I3C command for address setting to start the address change procedure.
[0069] Step S300 : Detecting the polarity and magnetic field strength of the magnetic component 210 through the Hall sensor 111 on the multi-slave device 100 .
[0070] Step S400 : The multi-slave device 100 allocates and stores different preset addresses according to the polarity and magnetic field strength of the magnetic component 210 detected by each Hall sensor 111 .
[0071] That is, different addresses can be assigned to the magnetic component 210 using the pre-set address information according to the polarity and magnetic field strength of the magnetic component 210 detected by the Hall sensor 111. Therefore, the present invention sets the addresses of multiple slave devices by equipping the IC chip with a function that can sense the environment and change the address, making it more convenient and effective to set the addresses of multiple slave devices.
[0072] The present invention allows multiple IC chips of the same configuration to be used as slave devices, and can assign different addresses to each device, so the same chip can be used without using a different chip for each driver. In this way, inventory management can be implemented more easily than the traditional method of owning and managing multiple types of chips. The above description is only an exemplary description of the technical idea of the present invention. For those who are familiar with the conventional knowledge in this technical field, various modifications and variations can be made without departing from the basic characteristics of the present invention. Therefore, the embodiments disclosed by the present invention are not intended to limit the scope of the technical idea of the present invention, but are provided for illustration.
Claims
1. A device for setting individual addresses of multiple slave devices, characterized in that: The invention comprises a plurality of slave devices connected to a bus interface having a clock signal line and a data signal line and a test board, wherein a Hall sensor capable of detecting a magnetic field is installed on an IC chip of the plurality of slave devices, and the test board is provided with a magnetic element, wherein the magnetic element is arranged at a position corresponding to the IC chip of the plurality of slave devices, and the IC chip of the plurality of slave devices comprises an address register, and the address register allocates and stores different preset addresses according to the polarity and magnetic field strength detected by the Hall sensor.
2. The device for setting individual addresses of multiple slave devices according to claim 1, characterized in that: The test board is equipped with at least two magnetic elements, and the at least two magnetic elements have different polarities and magnetic field strengths.
3. The device for setting individual addresses of multiple slave devices according to claim 2, characterized in that: The magnetic components of the test board are arranged at positions corresponding to each Hall sensor, and the magnetic components are separated from each other to prevent mutual interference.
4. The device for setting individual addresses of multiple slave devices according to claim 1, characterized in that: The multi-slave device has at least two IC chips that share the same address.
5. The device for setting individual addresses of multiple slave devices according to claim 1, characterized in that: The IC chip further comprises: An address reference module, used to store address information preset according to the polarity and magnetic field strength of the magnetic component; The comparison module is used to compare the polarity and magnetic field strength of the magnetic component detected by the Hall sensor with the information stored in the address reference module, thereby determining the address, and transmitting the determined address to the address register.
6. A method for setting individual addresses of multiple slave devices, characterized in that: The following steps are involved: Align each Hall sensor mounted on the IC chip of the multi-slave device and the test board with the corresponding magnetic component; activating the multiple slave devices according to the power supply and the generated signal of the test board; detecting the polarity and magnetic field strength of the magnetic component by the Hall sensor on the multi-slave device; as well as The multiple slave devices allocate and store different preset addresses according to the polarity and magnetic field strength of the magnetic component detected by each Hall sensor.
7. The method for setting individual addresses of multiple slave devices according to claim 6, characterized in that: The test board is equipped with at least two magnetic elements, and the at least two magnetic elements have different polarities and magnetic field strengths.
8. The method for setting individual addresses of multiple slave devices according to claim 6, characterized in that: In the step of aligning each Hall sensor in the IC chip mounted on the multi-slave device and a test board having a corresponding magnetic component, the magnetic component aligns each Hall sensor with a different polarity.