Electronic component identification method and electronic device
By building a plurality of first address information in the preloaded firmware of the electronic device, sending inquiry requests to the electrically connected electronic components, establishing communication and recording matching first address information, the problem of updating the firmware or hardware lines in the prior art after replacing the electronic components is solved, improving the identification efficiency and reducing the workload.
Patent Information
- Application Number
- CN202311362425.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-20
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, when replacing the I2C interface electronic components on printed circuit board components, it is difficult to find compatible alternatives, and the firmware needs to be changed after replacement, which increases the workload and version control risks.
By building a plurality of first address information in the preloaded firmware of the electronic device, an inquiry request is sent to the electrically connected electronic components, communication is established, and matching first address information is recorded for subsequent initialization and control of the electronic components.
It avoids the need to update the firmware or hardware circuit after replacing the electronic components, improves the efficiency of electronic components identification, and reduces the workload of the production line.
Smart Images

Figure CN119862138A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to an electronic component identification method, and more particularly to an electronic component identification method installed on an electronic device. Background Art
[0002] In the prior art, if it is necessary to replace the I 2 When replacing electronic components with C-interface, you can only choose substitutes with the same specifications for replacement, or change the hardware circuit or firmware to make corresponding adjustments. However, in the case of material shortage, it is quite difficult to find compatible substitutes. Even if a substitute is found, the firmware may need to be changed, which not only increases the risk of version control, but also requires the production line to burn different firmware versions according to different substitute materials, adding unnecessary workload. Summary of the invention
[0003] In view of the problems of the prior art, the purpose of the present application is to provide an electronic component identification method and an electronic device, wherein the electronic device or its built-in control module has multiple first address information built into the preloaded firmware, and sends inquiry requests to multiple electrically connected electronic components one by one through the multiple first address information. When the electronic component responds to the inquiry request corresponding to one of the multiple first address information, the electronic device or its built-in control module establishes communication with all the electronic components using the responded first address information.
[0004] According to the above-mentioned purpose, the present application provides an electronic component identification method, which is applied to an electronic device, wherein the electronic device is provided with a preloaded firmware, wherein the preloaded firmware has a plurality of different first address information built in, and the electronic device is electrically connected to a plurality of electronic components, wherein each electronic component has a different second address information, and the method is applied before the electronic device sends corresponding behavior data to the plurality of electronic components, wherein the method includes: generating a plurality of query messages, wherein each query message includes one of the plurality of first address information; sending the plurality of query messages to the plurality of electronic components; receiving response messages, wherein the response message is sent back to the electronic device by the electronic component to which the matched second address information belongs when any of the second address information matches one of the plurality of first address information; based on the response message, identifying that each of the second address information matches one of the plurality of first address information, and recording each of the matched first addresses as matched first address information.
[0005] Optionally, the preloaded firmware further includes a plurality of the behavior data of a plurality of electronic components, each behavior data being associated with one of the plurality of first address information.
[0006] Optionally, after recording the matched first address information, the following step is further included: according to the first address information respectively corresponding to the multiple electronic components, the behavior data associated with the corresponding first address information is sent to the corresponding electronic component.
[0007] Optionally, the behavior data includes initialization behavior data, and the control module initializes the electronic components respectively according to the initialization behavior data.
[0008] Optionally, the behavior data further includes behavior control data. After initialization is completed, the control module performs behavior control on the electronic components respectively according to the behavior control data.
[0009] The present application further provides an electronic device, comprising: a control module and a plurality of electronic components. The control module has a preloaded firmware, and the preloaded firmware has a plurality of different first address information built in, and the control module generates a corresponding inquiry message according to each first address information in the preloaded firmware. A plurality of electronic components are connected to the control module, and each of the electronic components is configured with a different second address information and receives the inquiry message. The control module receives a response message transmitted from the electronic component, and the control module identifies whether the plurality of first address information matches or does not match the plurality of second address information according to the response information, and records each of the matched first addresses as the matched first address information, and the response message is sent back to the control module by the electronic component to which the second address information belongs when any of the second address information matches one of the plurality of first address information.
[0010] Optionally, the preloaded firmware also includes behavior data of multiple electronic components, each behavior data is associated with one of the multiple first address information, and the control module sends the corresponding behavior data to the multiple electronic components respectively according to the matched first address information.
[0011] Optionally, the behavior data includes initialization behavior data, and the control module initializes the electronic components corresponding to the matched first address information respectively according to the initialization behavior data.
[0012] Optionally, the behavior data further includes behavior control data, and the control module performs behavior control on the electronic components corresponding to the matched first address information according to the behavior control data.
[0013] The present application also provides an electronic component identification method, which is applied to an electronic device, wherein the electronic device is provided with a preloaded firmware, wherein the preloaded firmware has a plurality of different first address information built in, and the electronic device is electrically connected to a plurality of electronic components, each of which has a different second address information, and the method is applied before the electronic device sends corresponding behavior data to the plurality of electronic components, wherein the method includes: generating a plurality of query messages, wherein the query messages are used to query the plurality of electronic components for the second address information they belong to; sending the plurality of query messages to the plurality of electronic components; receiving response messages, wherein each of the response messages includes the second address information respectively belonging to the plurality of electronic components; comparing whether the plurality of first address information matches any one of the plurality of second address information, wherein when any one of the first addresses matches the plurality of second address information, it is recorded as having matched the first address information.
[0014] Optionally, the preloaded firmware further includes a plurality of the behavior data of a plurality of electronic components, each behavior data being associated with one of the plurality of first address information.
[0015] Optionally, after recording the matched first address information, the following steps are further included:
[0016] Optionally, according to the first address information respectively corresponding to the multiple electronic components, the behavior data associated with the corresponding first address information is sent to the corresponding electronic component.
[0017] Optionally, the behavior data includes initialization behavior data, and the control module initializes the electronic components according to the initialization behavior data. Further, the behavior data also includes behavior control data, and after the initialization is completed, the control module performs behavior control on the electronic components according to the behavior control data.
[0018] As described above, the electronic component identification method of the present application can establish communication with the electrically connected electronic component through the preloaded first address information. Therefore, through the electronic component identification method and electronic device of the present application, it is possible to avoid the need to update the firmware or hardware circuit of the entire electronic device after replacing any electronic component on the electronic device (such as a printed circuit board assembly).
[0019] The beneficial effects that can be claimed in this application include:
[0020] (1) When any electronic component on the electronic device is modified, multiple first address information is built into the preloaded firmware, and query requests are generated using the multiple first address information, and the query requests are sent one by one to the electronic components connected to the electronic device until communication is established. Alternatively, the second address information is obtained from the electronic component through the query request, and the multiple first address information is matched with the second address information, and the matched first address information is used to establish communication with the electronic component.
[0021] (2) The present application can cooperate with sending inquiry requests in a cyclic manner, and after confirming the second address information according to the response information sent back by the electronic component, communication can be established. Therefore, there is no need to rely on manual trial and error to identify the address information of the electronic component as in the past. The method of the present application can greatly increase the identification efficiency.
[0022] (3) The preloaded firmware has multiple built-in first address information that can include interfaces or transmission formats belonging to various communication protocols. It only needs to regularly update or expand the preloaded firmware to have multiple built-in first address information to identify a variety of electronic components. Therefore, there is no need to worry about hardware circuit or firmware incompatibility issues when replacing connected electronic components. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 FIG. 4 is a block diagram of an electronic device according to an embodiment of the present application.
[0024] Figure 2 This is a first flow chart of an electronic component identification method according to an embodiment of the present application.
[0025] Figure 3 This is a second flow chart of an electronic component identification method according to an embodiment of the present application.
[0026] Figure 4 For an embodiment of the present application, 2 Identify electronic components with I 2 Flowchart of device C. DETAILED DESCRIPTION
[0027] The embodiments of the present application will be further explained below with the help of the relevant drawings. As much as possible, the same reference numerals represent the same or similar components in the drawings and the specification. It is understood that the components not specifically shown in the drawings or described in the specification are known to those skilled in the art. A person of ordinary skill in the art can make various changes and modifications based on the contents of the present application.
[0028] Figure 1 This is a block diagram of an electronic device according to an embodiment of the present application. Figure 1The electronic device 1 includes a control module 10 and an electronic component 12. The control module 10 has a preloaded firmware, and the preloaded firmware has a plurality of different first address information built in.
[0029] According to one embodiment, the control module 10 may establish a query request for each first address information, and send the multiple query requests to the multiple electronic components 12. When the second address information associated with the electronic component 12 matches the first address information in the query request, the electronic component 12 will return a response message to the control module 10, so that the control module 10 can establish communication with the electronic component 12 through the first address information matching the second address information.
[0030] According to the second implementation, the control module 10 generates multiple query requests and sends them to each electronic component 12 respectively, so that each electronic component 12 returns a response message with its corresponding second address information to the control module 10. The control module 10 compares each of the second address information with the multiple first address information to see if they match, so as to identify the first address information corresponding to each of the multiple electronic components. Therefore, the control module 10 establishes communication with the electronic component 12 through the first address information that matches the second address information.
[0031] The electronic device 1 is, for example, a printed circuit board assembly; the control module 10 is, for example, a microcontroller unit (MCU); the electronic component 12 is, for example, an I 2 C device. And I 2 The C device can also be a temperature sensor, a real time clock chip, an LCD driver chip, an EEPROM, a multiplexing chip, an analog-to-digital / digital-to-analog conversion chip, a GPIO expansion chip, an LED control chip, a buffer chip, or any other suitable IC. 2 C interface device.
[0032] The match is defined as the first address information being the same as the second address information, so as to achieve the purpose of the control module 10 establishing communication (ie, establishing a handshake) with the electronic component 12 through the first address information matching the second address information.
[0033] According to some implementations, the preloaded firmware has built-in behavior data associated with a plurality of first address information, and the behavior data includes initialization information and control information.
[0034] Specifically, each address information may correspond to the behavior data of the electronic component 12, and the behavior data may correspond to the model or specification of the electronic component 12. Therefore, the control module 10 can initialize and control the behavior of each connected electronic component 12 with the corresponding behavior data through the first address information matched by each electronic component 22.
[0035] Furthermore, multiple first address information and their associated behavior data can be recorded in a lookup table (LookupTable). Specifically, the control module 10 can record the matched first address information through the lookup table, and the control module 10 then performs subsequent control behavior on the corresponding electronic component 12 according to the behavior data associated with the matched first address information. In addition, the lookup table can also record the matching results after the control module 10 transmits the query information based on each first address information. In practice, when a certain first address information cannot match the electronic component 12, the control module 10 can record it as unmatched and match it again with another first address information. This can avoid the control module 10 transmitting the repeated and unmatched first address information as the query information again to the same electronic component 12.
[0036] According to another embodiment, the response information includes a confirmation character, and the confirmation character may be, for example, ACK (Acknowledge character) data. That is, when the first address information in the inquiry request matches the second address information of the electronic component 12, the electronic component 12 will successfully receive the data of the inquiry request and respond to the control module 10 with a response information including the confirmation character.
[0037] Furthermore, the response information also includes a denial character, which may be, for example, NAK (Negative Acknowledge) data. When the present application is applied to some communication protocols, when the first address information in the inquiry request received by the receiver (i.e., the electronic component 12 of the present embodiment) does not match the second address information of the electronic component 12, the following two situations may occur: (1) the receiver does not respond; (2) the receiver responds with a response information including a denial character.
[0038] Therefore, in this embodiment, when one of the above two situations is met, the control module 10 will send another inquiry request with another first address information to the electronic component 12 until a response message including a confirmation character is received to the control module 10 .
[0039] Please refer to Figure 2 , Figure 2 This is a first flow chart of an electronic component identification method according to an embodiment of the present application. The method of this embodiment is to apply Figure 1 The detailed process of the method of this embodiment is described with reference to one of the implementation modes and various components in the electronic device 1 .
[0040] First, in step S21, a plurality of first address information is built into the preloaded firmware set in the control module 10. According to one embodiment, the plurality of first address information may be each I 2C device corresponding address information (Device address), and I 2 The address information of the C device can correspond to I 2 C Specification or model of the device.
[0041] In step S22 , the control module 10 generates inquiry requests for each of the plurality of first address information.
[0042] In step S23 , the control module 10 transmits a query request to an electronic component 12 .
[0043] In step S24, the electronic component 12 responds to the query request (for example, the electronic component 12 returns the response information to the control module 10). If the electronic component 12 responds to the query request, the process jumps to step S26; otherwise, if the electronic component 12 does not respond to the query request, the process continues to step S25. In step S25, the control module 10 transmits another query request to an electronic component 12. According to another embodiment, each time the control module 10 transmits another query request to the same electronic component 12, the first address information corresponding to each query request is different.
[0044] In step S26, it is determined whether the response information includes an acknowledgment character (ACK data). If the response information includes an acknowledgment character, the process proceeds to step S27; if the response information does not include an acknowledgment character, the process returns to step S25.
[0045] According to some implementation aspects, when this embodiment applies some communication protocols, such as: 2 C communication protocol or Transmission Control Protocol (TCP), the response information sent back by the electronic component 12 must include an acknowledgment character (ACK data) to allow the control module 10 and the electronic component 12 to perform a handshake.
[0046] Therefore, in some communication protocols that use both confirmation characters and negative characters, such as binary synchronous communications or reliable multicast, when the response information returned by the electronic component 12 that receives the inquiry information only includes a negative character (NAK data), since the control module 10 cannot confirm what the first address information for establishing a handshake with the electronic component 12 is based on the negative character, the control module 10 will continue to transmit the inquiry information with other first address information to the electronic component 12.
[0047] In step S27 , the control module 10 establishes communication with the electronic component 12 according to the first address information corresponding to the responded inquiry request.
[0048] According to other embodiments, the query request sent by the control module 10 to the electronic component 12 may be sent in a cyclic manner, for example, according to the default order (e.g., order or serial number) of the plurality of first address information, corresponding query requests are generated one by one. Alternatively, the plurality of first address information is randomly selected to generate the query request. In addition, the control module 10 may have a temporary storage function to record the first address information corresponding to the query request sent to the same electronic component 12, so as to avoid the control module 10 repeatedly transmitting the query request of the same first address information to the electronic component 12.
[0049] According to some other embodiments, when the control module 10 sends an inquiry request and does not receive a response from the electronic component 12 within a default time, another inquiry request is sent to the electronic component 12 according to another first address information until the control module 10 receives a response from the electronic component 12. The default time may be, for example, 0.01 milliseconds, 0.1 milliseconds, 1 millisecond, 10 milliseconds, 100 milliseconds, 1 second, or may be set according to actual needs.
[0050] Figure 2 The process can be applied to some master-slave architectures to establish communication. Specifically, the control module 10 acts as a master component (Master) and the electronic component 12 acts as a slave component (Slave). When the control module 10 wants to identify the second address information associated with the electronic component 12 based on the multiple first address information built into the preloaded firmware, the control module 10 generates an inquiry request with the first address information and sends it to the electronic component 12. At this time, the control module 10 acts as a master component-sending component (Master-Transmitter), and the electronic component 12 acts as a slave component-receiving component (Slave-Receiver). When the first address information in the inquiry request matches the second address information of the electronic component 12, the electronic component 12 will respond to the control module 10. At this time, the control module 10 acts as a master component-receiving component (Master-Receiver), and the electronic component 12 acts as a slave component-sending component (Slave-Transmitter), so that the control module 10 and the electronic component 12 establish serial communication and synchronous communication. In addition, the present application can be further applied to the state where multiple master components (Master) correspond to multiple slave components (Slave), and bus arbitration or clock synchronization (Clock synchronization) is applied to adjust transmission communication.
[0051] Please refer to Figure 3 , Figure 3 This is a second flow chart of an electronic component identification method according to an embodiment of the present application. The method of this embodiment is to apply Figure 1 The detailed process of the method of this embodiment is described with reference to the second embodiment and the components in the electronic device 1 .
[0052] In step S31 , a plurality of first address information is built into the preloaded firmware provided in the control module 10 .
[0053] In step S32 , the control module 10 transmits an inquiry request to each electronic component 12 . The inquiry request sent in step S32 is to obtain the second address information of each electronic component 12 connected to the control module 10 .
[0054] In step S33 , response information returned by all electronic components 12 is received.
[0055] In step S34, the control module 10 compares the second address information in all the response information with one of the plurality of first address information to see if they can all match. If the second address information of each electronic component 12 can all match one of the plurality of first address information built into the preloaded firmware, then proceed to step S35; otherwise, if the second address information of any electronic component 12 cannot match one of the plurality of first address information built into the preloaded firmware, then jump to step S36.
[0056] In step S35 , the control module 10 establishes communication with all electronic components according to the matched first address information.
[0057] In step S36, the existing multiple first address information cannot match all the second address information. According to some implementations, in step S36, since the existing multiple first address information built into the preloaded firmware does not include the second address information of all the electronic components 12, more first address information needs to be added to the preloaded firmware, and then steps S31 to S34 are executed.
[0058] Adding more first address information and its corresponding behavior data (behavior data may be, for example, initialization information or control information corresponding to a specific model of electronic component 12) to the preloaded firmware will help the control module 10 identify more electronic components 12. The method of adding the first address information and its corresponding behavior data may be provided to the control module 10 via a wired or wireless transmission interface.
[0059] Please refer to Figure 4 , Figure 4 For an embodiment of the present application, 2 Identify electronic components with I 2 C device. This embodiment is a flow chart of at least one processor and at least one I 2 The C device is arranged on a printed circuit board assembly and is based on I 2 An electronic component identification method based on C architecture.
[0060] In step S41, a processor (such as an MCU) starts the process. According to one embodiment, the preloaded firmware in the processor has multiple I 2 C device address information, the processor can be based on multiple I 2 Each address information of an I C device generates a query request. Therefore, each address information can correspond to an I 2 C device address information.
[0061] In step S42, the processor uses I 2 C interface transmits the query request to I 2 According to one embodiment, each time the processor transmits to I 2 The inquiry requests of C devices are all sent by different I 2 The address information corresponding to device C.
[0062] In step S43, I 2 C device responds to the query request transmitted by the processor. 2 If the C device responds to the inquiry request, then continue to S44; if I 2 If the C device does not respond to the inquiry request, the process returns to S42.
[0063] In step S44, the processor passes I 2 The address information corresponding to the inquiry request responded by the C device is 2 According to one embodiment, in the processor, each address information is associated with a behavior data, and the behavior data allows the processor to control the I 2 The C device performs initialization, control, and other actions.
[0064] The above is only an example to illustrate the preferred implementation mode of the present application, and is not intended to limit the scope of implementation. All simple replacements and equivalent changes made according to the claims and description of the present application are within the protection scope of the present application.
Claims
1. An electronic component identification method is applied to an electronic device, wherein the electronic device is provided with a preloaded firmware, wherein the preloaded firmware has a plurality of different first address information built in, and the electronic device is electrically connected to a plurality of electronic components, each of which has a different second address information, and the method is applied before the electronic device sends corresponding behavior data to the plurality of electronic components, wherein: The method comprises: generating a plurality of inquiry messages, each of the inquiry messages including one of the plurality of first address information; sending the plurality of inquiry messages to the plurality of electronic components; receiving response information, wherein the response information is sent back to the electronic device by the electronic component to which the matched second address information belongs when any of the second address information matches one of the plurality of first address information; and According to the response information, it is identified that each of the second address information matches one of the plurality of first address information, and each of the matched first addresses is recorded as matched first address information.
2. The electronic component identification method according to claim 1, characterized in that: The preloaded firmware further includes a plurality of the behavior data of a plurality of electronic components, each behavior data being associated with one of the plurality of first address information.
3. The electronic component identification method according to claim 2, after recording the matched first address information, further comprising the following steps, characterized in that: According to the first address information respectively corresponding to the plurality of electronic components, the behavior data associated with the corresponding first address information is sent to the corresponding electronic component.
4. The electronic component identification method according to claim 3, characterized in that: The behavior data includes initialization behavior data, and the control module initializes the electronic components respectively according to the initialization behavior data.
5. The electronic component identification method according to claim 4, characterized in that: The behavior data also includes behavior control data. After initialization is completed, the control module performs behavior control on the electronic components respectively according to the behavior control data.
6. An electronic device, characterized in that: include: The control module has a preloaded firmware, wherein the preloaded firmware has a plurality of different first address information built in, and the control module generates a query message corresponding to each first address information in the preloaded firmware; as well as A plurality of electronic components are connected to the control module, each of the electronic components is configured with a different second address information and receives the inquiry information; The control module receives response information transmitted from the electronic component, and identifies whether the multiple first address information matches or does not match the multiple second address information based on the response information, and records each of the matched first addresses as the matched first address information, and the response information is returned to the control module by the electronic component to which the second address information belongs when any of the second address information matches one of the multiple first address information.
7. The electronic device according to claim 6, characterized in that: The preloaded firmware also includes behavior data of multiple electronic components, each behavior data is associated with one of the multiple first address information, and the control module sends the corresponding behavior data to the multiple electronic components respectively according to the matched first address information.
8. The electronic device according to claim 7, characterized in that: The behavior data includes initialization behavior data, and the control module initializes the electronic components corresponding to the matched first address information respectively according to the initialization behavior data.
9. The electronic device according to claim 8, characterized in that: The behavior data also includes behavior control data, and the control module performs behavior control on the electronic components corresponding to the matched first address information according to the behavior control data.
10. An electronic component identification method, applied to an electronic device, wherein the electronic device is provided with a preloaded firmware, wherein the preloaded firmware has a plurality of different first address information built in, and the electronic device is electrically connected to a plurality of electronic components, each of which has a different second address information, and the method is applied before the electronic device sends corresponding behavior data to the plurality of electronic components, characterized in that: The method comprises: generating a plurality of inquiry information, wherein the inquiry information is used to inquire the plurality of electronic components about the second address information; sending the plurality of inquiry messages to the plurality of electronic components; receiving response information, wherein each of the response information includes the second address information to which each of the plurality of electronic components belongs; and The plurality of first address information are compared to see whether they match any one of the plurality of second address information, wherein when any one of the first addresses matches the plurality of second address information, it is recorded as having matched the first address information.
11. The electronic component identification method according to claim 10, characterized in that: The preloaded firmware further includes a plurality of the behavior data of a plurality of electronic components, each behavior data being associated with one of the plurality of first address information.
12. The electronic component identification method according to claim 11, after recording the matched first address information, further comprising the following steps, characterized in that: According to the first address information respectively corresponding to the plurality of electronic components, the behavior data associated with the corresponding first address information is sent to the corresponding electronic component.
13. The electronic component identification method according to claim 12, characterized in that: The behavior data includes initialization behavior data, and the control module initializes the electronic components respectively according to the initialization behavior data.
14. The electronic component identification method according to claim 13, characterized in that: The behavior data also includes behavior control data. After initialization is completed, the control module performs behavior control on the electronic components respectively according to the behavior control data.