Method for setting device address, electronic device and chip
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI AWINIC TECH CO LTD
- Filing Date
- 2025-04-25
- Publication Date
- 2026-08-07
AI Technical Summary
但是,当总线上的多个从机单元使用了同样的设备地址时,主机单元就无法通过设备地址对从机单元进行区分,从而影响主机单元与从机单元的通信
[0017] In this embodiment, the method for setting a device address can be used in a slave unit of an electronic device. The slave unit receives an address setting command from a master unit, drives one or more connected coils to generate a magnetic field according to the command, and detects the magnetic field information of the generated magnetic field using a magnetic field sensor. The magnetic field information generated by each slave unit's corresponding coil is different. Based on the magnetic field information, the slave unit sets its own device address so that it is different from the device addresses of other slave units. This method utilizes the differences in the magnetic field information of the coils connected to different slave units to set their own device addresses, ensuring the uniqueness of each slave unit's device address. This solves the problem of identical device addresses for slave units, allowing the master unit to distinguish slave units by their device addresses and ensuring normal communication between the master and slave units.
Smart Images

Figure CN120448313B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method for setting a device address, an electronic device, and a chip. Background Technology
[0002] Currently, master-slave architecture buses such as IIC (Inter-Integrated Circuit) and I3C (Improved Inter-Integrated Circuit) support multiple slave units connected to the bus. The master unit distinguishes these slave devices through their device addresses, thus enabling communication between the master and slave units. However, when multiple slave units on the bus use the same device address, the master unit cannot distinguish between them, affecting communication between the master and slave units. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method for setting a device address to at least partially solve the above-mentioned problems.
[0004] This application provides a method for setting a device address for a slave unit of an electronic device. The electronic device includes a master unit and a plurality of slave units, each slave unit being connected to at least one coil. The method includes: receiving an address setting instruction sent by the master unit; driving one or more connected coils to generate a magnetic field according to the address setting instruction; and detecting magnetic field information of the generated magnetic field through a magnetic field sensor; wherein the magnetic field information of the magnetic field generated by each slave unit driving its corresponding coil is different; and setting the device address of the slave unit itself according to the magnetic field information, so that the device address of the slave unit itself is different from the device addresses of the other slave units.
[0005] In one possible implementation, the magnetic field information includes the magnetic field direction and / or magnetic field strength.
[0006] In one possible implementation, the slave unit of the electronic device includes a first slave unit and a second slave unit with the same original device address; the magnetic field information includes the magnetic field direction; a first connection terminal of the first slave unit is connected to a first connection terminal of a first coil; a second connection terminal of the first slave unit is connected to a second connection terminal of the first coil; a first connection terminal of the second slave unit is connected to a second connection terminal of a second coil; a second connection terminal of the second slave unit is connected to a first connection terminal of the second coil; and the winding direction of the first coil from the first connection terminal to the second connection terminal is the same as the winding direction of the second coil from the first connection terminal to the second connection terminal.
[0007] In one possible implementation, the slave unit of the electronic device includes a first slave unit and a second slave unit with the same original device address; the magnetic field information includes the magnetic field direction, a first connection terminal of the first slave unit is connected to a first connection terminal of a first coil, a second connection terminal of the first slave unit is connected to a second connection terminal of the first coil; a first connection terminal of the second slave unit is connected to a first connection terminal of a second coil, a second connection terminal of the second slave unit is connected to a second connection terminal of the second coil, and the winding direction of the first coil from the first connection terminal to the second connection terminal is opposite to the winding direction of the second coil from the first connection terminal to the second connection terminal.
[0008] In one possible implementation, setting the device address of the slave unit itself based on the magnetic field information includes: determining setting parameters corresponding to the magnetic field information based on the magnetic field information and preset mapping information; wherein the mapping information is used to indicate the correspondence between the magnetic field information and the setting parameters, and different magnetic field information corresponds to different setting parameters; and setting the device address based on the determined setting parameters.
[0009] In one possible implementation, setting the device address according to the determined setting parameters includes setting a predetermined number of bits of data in the original device address to the determined setting parameters.
[0010] In one possible implementation, the magnetic field direction includes a first direction and a second direction, wherein the first direction and the second direction are opposite in direction.
[0011] In one possible implementation, the electronic device includes a motor, and the coil is used to drive a magnet in the motor to move. The step of driving one or more of the connected coils to generate a magnetic field according to the address setting instruction, and detecting the magnetic field information of the generated magnetic field using a magnetic field sensor, includes: outputting a first current to the coil according to the address setting instruction to drive the coil to generate a first magnetic field, the first magnetic field being used to make the magnet move to its maximum stroke; detecting the first magnetic field using a magnetic field sensor to obtain a detection signal corresponding to the first magnetic field; outputting a second current to the coil to drive the coil to generate a second magnetic field, wherein the direction of the second current is the same as the direction of the first current, the current value of the second current is different from the current value of the first current, and the second magnetic field is also used to make the magnet move to its maximum stroke; detecting the second magnetic field using a magnetic field sensor to obtain a detection signal corresponding to the second magnetic field; performing a difference operation on the detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field to obtain a difference signal, and determining the magnetic field information based on the difference signal.
[0012] In one possible implementation, the output terminal of the magnetic field sensor is connected to a signal amplification circuit and an analog-to-digital conversion circuit; the step of detecting the first magnetic field by the magnetic field sensor to obtain a detection signal corresponding to the first magnetic field includes: detecting the first magnetic field by the magnetic field sensor to obtain an initial detection signal output by the magnetic field sensor; amplifying the initial detection signal by the signal amplification circuit to obtain an amplified signal corresponding to the initial detection signal; and performing analog-to-digital conversion on the amplified signal by the analog-to-digital conversion circuit to obtain a detection signal corresponding to the first magnetic field.
[0013] This application embodiment also provides a method for setting a device address for a host unit of an electronic device, the electronic device including the host unit and a plurality of slave units, each slave unit being connected to at least one coil; the method includes: sending an address setting instruction to a plurality of slave units with the same device address, such that when a slave unit receives the address setting instruction sent by the host unit, it drives one or more connected coils to generate a magnetic field according to the address setting instruction, and detects the magnetic field information of the generated magnetic field through a magnetic field sensor; wherein the magnetic field information of the magnetic field generated by each slave unit driving its corresponding coil is different; and setting the device address of the slave unit itself according to the magnetic field information, so that the device address of the slave unit itself is different from the device addresses of the other slave units.
[0014] In one possible implementation, the method further includes: obtaining preset device address setting information; the device address setting information includes the device address set by each of the slave units; sending authentication instructions to multiple slave units with the same device address according to the set device address; and determining the slave unit corresponding to each set device address according to the response of each slave unit.
[0015] This application also provides a method for setting a device address. An electronic device includes a host unit and multiple slave units, each slave unit being connected to at least one coil. The host unit is configured to send an address setting instruction to the multiple slave units with the same device address. Each slave unit is configured to receive the address setting instruction sent by the host unit, drive one or more connected coils to generate a magnetic field according to the address setting instruction, and detect the magnetic field information of the generated magnetic field through a magnetic field sensor. The magnetic field information generated by each slave unit driving its corresponding coil is different. Based on the magnetic field information, each slave unit sets its own device address so that its own device address is different from the device addresses of other slave units.
[0016] This application also provides a chip for performing the method described in any of the above embodiments.
[0017] In this embodiment, the method for setting a device address can be used in a slave unit of an electronic device. The slave unit receives an address setting command from a master unit, drives one or more connected coils to generate a magnetic field according to the command, and detects the magnetic field information of the generated magnetic field using a magnetic field sensor. The magnetic field information generated by each slave unit's corresponding coil is different. Based on the magnetic field information, the slave unit sets its own device address so that it is different from the device addresses of other slave units. This method utilizes the differences in the magnetic field information of the coils connected to different slave units to set their own device addresses, ensuring the uniqueness of each slave unit's device address. This solves the problem of identical device addresses for slave units, allowing the master unit to distinguish slave units by their device addresses and ensuring normal communication between the master and slave units. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0019] Figure 1This is a flowchart of the steps of a method for setting a device address provided in an optional embodiment of this application;
[0020] Figure 2 This is a schematic diagram of the magnetic field direction of a coil generating a magnetic field, provided in an optional embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a first slave unit and a first coil provided in an optional embodiment of this application;
[0022] Figure 4 This is a schematic diagram of a second slave unit and a second coil provided in an optional embodiment of this application;
[0023] Figure 5 This is a schematic diagram of another second slave unit and a second coil provided in an optional embodiment of this application;
[0024] Figure 6 This is a schematic diagram of another first slave unit and a first coil provided in an optional embodiment of this application;
[0025] Figure 7 This is a schematic diagram of another second slave unit and a second coil provided in an optional embodiment of this application;
[0026] Figure 8 This is a schematic diagram of the structure of a motor provided in an optional embodiment of this application;
[0027] Figure 9 This is a schematic diagram of the structure of a motor provided in an optional embodiment of this application;
[0028] Figure 10 This is one of the optional embodiments provided in this application. Figure 1 Flowchart of step 110 for detecting magnetic field information;
[0029] Figure 11 This is one of the optional embodiments provided in this application. Figure 1 The flowchart for step 120. Detailed Implementation
[0030] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.
[0031] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0032] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0033] This application provides a method for setting a device address for a slave unit of an electronic device, to at least partially solve the aforementioned problems. Specifically, the electronic device includes a master unit and multiple slave units, which can communicate via an IIC bus or an I3C bus. Each slave unit is connected to at least one coil, and the slave unit can output current to the coil, thereby driving the coil to generate a magnetic field.
[0034] like Figure 1 As shown, the method for setting the device address provided in this application embodiment includes:
[0035] S110: Receive the address setting command sent by the master unit, drive one or more connected coils to generate a magnetic field according to the address setting command, and detect the magnetic field information of the generated magnetic field through a magnetic field sensor; wherein, the magnetic field information of the magnetic field generated by each slave unit driving the corresponding coil is different.
[0036] When the master unit communicates with the slave unit, it can determine whether there are multiple slave units with the same device address. If multiple slave units with the same device address exist, the master unit can send an address setting command to the slave units with the same device address, causing the slave units to enter the address setting state. The address setting command may include current direction information, which is used to indicate the direction of the current output by the slave unit to the coil. In this embodiment, the current direction information of the address setting command indicates that each slave unit with the same device address outputs current in the same direction to the coil. For example, the first connection terminal of the slave unit can be connected to one end of the coil, and the second connection terminal of the slave unit can be connected to the other end of the coil. The current direction information can indicate that the slave unit outputs current from the first connection terminal and receives current from the second connection terminal, or outputs current from the second connection terminal and receives current from the first connection terminal.
[0037] The slave unit can output current to one or more coils connected to it to drive the current generated by one or more coils.
[0038] Magnetic field sensors, including magnetoresistive sensors, Hall effect sensors, and fluxgate sensors, can be used to detect information such as the strength and direction of magnetic fields. Specific usage methods for various magnetic field sensors can be found in relevant technical documents and will not be elaborated upon here. The coils connected to the slave unit can correspond one-to-one with magnetic field sensors, so the magnetic field information of one coil is detected by a corresponding magnetic field sensor. The magnetic field sensor can be integrated into the slave unit or located externally and connected to the slave unit, as long as the slave unit can control the magnetic field sensor to detect the magnetic field information of the coil. When the magnetic field sensor is located externally to the slave unit, the analog-to-digital conversion circuit can be electrically connected to the slave unit.
[0039] Furthermore, the magnetic field sensor can be located inside or outside the coil; this application does not impose any limitation on this. The positional relationship between the magnetic field sensor and the coil corresponding to each slave unit can be the same or different.
[0040] In some optional embodiments, the magnetic field information includes the magnetic field direction and / or magnetic field strength. Specifically, as one possible implementation, the magnetic field information includes the magnetic field direction, and the magnetic field directions generated by the corresponding coils driven by each slave unit are different, so that slave units can be distinguished by the magnetic field direction generated by the connected coils driven by the slave units. As another possible implementation, the magnetic field information includes the magnetic field strength, and the magnetic field strength generated by the corresponding coils driven by each slave unit is different, so that slave units can be distinguished by the magnetic field strength generated by the connected coils driven by the slave units. As another feasible implementation method, the magnetic field information includes the magnetic field direction and magnetic field strength. Since the combination of magnetic field direction and magnetic field strength generated by the coils driven by each slave unit is different, the slave units can be distinguished by the magnetic field direction and magnetic field strength generated by the coils connected to the slave unit. Furthermore, it is possible to set two slave units with the same device address to have different magnetic field directions and magnetic field strengths when they are driven to the coils. In this case, the slave units can be distinguished by the magnetic field direction and magnetic field strength of the coils connected to the slave unit. Compared with distinguishing slave units by only the magnetic field direction or magnetic field strength of the coils connected to the slave unit, this method has more effective reference information and helps to improve the accuracy of distinguishing slave units.
[0041] In this embodiment, the magnetic field information includes the magnetic field direction and / or magnetic field strength. Both the magnetic field direction and magnetic field strength are quantifiable physical properties of the magnetic field. Including the magnetic field direction and / or magnetic field strength in the magnetic field information helps to reduce the difficulty of obtaining magnetic field information.
[0042] In some alternative embodiments, the magnetic field direction includes a first direction and a second direction, wherein the first direction and the second direction are opposite in direction.
[0043] The magnetic field generated by each coil can be used as a reference to determine the direction of the magnetic field. Figure 2 A coil 100 connected to a slave unit is shown. The coil 100 has a first connection terminal 111 and a second connection terminal 112 for connection to the slave unit. The first connection terminal 111 is connected to a first end 121 of the coil, and the second connection terminal 112 is connected to a second end 122 of the coil. Figure 2 As shown, the central axis Z of the coil is parallel to the first direction 131 and the second direction 132. The first direction 131 is the direction along the central axis Z of the coil from the first end 121 to the second end 122 of the coil, and the second direction 132 is the direction along the central axis Z of the coil from the second end 122 to the first end 121 of the coil. Alternatively, the first direction can be the direction along the central axis Z of the coil from the second end to the first end of the coil, and the second direction can be the direction along the central axis Z of the coil from the first end to the second end of the coil. That is, the coil 100 can be used as the reference for the magnetic field direction of the coil 100, and two opposing directions parallel to the central axis of the coil 100 can be set as the first direction and the second direction. The magnetic field direction of each coil in this application (e.g., the first coil and the second coil below) can be defined with reference to the above embodiments, and will not be described in detail here.
[0044] Since the magnetic field direction inside the coil is from the S pole to the N pole, and the magnetic field direction outside the coil is from the N pole to the S pole, when a magnetic field sensor is located outside the corresponding coil, the direction of the detected magnetic field may be exactly opposite to the direction of the magnetic field inside the coil relative to the two ends of the coil. The magnetic field direction of all coils should be uniformly taken as the direction of the magnetic field inside the coil, or uniformly taken as the direction of the magnetic field outside the coil. If some magnetic field sensors are located inside the coil they are detecting, and some magnetic field sensors are located outside the coil they are detecting, then when the slave unit detects the magnetic field information of the coil through the magnetic field sensors, it can determine the direction of the coil's magnetic field based on the position of the magnetic field sensors relative to the coil (inside / outside the coil) and the detection signal obtained from the magnetic field information detected by the magnetic field sensors, so as to unify the determined magnetic field direction to the direction of the magnetic field inside / outside the coil. In addition, if all magnetic field sensors are located inside the coil they are detecting, or all magnetic field sensors are located outside the coil they are detecting, then the slave unit can directly determine the direction of the coil's magnetic field based on the detection signal obtained from the magnetic field information detected by the magnetic field sensors.
[0045] The magnetic field information generated by the magnetic field sensor includes: detecting whether the magnetic field direction is a first direction or a second direction. The magnetic field sensor detects the magnetic field of the coil and obtains a corresponding detection signal. Based on this detection signal, the magnetic field direction can be determined as either the first or second direction. For example, if the detection signal value is positive, the magnetic field direction of the coil is the first direction; if the detection signal value is negative, the magnetic field direction is the second direction. Alternatively, if the detection signal value is 1, representing a high level, the magnetic field direction is the first direction; if the detection signal value is 0, representing a low level, the magnetic field direction is the second direction. Of course, the steps in the following embodiment can also be performed: obtaining a detection signal corresponding to the first magnetic field and a detection signal corresponding to the second magnetic field through the magnetic field sensor, then obtaining a difference signal through difference calculation, and determining the magnetic field direction based on the difference signal. The specific process can be referred to the description in the following embodiment, and will not be repeated here.
[0046] In this embodiment, the magnetic field direction includes a first direction and a second direction, which are opposite to each other. The magnetic field direction can be determined by detecting whether the magnetic field direction is the first or the second direction using a magnetic field sensor, without having to include other directions within the range of the coil magnetic field direction, thus greatly reducing the complexity of detecting the coil magnetic field direction.
[0047] In some optional embodiments, the slave unit of the electronic device may include a first slave unit and a second slave unit with the same original device address. The first slave unit is connected to a first coil, and the second slave unit is connected to a second coil. The first slave unit and the second slave unit may respectively execute the method for setting the device address provided in the embodiments of this application.
[0048] Optionally, under the drive of the first slave unit and the second slave unit, the magnetic field information generated by the first coil and the second coil may include the magnetic field direction. By arranging the winding direction of the coil and the connection relationship between the coil and the slave unit, the magnetic field directions of the first coil and the second coil may be different even if the output current directions of the first slave unit and the second slave unit are the same.
[0049] like Figure 3 and Figure 4As shown, in some optional embodiments, the first connection terminal 211 of the first slave unit 210 is connected to the first connection terminal 231 of the first coil 230, and the second connection terminal 212 of the first slave unit 210 is connected to the second connection terminal 232 of the first coil 230. The first connection terminal 221 of the second slave unit 220 is connected to the second connection terminal 242 of the second coil 240, and the second connection terminal 222 of the second slave unit 220 is connected to the first connection terminal 241 of the second coil 240. The winding direction of the first coil 230 from the first connection terminal 231 to the second connection terminal 232 is the same as the winding direction of the second coil 240 from the first connection terminal 241 to the second connection terminal 242. The winding direction of the coil can be understood as the helical direction of the coil wire along the coil frame or magnetic core, usually indicated by clockwise or counterclockwise. Figure 3 The first coil 230 is wound clockwise from the first connecting end 231 to the second connecting end 232. Figure 4 The winding direction of the second coil 240 from the first connection terminal 241 to the second connection terminal 242 is also clockwise. In the embodiments of this application, when the output current of the first slave unit 210 and the second slave unit 220 is in the same direction, for example, when the output current of the first slave unit 210 and the second slave unit 220 is output from the first connection terminal and input from the second connection terminal, the magnetic field direction inside the first coil 230 is opposite to the magnetic field direction inside the second coil 240. The magnetic field direction of each coil, such as the first coil 230 and the second coil 240, can be taken as the direction of the magnetic field inside the coil.
[0050] In this embodiment, when the slave unit of the electronic device includes a first slave unit and a second slave unit with the same original device address, the magnetic field information may only include the magnetic field direction. By setting the first connection terminal of the first slave unit to be connected to the first connection terminal of the first coil, and the second connection terminal of the first slave unit to be connected to the second connection terminal of the first coil; the first connection terminal of the second slave unit to be connected to the second connection terminal of the second coil, and the second connection terminal of the second slave unit to be connected to the first connection terminal of the second coil, and the winding direction of the first coil from the first connection terminal to the second connection terminal is the same as the winding direction of the second coil from the first connection terminal to the second connection terminal, by setting different connection methods between the coil and the slave unit, when the current directions of the first slave unit and the second slave unit are the same, it is simple and convenient to realize that the magnetic field directions of the first coil and the second coil are opposite, that is, to realize that the magnetic field information of each slave unit driving the corresponding coil to generate a magnetic field is different, which is beneficial to the practical application of the device address setting method of this application.
[0051] like Figure 3 and Figure 5As shown, in some alternative embodiments, the first connection terminal 211 of the first slave unit 210 is connected to the first connection terminal 231 of the first coil 230, the second connection terminal 212 of the first slave unit 210 is connected to the second connection terminal 232 of the first coil 230, the first connection terminal 221 of the second slave unit 220 is connected to the first connection terminal 241 of the second coil 240, and the second connection terminal 222 of the second slave unit 220 is connected to the second connection terminal 242 of the second coil 240. The winding direction of the first coil 230 from the first connection terminal 231 to the second connection terminal 232 is opposite to the winding direction of the second coil 240 from the first connection terminal 241 to the second connection terminal 242. For example, the winding direction of the first coil 230 from the first connection terminal 231 to the second connection terminal 232 is clockwise, and the winding direction of the second coil 240 from the first connection terminal 241 to the second connection terminal 242 is counterclockwise. In this embodiment, when the output current of the first slave unit 210 and the second slave unit 220 is in the same direction, for example, when the output current of the first slave unit 210 and the second slave unit 220 is output from the first connection terminal and input from the second connection terminal, the magnetic field direction inside the first coil 230 is opposite to the magnetic field direction inside the second coil 240. The magnetic field direction of each coil, such as the first coil 230 and the second coil 240, can be taken as the direction of the magnetic field inside the coil.
[0052] In this embodiment, the first connection terminal of the first slave unit is connected to the first connection terminal of the first coil, and the second connection terminal of the first slave unit is connected to the second connection terminal of the first coil; the first connection terminal of the second slave unit is connected to the first connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the second connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is opposite to the winding direction of the second coil from the first connection terminal to the second connection terminal. By setting different winding directions of the coils, when the current directions of the first slave unit and the second slave unit are the same, it is simple and convenient to realize that the magnetic field directions of the first coil and the second coil are opposite, that is, to realize that the magnetic field information of each slave unit driving the corresponding coil to generate a magnetic field is different, which is beneficial to the practical application of the method for setting the device address of this application.
[0053] In some alternative embodiments, under the drive of the first slave unit and the second slave unit, the magnetic field information generated by the first coil and the second coil may include the magnetic field strength, such as... Figure 6 and Figure 7 As shown, by setting the number of turns of the first coil 230 and the second coil 240 to be different, the magnetic field strength of the first coil 230 and the second coil 240 can be different even when the output current of the first slave unit 210 and the second slave unit 220 is in the same direction.
[0054] In some alternative embodiments, the electronic device may include a motor, with coils used to drive the movement of magnets within the motor. The motor included in the electronic device may be, for example... Figure 8 or Figure 9 The linear motor 300 shown may include a coil, a reed 320, a magnet 330, and a controlled object 340. The coil may include a first coil 311 and a second coil 312. The controlled object 340 may be a mass block or similar object. The magnet 330, driven by the magnetic field of the first coil 311 or the second coil 312, can move the controlled object 340. The main control unit may be a main control chip for the linear motor, such as a microprocessor (MCU), and the slave unit may be a drive chip connected to the linear motor coil. Under the control of the main control chip, the drive chip outputs a current with a changing direction to the coil connected to it, which drives the coil to generate an alternating magnetic field, thereby driving the magnet 330 to move the controlled object 340 in reciprocating motion, causing the linear motor 300 to vibrate. The specific structure of the linear motor 300 can be found in relevant technologies and will not be described in detail here.
[0055] Figure 8 The linear motor 300 includes a first coil 311 and a second coil 312. The first coil 311 and the second coil 312 are driven by a first driver chip 351 and a second driver chip 352, respectively, to generate magnetic fields. The first driver chip 351 and the second driver chip 352 can be a first slave unit and a second slave unit, respectively. Furthermore, magnetic field sensors can be integrated into the first driver chip 351 and the second driver chip 352. Figure 8 In the embodiments, the first slave unit and the second slave unit are respectively connected to the first coil 311 or the second coil 312, and the first slave unit and the second slave unit integrate magnetic field sensors.
[0056] Figure 9In the linear motor 300, two first coils 311 and two second coils 312 are connected to the same first driver chip 351 and driven by the first driver chip 351 to generate a magnetic field. The two second coils 312 are connected to the same second driver chip 352 and driven by the second driver chip 352 to generate a magnetic field. Each first coil 311 has a first magnetic field sensor 361 for detecting the magnetic field information of that first coil 311, and each second coil 312 has a second magnetic field sensor 362 for detecting the magnetic field information of that second coil 312. The first driver chip 351 and the second driver chip 352 can be respectively a first slave unit and a second slave unit. Both first magnetic field sensors 361 are located outside the first driver chip 351, and the first driver chip 351 is connected to each of the two first magnetic field sensors 361. Both second magnetic field sensors 362 are located outside the second driver chip 352, and the second driver chip 352 is connected to each of the two second magnetic field sensors 362. Figure 9 In the embodiments, each slave unit is connected to two coils respectively, and the slave unit is connected to a magnetic field sensor disposed externally thereon. It should be understood that the connections of the various components in the accompanying drawings are only schematic illustrations of the connection relationships. Two components connected by a connection can be connected by one wire or by multiple wires. For example, the first driving chip 351 and the first coil 311 can be connected by at least two wires, and the first driving chip 351 and the first magnetic field sensor 361 can be connected by at least two wires, etc.
[0057] In this embodiment, the slave unit can drive the motor's own coil to generate a corresponding magnetic field, and detect the magnetic field information of the magnetic field through a magnetic field sensor to set its own device address, thereby resolving the problem of device address conflict of the slave unit. This can minimize the modification of the original structure of the electronic device when the electronic device includes a motor, and reduce the cost of setting its own device address.
[0058] When the electronic device includes the aforementioned linear motor, such as Figure 10 As shown, one or more coils connected to the circuit are driven to generate a magnetic field according to the address setting command, and the magnetic field information of the generated magnetic field is detected by a magnetic field sensor, including:
[0059] S111. Output the first current to the coil according to the address setting instruction, drive the coil to generate the first magnetic field, and use the first magnetic field to make the magnet move to the maximum stroke.
[0060] The slave unit can drive one or more coils. It should be noted that the magnet's movement can be either a movement towards the coil or a movement towards the coil; the maximum travel distance corresponds to different first currents for these two types of movements. The address setting command can include current direction information indicating the direction and value of the first current and the subsequent second current. The values of the first and second currents can be set based on the current output from the slave unit to the coil when the magnet's movement towards / away from the coil reaches its maximum value; the values of the first and second currents can be greater than or equal to these current values.
[0061] S112. The first magnetic field is detected by a magnetic field sensor to obtain a detection signal corresponding to the first magnetic field.
[0062] When there are multiple coils, a magnetic field sensor detects the first magnetic field generated by one coil. The detection signal corresponding to the first magnetic field is the signal obtained by the magnetic field sensor from detecting the first magnetic field. The detection signal corresponding to the first magnetic field can be used to indicate the magnetic field strength and direction of the first magnetic field.
[0063] S113. Output a second current to the coil to drive the coil to generate a second magnetic field. The direction of the second current is the same as that of the first current, the current value of the second current is different from that of the first current, and the second magnetic field is also used to make the magnet move to its maximum stroke.
[0064] The direction of the second current is the same as that of the first current, but the value of the second current is different from that of the first current. This allows the direction of the second magnetic field to be the same as that of the first magnetic field, but with a different magnetic field strength. The value of the second current can be greater than or less than that of the first current. The absolute value of the difference between the second and first currents can be greater than a predetermined threshold to make the strength difference between the second and first magnetic fields more obvious. This predetermined threshold can be set based on experiments detecting the strength difference between the second and first magnetic fields, or based on the experience or needs of those skilled in the art. This application does not impose any limitations on this.
[0065] S114. The second magnetic field is detected by a magnetic field sensor to obtain a detection signal corresponding to the second magnetic field.
[0066] The detection signal corresponding to the second magnetic field is the signal obtained by the magnetic field sensor when detecting the second magnetic field. This detection signal can be used to indicate the magnetic field strength and direction of the second magnetic field. Under the influence of both the first and second magnetic fields, the magnet moves to the same maximum distance; that is, the magnet's distance remains constant in both cases. Because the magnetic field of the magnet has the same effect on the magnetic field sensor when the magnet's distance remains constant, the error caused by the magnetic field in the detection signal corresponding to the second magnetic field is the same in both the detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field.
[0067] S115. Perform a difference operation on the detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field to obtain a difference signal, and determine the magnetic field information based on the difference signal.
[0068] By subtracting the detection signal corresponding to the first magnetic field from the detection signal corresponding to the second magnetic field, a difference operation can be performed on the detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field. This cancels out the error in the detection signal corresponding to the second magnetic field caused by the magnetic field of the magnet, and removes the influence of the magnetic field of the magnet in the difference signal, so as to accurately indicate the magnetic field information of the coil magnetic field through the difference signal.
[0069] It should be noted that the magnitude of the difference signal can indicate the magnetic field strength, and the sign of the difference signal can indicate the magnetic field direction. Therefore, magnetic field information can be determined based on the difference signal. Optionally, a positive difference signal indicates that the magnetic field direction of the coil is the first direction mentioned above, and a negative difference signal indicates that the magnetic field direction of the coil is the second direction mentioned above; or, a positive difference signal indicates that the magnetic field direction of the coil is the second direction mentioned above, and a negative difference signal indicates that the magnetic field direction of the coil is the first direction mentioned above.
[0070] In this embodiment, the electronic device includes a motor, and a coil drives a magnet within the motor. A first current can be output to the coil according to an address setting command, driving the coil to generate a first magnetic field. This first magnetic field is used to maximize the magnet's travel distance. A magnetic field sensor detects the first magnetic field, obtaining a corresponding detection signal. A second current is then output to the coil, driving it to generate a second magnetic field. The direction of the second current is the same as the first current, but the current value of the second current differs from the first current. This second magnetic field also maximizes the magnet's travel distance. A magnetic field sensor detects the second magnetic field, obtaining a corresponding detection signal. The difference between the detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field is calculated to obtain a difference signal. Magnetic field information is determined based on this difference signal. When the magnet reaches its maximum stroke, a detection signal corresponding to the first magnetic field can be obtained, and when the magnet's stroke remains at its maximum stroke, a detection signal corresponding to the second magnetic field can be obtained. This ensures that the errors caused by the magnet in the detection signals corresponding to the first and second magnetic fields are the same. By performing a difference operation on the detection signals corresponding to the first and second magnetic fields, the aforementioned errors caused by the magnet can be removed, resulting in a difference signal with smaller errors. More accurate magnetic field information can be determined based on the difference signal.
[0071] In some optional embodiments, the output terminal of the magnetic field sensor is connected to a signal amplification circuit and an analog-to-digital conversion circuit. Specifically, the output terminal of the magnetic field sensor is connected to the signal amplification circuit, and the signal amplification circuit is connected to the analog-to-digital conversion circuit. Detecting the first magnetic field using the magnetic field sensor to obtain a detection signal corresponding to the first magnetic field includes:
[0072] The first magnetic field is detected by a magnetic field sensor to obtain an initial detection signal output by the magnetic field sensor. The initial detection signal is amplified by a signal amplification circuit to obtain an amplified signal corresponding to the initial detection signal. The amplified signal is then converted from analog to digital by an analog-to-digital conversion circuit to obtain a detection signal corresponding to the first magnetic field.
[0073] Similar to magnetic field sensors, the signal amplification circuit and analog-to-digital conversion circuit can be integrated into the slave unit or located outside the slave unit. When the signal amplification circuit and analog-to-digital conversion circuit are located outside the slave unit, the analog-to-digital conversion circuit can be electrically connected to the input terminal of the slave unit.
[0074] The signal amplification circuit may include electronic components such as operational amplifiers for amplifying signals, thereby amplifying the initial detection signal. Optionally, the signal amplification circuit may be a PGA (Programmable Gain Amplifier) circuit. The analog-to-digital conversion circuit may include an analog-to-digital converter to convert the amplified signal from analog to digital. As a feasible implementation, other suitable circuit units, such as noise reduction units, may be connected between the magnetic field sensor, the signal amplification circuit, and the analog-to-digital conversion circuit; however, this application does not limit this aspect.
[0075] The process of detecting the second magnetic field using a magnetic field sensor and obtaining the detection signal corresponding to the second magnetic field can be similar to the above. Specifically, the second magnetic field can be detected by a magnetic field sensor to obtain an initial detection signal output by the magnetic field sensor corresponding to the second magnetic field. This initial detection signal is then amplified by a signal amplification circuit to obtain an amplified signal corresponding to the initial detection signal. Finally, the amplified signal is converted from analog to digital by an analog-to-digital converter circuit to obtain the detection signal corresponding to the second magnetic field.
[0076] In this embodiment, the output terminal of the magnetic field sensor is connected to a signal amplification circuit and an analog-to-digital conversion circuit. The signal amplification circuit amplifies the initial detection signal output by the magnetic field sensor to obtain an amplified signal corresponding to the initial detection signal. The analog-to-digital conversion circuit then performs analog-to-digital conversion on the amplified signal to obtain a detection signal corresponding to the first magnetic field. The signal amplification circuit significantly improves the strength and discernibility of the obtained signal, enhancing the detection capability of weak magnetic fields. The analog-to-digital conversion circuit converts the detection signal into a digital signal corresponding to the first magnetic field, facilitating subsequent processing of the detection signal.
[0077] S120. Based on the magnetic field information, set the device address of the slave unit itself so that the device address of the slave unit is different from the device addresses of other slave units.
[0078] Since the magnetic field information generated by the corresponding coil driven by each slave unit is different, each slave unit can make its own device address different from the device addresses of other slave units by ensuring that its device address uniquely corresponds to the magnetic field information of the coil it drives when setting its own address. It should be understood that the method in this embodiment is used for slave units, and the device address set by the slave unit in step S120 is its own device address.
[0079] like Figure 11 As shown, in some optional embodiments, setting the slave unit's own device address based on the magnetic field information includes:
[0080] S121. Determine the setting parameters corresponding to the magnetic field information based on the magnetic field information and the preset mapping information; wherein, the mapping information is used to indicate the correspondence between the magnetic field information and the setting parameters, and different magnetic field information corresponds to different setting parameters.
[0081] The mapping information can be a mapping table that includes the correspondence between different magnetic field information and setting parameters. For example, each magnetic field information and its corresponding setting parameter in the mapping table can be located in the same row, with different magnetic field information located in different rows. Based on the determined mapping information, the setting parameter located in the same row as that mapping information can be retrieved from the mapping table, and the retrieved setting parameter is determined as the device parameter corresponding to that magnetic field direction. If the magnetic field information is not included in the mapping table, the setting parameter corresponding to that magnetic field information can be obtained using interpolation based on the magnetic field information and setting parameters included in the mapping table. Of course, the mapping information can also be other suitable forms of information, and this application embodiment does not limit this.
[0082] S122. Set the device address according to the determined setting parameters.
[0083] As a feasible implementation method, different setting parameters can be different addresses, so that the setting parameters can be set to the device address according to the setting parameters.
[0084] In this embodiment, the setting parameters corresponding to the magnetic field information are determined based on the magnetic field information and the preset mapping information. The device address is then set according to the determined setting parameters. The mapping information is used to indicate the correspondence between the magnetic field information and the setting parameters. Different magnetic field information corresponds to different setting parameters. The setting parameters for the device address can be quickly determined by combining the magnetic field information with the preset mapping information. This process does not require complex calculations and is beneficial to improving the efficiency of setting the device address.
[0085] In some optional embodiments, setting the device address according to the determined setting parameters includes setting a predetermined number of bits of data in the original device address to the determined setting parameters.
[0086] The slave unit's own original device address can be the original address set during the slave unit's production. Usually, slave units of the same model have the same original address.
[0087] For example, if the slave unit's original device address is 7'h60, the predetermined bit length is the last bit, and the setting parameter determined based on the magnetic field information is 1, then the slave unit's device address in this embodiment can be set to 7'h61. If the slave unit's original device address is 7'h60, the predetermined bit length is the last two bits of the data, and the setting parameter determined based on the magnetic field information is 2'b10, then the slave unit's device address in this embodiment can be set to 7'h62. In 7'h60, 7 indicates that the data bit width is 7 bits (binary bits), h indicates that the data base is hexadecimal, 60 indicates that the data value in hexadecimal is 60, and 7'h60 is actually 1100000 (binary value). In 2'b10, 2 indicates that the data bit width is 2 bits, b indicates that the data base is binary, and 10 indicates that the data value in binary is 10. Change the last two digits of 7'h60 to 2'b10, which is equivalent to changing the last two digits of 1100000 to 10, resulting in 1100010, which has a hexadecimal value of 62, resulting in 7'h62.
[0088] It should be noted that there can be setting parameters that have the same number of bits as the original device address. That is, the device address set according to the setting parameters can still be the original device address of the slave unit itself. Correspondingly, other setting parameters are different from the data in the original device address of the slave unit itself, so that the device addresses set by each slave unit according to the setting parameters are different.
[0089] The slave unit in this application embodiment can directly set a predetermined number of bits of data in its own original device address as the determined setting parameters, avoiding the complete replacement of the entire original device address. Thus, while adjusting the device address, other parts of the original device address are retained, which can reduce the computational complexity of the slave unit setting its own device address.
[0090] In this embodiment, the method for setting a device address can be used in a slave unit of an electronic device. The slave unit receives an address setting command from a master unit, drives one or more connected coils to generate a magnetic field according to the command, and detects the magnetic field information of the generated magnetic field using a magnetic field sensor. The magnetic field information generated by each slave unit's corresponding coil is different. Based on the magnetic field information, the slave unit sets its own device address so that it is different from the device addresses of other slave units. This method utilizes the differences in the magnetic field information of the coils connected to different slave units to set their own device addresses, ensuring the uniqueness of each slave unit's device address. This solves the problem of identical device addresses for slave units, allowing the master unit to distinguish slave units by their device addresses and ensuring normal communication between the master and slave units.
[0091] This application also provides a method for setting a device address for a master unit of an electronic device. The electronic device includes a master unit and a plurality of slave units, each slave unit being connected to at least one coil. The method for setting the device address includes:
[0092] Address setting commands are sent to multiple slave units with the same device address. When a slave unit receives an address setting command from a master unit, it drives one or more connected coils to generate a magnetic field according to the address setting command, and detects the magnetic field information of the generated magnetic field through a magnetic field sensor. The magnetic field information generated by each slave unit driving its corresponding coil is different. Based on the magnetic field information, the device address of the slave unit is set so that its own device address is different from the device addresses of other slave units.
[0093] The method for setting the device address of the host unit of an electronic device provided in this application embodiment is based on the same inventive concept as the aforementioned method for setting the device address of the slave unit of an electronic device, and can achieve the same effect. For the specific implementation process, please refer to the description in the aforementioned method embodiment for setting the device address of the slave unit of an electronic device, which will not be repeated here.
[0094] In some optional embodiments, the method for setting the device address further includes:
[0095] Obtain the preset device address settings; the device address settings include the device address set for each slave unit.
[0096] For example, the mapping information in the above embodiment may include the correspondence between each magnetic field direction and each setting parameter. The host unit can determine all possible device addresses of the slave unit according to the various setting parameters included in the mapping information in the above embodiment, so as to obtain the device address of each slave unit after setting. The process of determining the device address of the slave unit according to the setting parameters can refer to the above embodiment of surface mapping information, and will not be repeated here.
[0097] Authentication commands are sent to multiple slave units with the same device address based on the configured device address. The slave unit corresponding to each configured device address is determined based on the response of each slave unit.
[0098] Optionally, the authentication command may include the configured device address. If the device address included in the authentication command is the same as the configured device address of the slave unit that received the authentication command, the slave unit may send a response command to the master unit in response to the authentication command. Otherwise, the slave unit may not respond to the authentication command, and the master unit can determine whether the slave unit corresponds to the device address in the authentication command based on whether the slave unit sends a response command. Of course, the master unit may also determine the slave unit corresponding to each configured device address through other suitable authentication commands, and this application embodiment does not impose any limitations on this.
[0099] In this embodiment, the method for setting the device address further includes obtaining preset device address setting information, which includes the device address set by each slave unit. Authentication commands are sent to multiple slave units with the same device address based on the set device address. Based on the response of each slave unit, the slave unit corresponding to each set device address is determined. This allows the master unit to quickly locate and identify the set device addresses of each slave unit based on the preset device address setting information, facilitating communication between the master unit and the slave units based on the set device addresses.
[0100] This application also provides an electronic device, including a master unit and a plurality of slave units, each slave unit being connected to at least one coil.
[0101] The master unit is used to send address setting instructions to multiple slave units with the same device address.
[0102] The slave unit is used to receive the address setting command sent by the master unit, drive one or more connected coils to generate a magnetic field according to the address setting command, and detect the magnetic field information of the generated magnetic field through a magnetic field sensor; wherein, the magnetic field information generated by the corresponding coil driven by each slave unit is different; according to the magnetic field information, it sets its own device address so that its own device address is different from the device addresses of other slave units.
[0103] This application also provides a chip for executing the method of setting a device address in any of the above embodiments.
[0104] It should be noted that, depending on the implementation needs, the various components / steps described in the embodiments of this application can be broken down into more components / steps, or two or more components / steps or parts of the operation of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of this application.
[0105] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this application.
[0106] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A method for setting a device address, used in a slave unit of an electronic device, characterized in that, The electronic device includes a master unit and a plurality of slave units, each slave unit being connected to at least one coil; The method includes: The host unit receives an address setting command, drives one or more connected coils to generate a magnetic field according to the address setting command, and detects the magnetic field information of the generated magnetic field through a magnetic field sensor; wherein, the magnetic field information of the magnetic field generated by the corresponding coil driven by each slave unit is different. Based on the magnetic field information, the device address of the slave unit itself is set so that the device address of the slave unit itself is different from the device addresses of other slave units; The slave unit of the electronic device includes a first slave unit and a second slave unit with the same original device address, and the magnetic field information includes the magnetic field direction; The first connection terminal of the first slave unit is connected to the first connection terminal of the first coil, and the second connection terminal of the first slave unit is connected to the second connection terminal of the first coil; The first connection terminal of the second slave unit is connected to the second connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the first connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is the same as the winding direction of the second coil from the first connection terminal to the second connection terminal; or, the first connection terminal of the second slave unit is connected to the first connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the second connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is opposite to the winding direction of the second coil from the first connection terminal to the second connection terminal.
2. The method according to claim 1, characterized in that, The magnetic field information also includes the magnetic field strength.
3. The method according to claim 1, characterized in that, The step of setting the device address of the slave unit itself based on the magnetic field information includes: Based on the magnetic field information and preset mapping information, the setting parameters corresponding to the magnetic field information are determined; wherein, the mapping information is used to indicate the correspondence between the magnetic field information and the setting parameters, and different magnetic field information corresponds to different setting parameters; Set the device address according to the determined setting parameters.
4. The method according to claim 3, characterized in that, Setting the device address according to the determined setting parameters includes: Set the predetermined number of bits in its original device address to the determined setting parameters.
5. The method according to claim 1, characterized in that, The magnetic field direction includes a first direction and a second direction, wherein the first direction and the second direction are opposite.
6. The method according to claim 1, characterized in that, The electronic device includes a motor, and the coil is used to drive the magnet in the motor to move; The process of driving one or more coils connected according to the address setting instruction to generate a magnetic field, and detecting the magnetic field information of the generated magnetic field by a magnetic field sensor, includes: According to the address setting instruction, a first current is output to the coil to drive the coil to generate a first magnetic field. The first magnetic field is used to make the magnet move to its maximum stroke. The first magnetic field is detected by a magnetic field sensor to obtain a detection signal corresponding to the first magnetic field; A second current is output to the coil to drive the coil to generate a second magnetic field, wherein the direction of the second current is the same as the direction of the first current, the current value of the second current is different from the current value of the first current, and the second magnetic field is also used to make the magnet move to the maximum stroke. The second magnetic field is detected by a magnetic field sensor to obtain a detection signal corresponding to the second magnetic field; The detection signal corresponding to the first magnetic field and the detection signal corresponding to the second magnetic field are subjected to a difference operation to obtain a difference signal, and the magnetic field information is determined based on the difference signal.
7. The method according to claim 6, characterized in that, The output terminal of the magnetic field sensor is connected to a signal amplification circuit and an analog-to-digital conversion circuit. The step of detecting the first magnetic field using a magnetic field sensor to obtain a detection signal corresponding to the first magnetic field includes: The first magnetic field is detected by a magnetic field sensor to obtain an initial detection signal output by the magnetic field sensor. The initial detection signal is amplified by the signal amplification circuit to obtain an amplified signal corresponding to the initial detection signal. The amplified signal is then converted from analog to digital by an analog-to-digital converter to obtain a detection signal corresponding to the first magnetic field.
8. A method for setting a device address, for a host unit of an electronic device, characterized in that, The electronic device includes the host unit and a plurality of slave units, each of the slave units being connected to at least one coil; The method includes: Address setting commands are sent to multiple slave units with the same device address. When a slave unit receives an address setting command from the master unit, it drives one or more connected coils to generate a magnetic field according to the address setting command, and detects the magnetic field information of the generated magnetic field through a magnetic field sensor. The magnetic field information of the magnetic field generated by each slave unit driving its corresponding coil is different. Based on the magnetic field information, the device address of the slave unit itself is set so that its own device address is different from the device addresses of other slave units. The slave unit of the electronic device includes a first slave unit and a second slave unit with the same original device address, and the magnetic field information includes the magnetic field direction; The first connection terminal of the first slave unit is connected to the first connection terminal of the first coil, and the second connection terminal of the first slave unit is connected to the second connection terminal of the first coil; The first connection terminal of the second slave unit is connected to the second connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the first connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is the same as the winding direction of the second coil from the first connection terminal to the second connection terminal; or, the first connection terminal of the second slave unit is connected to the first connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the second connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is opposite to the winding direction of the second coil from the first connection terminal to the second connection terminal.
9. The method according to claim 8, characterized in that, The method further includes: obtaining preset device address setting information; the device address setting information includes the device address set by each slave unit; Authentication commands are sent to multiple slave units with the same device address according to the configured device address. Based on the response of each slave unit, the slave unit corresponding to each configured device address is determined.
10. An electronic device, characterized in that, It includes a master unit and multiple slave units, each of which is connected to at least one coil; The host unit is used to send address setting instructions to multiple slave units with the same device address; The slave unit is configured to receive an address setting instruction sent by the master unit, drive one or more connected coils to generate a magnetic field according to the address setting instruction, and detect the magnetic field information of the generated magnetic field through a magnetic field sensor; wherein, the magnetic field information of the magnetic field generated by each slave unit driving its corresponding coil is different; and set its own device address according to the magnetic field information so that its own device address is different from the device addresses of other slave units; the slave units of the electronic device include a first slave unit and a second slave unit with the same original device address, and the magnetic field information includes the magnetic field direction; The first connection terminal of the first slave unit is connected to the first connection terminal of the first coil, and the second connection terminal of the first slave unit is connected to the second connection terminal of the first coil; The first connection terminal of the second slave unit is connected to the second connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the first connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is the same as the winding direction of the second coil from the first connection terminal to the second connection terminal; or, the first connection terminal of the second slave unit is connected to the first connection terminal of the second coil, and the second connection terminal of the second slave unit is connected to the second connection terminal of the second coil. The winding direction of the first coil from the first connection terminal to the second connection terminal is opposite to the winding direction of the second coil from the first connection terminal to the second connection terminal.
11. A chip, characterized in that, Used to perform the method of any one of claims 1-7, or used to perform the method of any one of claims 8-9.
Citation Information
Patent Citations
Method for establishing communication connection and terminals
CN107801252A
Slave unit address modification method, chip and electronic equipment
CN116599934A