Electronic devices and device ID setting methods
By recording and identifying the pin connections between the first and second electronic devices, the device ID setting process is simplified, solving the problem of complex setup in the prior art and improving the convenience and efficiency of setup.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PIXART IMAGING INC
- Filing Date
- 2022-01-25
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, device IDs are difficult to change, and the setup process is complex, usually requiring changes to the I/O voltage of peripheral devices or writing to the EPROM, resulting in cumbersome setup steps.
By recording the pin connections between the first and second electronic devices and identifying the device ID according to the signal conversion sequence, the setup process is simplified, and the device ID setting method is executed using the processing circuit and storage device of the second electronic device.
It simplifies the device ID setting process, improves the convenience and efficiency of setting, and reduces the dependence on IO voltage and EPROM writing.
Smart Images

Figure CN115730356B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for setting a device ID (identification code) and an electronic device using the device ID setting method, and particularly to a method for setting a device ID that allows setting a device ID through simple steps and an electronic device using the device ID setting method. Background Technology
[0002] Traditionally, a host device (e.g., an IC in a computer) needs the device ID of a slave device (e.g., an IC in a peripheral device coupled to the computer) to identify the slave device so that the host device can transfer data to the correct slave device.
[0003] However, in existing technologies, device IDs are difficult to change. For example, the device ID must be set by changing the I / O (Input / Output) voltage of the IC (Integrated Circuit) in the peripheral device. Alternatively, the device ID must be written into the EPROM (Electrically Erasable Programmable Read-Only Memory) of the peripheral device.
[0004] Therefore, there is a need for a device ID setting method that allows users to easily set the device ID. Summary of the Invention
[0005] One objective of this invention is to disclose an electronic device that simplifies the steps of setting a device ID.
[0006] Another objective of this invention is to disclose a device ID setting method that simplifies the steps of setting a device ID.
[0007] An embodiment of the present invention discloses an electronic device for setting a device ID of a first electronic device having a plurality of data pins, comprising: a clock pin; a data pin; a storage device for storing a program; and a processing circuit coupled to the clock pin and the data pin of the electronic device; when the processing circuit executes the program, it performs a device ID setting method, the device ID setting method comprising: (a) recording the first electronic device and the connection between the pins of the electronic device through the electronic device; (b) using the electronic device to set the connection as the device ID of the first electronic device; and (c) setting the pins of the first electronic device such that the data pin of the electronic device is coupled to the plurality of data pins of the first electronic device.
[0008] Another embodiment of the present invention discloses a device ID setting method for use in a first electronic device having a plurality of data pins, comprising: (a) recording a connection between the first electronic device and the pins of the second electronic device via a second electronic device, wherein the second electronic device includes a clock pin; (b) using the second electronic device to set the connection as the device ID of the first electronic device; and (c) setting the pins of the first electronic device such that the data pin of the second electronic device is coupled to the plurality of data pins of the first electronic device.
[0009] According to the above embodiments, the device ID can be set by recording the connection between pins, thereby simplifying the steps of setting the device ID in the prior art. Attached Figure Description
[0010] Figure 1 A schematic diagram illustrating a device ID setting method according to an embodiment of the present invention is shown.
[0011] Figure 2 An illustration is provided according to an embodiment of the present invention. Figure 1 The waveform diagram of the signal in the embodiment is shown.
[0012] Figure 3 , Figure 4 as well as Figure 5 The illustration depicts a device ID setting method according to different embodiments of the present invention.
[0013] Figure 6 An illustration is provided according to an embodiment of the present invention. Figure 3 , Figure 4 as well as Figure 5 The waveform diagram of the signal in the embodiment is shown.
[0014] Figure 7 A flowchart illustrating a device ID setting method according to an embodiment of the present invention is shown.
[0015] Figure 8 A block diagram of an electronic device using the device ID setting method of the present invention is illustrated according to an embodiment of the present invention.
[0016] The reference numerals in the attached figures are explained as follows:
[0017] ED_11 and ED_12 First Electronic Devices
[0018] ED_2 Second Electronic Device
[0019] C1, C2, C3, C4, C5, C6 connection
[0020] CP_a and CP_1 clock pins
[0021] DP_a, DP_b, DP_1, DP_2 data pins
[0022] Steps 701, 703, and 705
[0023] 800 electronic devices
[0024] 801 Processing Circuit
[0025] 803 storage device Detailed Implementation
[0026] The present invention will be described below with reference to several embodiments. It should be noted that the elements in each embodiment can be implemented by hardware (e.g., devices or circuits) or firmware (e.g., at least one program written in a microprocessor). Furthermore, the terms "first," "second," and similar descriptions in the following description are used only to define different elements, parameters, data, signals, or steps, and are not intended to limit their order. For example, the first device and the second device can be different devices having the same structure.
[0027] Furthermore, in the following embodiments, the first electronic device and the second electronic device may be circuits or chips, or electronic devices (such as computers or optical mice) containing pins as shown in the following embodiments. More specifically, in the following embodiments, the first electronic device may be a slave device, and the second electronic device may be a master device, but is not limited thereto.
[0028] Figure 1 A schematic diagram illustrating a device ID setting method according to an embodiment of the present invention is shown. Please also note that... Figure 1 In this embodiment, the first electronic devices ED_11 and ED_12 are connected to the same second electronic device ED_2, but for clarity, the connection of C1 and C2 is described using two second electronic devices ED_2. Figure 1As shown, the first electronic devices ED_11 and ED_12 respectively include data pins DP_1 and DP_2. Data pin DP_1 can be referred to as the first data pin, and data pin DP_2 can be referred to as the second data pin. Furthermore, the second electronic device ED_2 includes a data pin DP_a and a clock pin CP_a. In one embodiment, communication between the first electronic devices ED_11 and ED_12 and the second electronic device ED_2 follows the I2C (I square C) specification. In this case, data pin DP_1 is used to provide unidirectional transmission from the first electronic devices ED_11 and ED_12 to the second electronic device ED_2, such as a GPIO (General-purpose input / output) pin. Furthermore, data pin DP_2 is used to provide unidirectional transmission from the second electronic device ED_2 to the first electronic devices ED_11 and ED_12, such as an SDA (Serial Data Line) pin. Additionally, data pin DP_a is an SDA pin, and clock pin CP_a is an SCL (Serial Clock Line) pin.
[0029] The second electronic device ED_2 identifies the first electronic devices ED_11 and ED_12 based on the pin connections between the first electronic devices ED_11 and ED_12 and the second electronic device ED_21, respectively. Specifically, the second electronic device ED_2 first records connection C1 of the first electronic device ED_11 and connection C2 of the first electronic device ED_12. That is, the second electronic device ED_2 uses connections C1 and C2 as the device IDs of the first electronic devices ED_11 and ED_12.
[0030] exist Figure 1 In this embodiment, connection C1 refers to data pin DP_a being coupled to data pin DP_1 of the first electronic device ED_11, and clock pin CP_a being coupled to data pin DP_2 of the first electronic device ED_11. Furthermore, connection C2 refers to data pin DP_a being coupled to data pin DP_2 of the first electronic device ED_12, and clock pin CP_a being coupled to data pin DP_1 of the first electronic device ED_12.
[0031] After recording the connections C1 and C2, the second electronic device ED_2 can configure the pins of the first electronic devices ED_11 and ED_12, enabling normal communication between the second electronic device ED_2 and the first electronic devices ED_11 and ED_12. For example, the data pin DP_2 of the first electronic device ED_11 can be configured as a clock pin. Furthermore, the data pin DP_1 of the first electronic device ED_12 can be configured as a clock pin. The first electronic devices ED_11 and ED_12 can have logic gates or multiplexers to change the pin configuration.
[0032] After establishing the connection between the first electronic devices ED_11 and ED_12, the second electronic device ED_2 can send data to or receive data from the correct electronic device based on the recorded connection. For example, if the second electronic device ED_2 needs to send data to or receive data from the first electronic device ED_11, it can search for the electronic device recorded as having connection C1 and send or receive data from the first electronic device ED_11. Note that in this step, although the first electronic device ED_11 is recorded as having connection C1, its actual connection has been changed to a connection that allows normal communication with the second electronic device ED_2.
[0033] Many methods can be used to detect the aforementioned connection. In one embodiment, the second electronic device ED_2 detects the connection based on the switching sequence of signals sent by the second electronic device ED_2 to the first electronic device ED_11 or ED_12.
[0034] In one embodiment, after the second electronic device ED_2 sends a start command to the first electronic device ED_11 or ED_12, the data signal from the data pin DP_a is converted before the clock signal from the clock pin CP_a is converted. Here, "conversion" can represent, for example, a voltage pull-up or pull-down. Figure 2 An illustration is provided according to an embodiment of the present invention. Figure 1 The waveform diagram of the signal in the embodiment is shown. Figure 2 As shown, after the second electronic device ED_2 sends a start command (not shown) to the first electronic device ED_11 or ED_12, the data signal from the data pin DP_a is pulled down (i.e., switched). Then, the clock signal from the clock port CP_a is pulled down. Next, the second electronic device ED_2 begins transmitting data to the first electronic device ED_1.
[0035] In one embodiment, when a signal from the second electronic device ED_2 is converted, the first electronic device ED_11 sends a response to the second electronic device ED_2. Therefore, the second electronic device ED_2 can determine the conversion order of the signals transmitted from the second electronic device ED_2 to the first electronic device ED_11 or ED_12 based on the response. However, the second electronic device ED_2 can also obtain the conversion order in other ways.
[0036] Therefore, the second electronic device ED_2 can determine which pin of the first electronic device ED_11 is coupled to based on the conversion sequence. For example, if the second electronic device ED_2 detects that the signal transmitted to the data pin DP_1 of the first electronic device EP_1 converts first, it indicates that the data pin DP_1 of the first electronic device EP_1 is coupled to its data pin DP_a. Furthermore, if the second electronic device ED_2 detects that the signal transmitted to the data pin DP_2 of the first electronic device EP_1 converts after being transmitted to the data pin DP_1, it indicates that the data pin DP_2 of the first electronic device EP_1 is coupled to its clock pin CP_a.
[0037] The pins of the first electronic devices ED_11 and ED_12 are not limited to the above embodiments. Figure 3 , Figure 4 as well as Figure 5 The illustration depicts a device ID setting method according to different embodiments of the present invention, illustrating examples of a connection between a first electronic device and a second electronic device. It should also be noted that in the following embodiments, only the first electronic device ED_11 is used to illustrate a possible connection, not the first electronic device ED_11 and the second electronic device ED_12.
[0038] like Figure 3 , Figure 4 as well as Figure 5 As shown, the first electronic device ED_11 includes a clock pin CP_1 in addition to data pins DP_1 and DP_2. Data pin DP_1 can be referred to as the first data pin, and data pin DP_2 can be referred to as the second data pin. In this case, data pin DP_1 may be an SDA pin, and data pin DP_2 may be one of a GPIO pin and an INT pin. Data on the INT pin is converted after data conversion on the SDA pin, providing unidirectional transmission from the first electronic device ED_11 to the second electronic device ED_2. Furthermore, data pin DP_a may be an SDA pin, and data pin DP_b may be one of a GPIO pin and an INT pin. In one embodiment, the INT pin can be used for transmission interruption.
[0039] exist Figure 3In the diagram, connection C1 couples clock pin CP_a to clock pin CP_1, data pin DP_a to data pin DP_1, and data pin DP_b to data pin DP_2. Connection C2 couples clock pin CP_a to data pin DP_1, data pin DP_a to clock pin CP_1, and data pin DP_b to data pin DP_2. Furthermore, in... Figure 4 In the diagram, connection C3 couples the clock pin CP_a to the data pin DP_2, the data pin DP_a to the data pin DP_1, and the data pin DP_b to the clock pin CP_1. Connection C4 couples the clock pin CP_a to the clock pin CP_1, the data pin DP_a to the data pin DP_2, and the data pin DP_b to the data pin DP_1. Additionally, in... Figure 5 In the diagram, connection C5 is used to couple clock pin CP_a to data pin DP_1, data pin DP_a to data pin DP_2, and data pin DP_b to clock pin CP_1. Connection C6 is used to couple clock pin CP_a to data pin DP_2, data pin DP_a to clock pin CP_1, and data pin DP_b to data pin DP_1.
[0040] Figure 6 An illustration is provided according to an embodiment of the present invention. Figure 3 , Figure 4 as well as Figure 5 The waveform diagram of the signal in the embodiment is shown. Figure 6 As shown, after the second electronic device ED_2 sends a start command to the first electronic device ED_11, the data signal on the data pin DP_a is first pulled down (converted). Then, the clock signal from the clock pin CP_a is pulled down. Next, the second electronic device ED_2 begins transmitting data to the first electronic device ED_11. After the clock signal on the clock pin CP_a is converted or the data transmission is completed, the signal on the data pin DP_b is converted.
[0041] In one embodiment, the first electronic device ED_11 sends a response to the second electronic device ED_2 during signal conversion. Therefore, the second electronic device ED_2 can determine the conversion sequence of signals transmitted from the second electronic device ED_2 to the first electronic device ED_11 based on the response. In this way, the second electronic device ED_2 can determine which pin of the first electronic device ED_11 is coupled to based on the conversion sequence. However, the second electronic device ED_2 can obtain the conversion sequence in other ways.
[0042] Figure 7 A flowchart illustrating a device ID setting method according to an embodiment of the present invention is shown. Figure 7 As shown, the device ID setting method includes:
[0043] Step 701
[0044] The connection between pins of the first electronic device (e.g., ED_11, ED_12) and the second electronic device (e.g., ED_2) is recorded by the second electronic device. The first electronic device includes two data pins, DP_11 and DP_12. In addition, the second electronic device includes a clock pin (e.g., CP_a) and at least one data pin (e.g., DP_a).
[0045] Step 703
[0046] The connection from step 701 is used as the device ID of the first electronic device via the second electronic device. In one embodiment, the second electronic device detects the connection based on the sequence of signal transitions sent from the second electronic device to the first electronic device.
[0047] Step 705
[0048] The pins of the first electronic device are configured so that the first electronic device and the second electronic device can communicate normally.
[0049] For example, the data pins of the second electronic device are configured to be coupled to the data pins of the first electronic device.
[0050] Other detailed steps have been described in the above embodiments, and therefore will not be repeated here.
[0051] Even after the first electronic device can communicate normally with the second electronic device, the aforementioned device ID setting method can still be implemented. For example, after the first electronic device and the second electronic device are communicating normally, the user can configure the pins of the first electronic device to change the device ID of the first electronic device. Alternatively, if the first electronic device is connecting to the second electronic device for the first time, the second electronic device can randomly assign a device ID to the first electronic device, and the device ID can be changed using the device ID setting method. However, the device ID setting method is not limited to these applications.
[0052] Figure 8 A block diagram of an electronic device using the device ID setting method of the present invention is illustrated according to an embodiment of the present invention. Figure 8As shown, the electronic device 800, which can be used as the second electronic device ED_2 in the above embodiment, includes a processing circuit 801, a storage device 803, a clock pin CP_a, and at least one data pin (e.g., data pins DP_a and DP_b). Note that the storage device 803 may be located externally to the electronic device 800 rather than internally. The storage device 803 is used to store at least one program. The processing circuit 801 is coupled to the clock pin CP_a and the data pins DP_a and DP_b. The aforementioned device ID setting method can be implemented by the processing circuit 801 executing the program stored in the storage device 803.
[0053] According to the above embodiments, the device ID can be set by recording the connection between pins, thereby simplifying the steps of setting the device ID in the prior art.
[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An electronic device for setting a device ID of a first electronic device having a plurality of data pins, the first electronic device being provided with at least two, characterized in that, Include: Clock pin; Data pins; Storage device used to store programs; The processing circuitry is coupled to the clock pin and the data pin of the electronic device; When the processing circuit executes this program, it performs a device ID setting method, which includes: (a) Recording the first electronic device and the connections between the pins of the electronic device by means of the electronic device, the first electronic device including at least two data pins; (b) Using the electronic device, the connection between the pins of the first electronic device is used as the device ID of the first electronic device; and (c) Configure the pins of the first electronic device such that the data pin of the electronic device is coupled to the plurality of data pins of the first electronic device; The electronic device is further connected to another of the first electronic devices, and the device ID setting method includes: The electronic device records the connection between the pins of the first electronic device and the pins of the electronic device. The connection between the pins of the first electronic device and the pins of the first electronic device is used as the device ID of the other first electronic device. The connection between the pins of the first electronic device and the pins of the first electronic device is different from the connection between the pins of the other first electronic device and the pins of the first electronic device; The device ID of the first electronic device is different from the device ID of another first electronic device. 2.The electronic device of claim 1, wherein, Step (a) includes: The connection is detected based on the conversion sequence of the signals transmitted from the electronic device to the first electronic device. 3.The electronic device of claim 1, wherein, When step (a) is performed, the clock pin of the electronic device is coupled to one of the plurality of data pins of the first electronic device. 4.The electronic device of claim 1, wherein, The first electronic device further includes a clock pin, wherein when step (a) is performed, one of the data pins of the electronic device is coupled to the clock pin of the first electronic device, wherein step (c) sets the pin of the first electronic device such that the data pin of the electronic device is coupled to the plurality of data pins of the first electronic device, and such that the clock pin of the electronic device is coupled to the clock pin of the first electronic device. 5.The electronic device of claim 1, wherein, The plurality of data pins of the first electronic device include a first data pin and a second data pin, wherein the first data pin provides unidirectional transmission from the electronic device to the first electronic device and the first data pin provides unidirectional transmission from the first electronic device to the first electronic device.
6. The electronic device as claimed in claim 5, characterized in that, The transmission between the electronic device and the first electronic device follows the I2C standard.
7. The electronic device as claimed in claim 6, characterized in that, The first data pin is the SDA pin.
8. The electronic device as claimed in claim 7, characterized in that, The second data pin is either a GPIO pin or an INT pin, and the data on the INT pin will be converted after the data on the SDA pin is converted.
9. A device ID setting method, used in a first electronic device having multiple data pins, the first electronic device having at least two, characterized in that, Include: (a) Recording the connection between the pins of the first electronic device and the second electronic device by means of a second electronic device, wherein the second electronic device includes a clock pin; (b) Using the second electronic device, the connection between the pins of the first electronic device and the pins of the second electronic device is used as the device ID of the first electronic device; and (c) Configure the pins of the first electronic device such that the data pin of the second electronic device is coupled to the plurality of data pins of the first electronic device; The second electronic device is further connected to another of the first electronic devices, and the device ID setting method includes: The second electronic device records the connection between the pins of the first electronic device and the pins of the second electronic device. The connection between the pins of the other first electronic device and the pins of the second electronic device is used as the device ID of the other first electronic device; The connection between the pins of the first electronic device and the pins of the second electronic device, and the connection between the pins of the first electronic device and the pins of the second electronic device, are different. The device ID of the first electronic device is different from the device ID of another first electronic device.
10. The device ID setting method as described in claim 9, characterized in that, Step (a) includes: The connection is detected by the electronic device according to the conversion sequence of the signals transmitted from the second electronic device to the first electronic device.
11. The device ID setting method as described in claim 9, characterized in that, When step (a) is performed, the clock pin of the second electronic device is coupled to one of the plurality of data pins of the first electronic device.
12. The device ID setting method as described in claim 9, characterized in that, The first electronic device further includes a clock pin, and when step (a) is performed, one of the data pins of the second electronic device is coupled to the clock pin of the first electronic device, wherein step (c) sets the pin of the first electronic device such that the data pin of the second electronic device is coupled to the plurality of data pins of the first electronic device, and the clock pin of the second electronic device is coupled to the clock pin of the first electronic device.
13. The device ID setting method as described in claim 9, characterized in that, The plurality of data pins of the first electronic device include a first data pin and a second data pin, wherein the first data pin provides unidirectional transmission from the second electronic device to the first electronic device and the first data pin provides unidirectional transmission from the first electronic device to the second electronic device.
14. The device ID setting method as described in claim 13, characterized in that, The transmission between the second electronic device and the first electronic device follows the I2C standard.
15. The device ID setting method as described in claim 14, characterized in that, The first data pin is the SDA pin.
16. The device ID setting method as described in claim 15, characterized in that, The second data pin is either a GPIO pin or an INT pin, with the INT pin transmitting data only after the SDA pin has transmitted data.
Citation Information
Patent Citations
Low cost low overhead serial interface for power management and other ICs
US20160170930A1
Automatic Analytical Cloud Scaling of Hardware Using Resource Sub-Cloud
US20160306677A1