Control device and control method
By detecting the I2C bus timing signal and generating a resistance adjustment signal to adjust the resistance value of the controllable pull-up resistor, the problem of inaccurate pull-up resistor value selection in the I2C bus is solved, and adaptive adjustment of the bus driving capability and stability of the signal quality are achieved.
Patent Information
- Application Number
- CN202511013966.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-23
AI Technical Summary
In I2C bus applications, since the load capacity of the downstream device is difficult to accurately obtain, the resistance value of the pull-up resistor is not accurately selected, which affects the signal quality. In addition, the existing technology cannot achieve adaptive adjustment when the load capacity changes.
The signal detection module detects the timing signal of the I2C bus, and the control module generates a resistance adjustment signal according to the difference between the detection value and the preset range to adjust the resistance value of the controllable pull-up resistor to achieve adaptive resistance adjustment.
The adaptive adjustment of the driving capability of the I2C bus is realized to ensure stable signal quality, avoid signal mutations and system instability caused by improper resistance selection, and adapt to changes in the number of slave devices.
Smart Images

Figure CN120523758B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of bus driving control, and in particular to a control device and a control method. BACKGROUND
[0002] I2C (Inter-Integrated Circuit) bus is a synchronous serial communication link widely used in electronic devices, mainly used for short-distance communication between microcontrollers and various peripheral devices. However, in the actual application scenario of I2C, due to the flexibility of the downlink device, the number of downlink devices connected to the same I2C bus, wiring, layout and other factors will cause the load capacity of the I2C bus to change, thereby affecting the quality of the I2C transmission signal. Therefore, the selection of the resistance value of the pull-up resistor is a very important parameter.
[0003] However, in the related art, due to the difficulty in accurately obtaining the load capacity data of different downlink devices, it is not possible to provide accurate resistance value selection basis for the pull-up resistor according to the load capacity. Therefore, how to select the resistance value of the pull-up resistor is a technical problem to be solved in the related art. SUMMARY
[0004] In view of the above problems, the present application provides a control device and a control method.
[0005] According to a first aspect of the present application, a control device is provided, comprising: a signal detection module, the input end of the signal detection module being connected with a target bus, for detecting a timing signal of the target bus, wherein the target bus is used to electrically connect a master device with a plurality of slave devices; a control module, for generating a resistance adjustment signal according to the difference between the detection value of the timing signal and a preset range; a controllable pull-up resistor, electrically connected with the target bus, for adjusting the resistance value of the controllable pull-up resistor according to the resistance adjustment signal, wherein the controllable pull-up resistor is used to pull up the voltage of a signal line in the target bus to a preset level.
[0006] According to an embodiment of the present application, the detection value of the timing signal is a plurality of detection values, and the preset range includes a plurality of sub-ranges respectively for the plurality of detection values; the control module is further used for: for any one of the plurality of detection values, in the case that the any one detection value is within the sub-range, determining that the deviation value of the any one detection value is a predetermined value; in the case that the any one detection value is outside the sub-range, determining the smaller one of the difference between the any one detection value and the upper limit value of the sub-range and the difference between the any one detection value and the lower limit value of the sub-range as the deviation value; obtaining a weighted value of the any one detection value according to the deviation value of the any one detection value and the weight of the any one detection value; and obtaining a comprehensive deviation value based on the weighted values of the plurality of detection values.
[0007] According to an embodiment of the present application, the signal detection module is further configured to, in the case that the integrated deviation value is the predetermined value, detect the timing signal of the target bus again.
[0008] According to an embodiment of the present application, the controllable pull-up resistor is further configured to, in the case that the integrated deviation value is inconsistent with the predetermined value, decrease or increase the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0009] According to an embodiment of the present application, the control module is further configured to repeat the following operation until the resistance adjustment times equal to a preset times or the integrated deviation value is the predetermined value: sending the resistance adjustment signal to the controllable pull-up resistor to make the controllable pull-up resistor perform resistance adjustment.
[0010] According to an embodiment of the present application, the signal detection module is further configured to, in the case that the controllable pull-up resistor completes resistance adjustment and the resistance adjustment times is less than or equal to the preset times, detect the timing signal of the target bus again.
[0011] According to an embodiment of the present application, the control module is further configured to, in the case that the resistance adjustment times is greater than the preset times and the integrated deviation value is inconsistent with the predetermined value, send an alarm information.
[0012] According to an embodiment of the present application, the controllable pull-up resistor is further configured to adjust the resistance value according to a preset resistance adjustment step.
[0013] According to an embodiment of the present application, the control module and the controllable pull-up resistor are integrated.
[0014] According to an embodiment of the present application, the signal detection module is further configured to detect the rise time and the fall time in the timing signal at a predetermined frequency; and the control module is further configured to generate the resistance adjustment signal according to the difference between the rise time, the fall time and a preset range.
[0015] According to an embodiment of the present application, the signal detection module comprises a first storage unit, the first storage unit is configured to store the detection value of the timing signal; and the control module comprises a second storage unit, the second storage unit is configured to store the sub-range and the weight of each detection value.
[0016] According to an embodiment of the present application, the signal detection module is further configured to obtain the detection value from the first storage unit and transmit the detection value to the control module.
[0017] The second aspect of the present application provides a control method, which is applied to the above-mentioned control device, and is characterized in that the above-mentioned method includes: using a signal detection module to detect the timing signal of the target bus; using a control module to generate a resistance adjustment signal based on the difference between the detection value of the timing signal and a preset range; using a controllable pull-up resistor to adjust the resistance value of the controllable pull-up resistor according to the above-mentioned resistance adjustment signal.
[0018] According to an embodiment of the present application, the target bus is configured to transmit signals in an open-drain output manner.
[0019] According to an embodiment of the present application, the above-mentioned control method also includes: when the control device is reset, setting the detection frequency of the above-mentioned signal detection module, wherein the above-mentioned detection frequency is greater than the frequency of the signal transmitted by the above-mentioned target bus; setting the transmission rate and data format of the above-mentioned control module to support communication between the above-mentioned signal detection module and the above-mentioned controllable pull-up resistor; setting the initial resistance value of the above-mentioned controllable pull-up resistor.
[0020] According to a control device and control method provided by the present application, a signal detection module detects the timing signal of a target bus to obtain a detection value that can reflect the quality and characteristics of the signal transmitted by the target bus from different dimensions. Thus, the control module can generate a resistance adjustment signal based on the difference between the detection value and a preset range. The difference between the detection value and the preset range can reflect whether the driving capability of the target bus is in an optimal state and the direction in which the resistance of the pull-up resistor needs to be adjusted. Based on the resistance adjustment signal, the controllable pull-up resistor adjusts the resistance of the pull-up resistor accordingly to optimize the driving capability of the target bus. On this basis, adaptive adjustment of the driving capability of the target bus is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above contents and other objects, features and advantages of the present application will become more apparent through the following description of the embodiments of the present application with reference to the accompanying drawings.
[0022] Figure 1 A schematic diagram of a control device according to an embodiment of the present application is shown.
[0023] Figure 2 A schematic diagram of operations performed by a signal detection module and a control module in a control device according to an embodiment of the present application is shown.
[0024] Figure 3 A schematic diagram of operations performed by a control device according to an embodiment of the present application is shown.
[0025] Figure 4 A flow chart of a control method according to an embodiment of the present application is shown.
[0026] Figure 5A flow chart of initialization of a control device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary of the present application, and is not intended to limit the scope of the present application. In the following detailed description of the embodiments of the present application, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring aspects of the present application.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the term "includes" and tautological expressions thereof, such as "including," "includes," "include," "contains," "containing," and so forth, shall not be taken to exclude
[0029] All terms used herein including technical and scientific terms have the same meanings as commonly understood by one of ordinary skill in the art unless otherwise defined herein. It should be noted that the terms used herein are merely specific examples and should not be construed to limit the scope of the present application. Unless otherwise defined, all terms used herein, including technical and scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which this present application belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
[0030] In the case of using expressions similar to "at least one of A, B, and C, etc.", it is generally to be interpreted as including at least one of A, B, and C unless otherwise defined, for example, in the context of a patent application in a field related to this present application (for example, it will be interpreted that "a system having at least one of A, B, and C" includes a system including A alone, a system including B alone, a system including C alone, a system including both A and B, a system including both A and C, a system including both B and C, and / or a system including A, B, and C together, etc.).
[0031] It is found in the process of implementing the present application that the original intention of I2C is to solve the deficiencies of traditional parallel communication interface in terms of hardware resource occupation and communication complexity, thereby providing a simple and efficient communication solution.
[0032] I2C hardware circuit design is relatively simple, only SDA (Serial Data Line) and SCL (Serial Clock Line) are required. The simplified hardware circuit of I2C reduces the complexity of the interface, reduces the hardware cost, and improves the reliability of the system; and I2C has a one-master multi-slave communication capability, and within the range of bus load capacity, flexible slave device configuration can be achieved, which is very suitable for sensor communication; at the same time, since it only requires two signal lines, the requirement for hardware resources is relatively low, and it can meet most low-speed and low-power application scenarios.
[0033] But in the actual application scenario of I2C, the number of downlink devices connected to the same I2C bus, wiring, layout and other factors will cause the load capacity of the I2C bus to change, thereby affecting the signal quality of I2C. When the load capacity is large, the rise time, setup and hold time of the signal transmitted by I2C will not meet the use requirements. The selection of the resistance value of the pull-up resistor is a very important parameter, but this selection is often based on artificial calculation and experience to select a relatively safe resistance value.
[0034] In the actual process, there may be temporarily connected I2C downlink devices, which may cause the load capacity to be too large. If the load capacity is exceeded, the resistance can only be replaced under the condition that the entire system is powered off, which is very inconvenient. Therefore, under the condition of no manual intervention and without making major changes to the existing system, it is a problem in the related art to realize adaptive resistance value change of the pull-up resistor of the I2C bus.
[0035] Further, in the related art, the load capacity of the entire I2C bus is calculated, and the resistance value of the pull-up resistor is adjusted according to the load capacity to realize adaptive resistance value selection of the pull-up resistor. However, the related technical solutions still have the following problems: the load capacity data of different devices is difficult to accurately obtain, and the load capacity calculation result of the printed circuit board (PCB) is also relatively fuzzy, so that accurate resistance value selection reference cannot be provided; when the resistance value selection of the pull-up resistor is realized by a switch type MOS (Metal-Oxide-Semiconductor, metal oxide semiconductor) tube, the calculated resistance value is not fine enough, and if sudden adjustment is performed, signal mutation is easily caused, and then the jitter of the MOS tube switch is introduced, thereby affecting the system stability.
[0036] Therefore, an embodiment of the present application provides a control device that adjusts the resistance value of the adaptive pull-up resistor according to a detection value that can reflect the quality of the signal transmitted by the I2C bus.
[0037] Figure 1 A schematic diagram of the control device according to an embodiment of the present application is shown.
[0038] As Figure 1 shown, the control device 100 can include a signal detection module 110, a control module 120 and a controllable pull-up resistor 130.
[0039] In Figure 1 , the master device 140 is electrically connected to a plurality of slave devices through a target bus, and the plurality of slave devices include a slave device 1, a slave device 2, …, and a slave device n, where n is an integer greater than 1.
[0040] On this basis, since the signal transmitted on the target bus needs to be detected, the input end of the signal detection module 110 can be connected with the target bus to detect the timing signal of the target bus.
[0041] In an embodiment, the target bus can be an I2C bus.
[0042] According to the embodiments of the present application, the output end of the signal detection module 110 can be connected with the input end of the control module 120, and the signal detection module 110 can transmit the detection value of the detected timing signal to the control module 120. The control module 120 can be used to generate a resistance adjustment signal according to the difference between the detection value of the timing signal and the preset range.
[0043] According to the embodiments of the present application, the signal detection module has high-speed sampling and processing capability, and can measure and analyze the signal with nanosecond-level precision. In terms of data transmission, the detection value is quickly and stably transmitted to the control module by using an efficient communication interface.
[0044] In an embodiment, the detection value of the timing signal can include the setup time, the hold time, the rise time, the fall time, the high hold time, etc. The detection value in the timing signal can reflect the quality and characteristics of the signal transmitted on the target bus from different dimensions.
[0045] According to the embodiments of the present application, the output end of the control module 120 is connected with the controllable pull-up resistor 130, and the control module 120 can transmit the generated resistance adjustment signal to the controllable pull-up resistor 130. The controllable pull-up resistor 130 is electrically connected with the target bus.
[0046] According to the embodiments of the present application, the controllable pull-up resistor 130 can be used to adjust the resistance value of the controllable pull-up resistor 130 itself according to the resistance adjustment signal, and the controllable pull-up resistor 130 can be used to pull up the voltage of the signal line in the target bus to a preset level.
[0047] Among them, the target bus includes two signal lines of data line and clock line; the preset level can represent the adjustment of the resistance value of the controllable pull-up resistor 130 based on the level of the signal line in the target bus.
[0048] According to the embodiments of the present application, the resistance value of the controllable pull-up resistor of the target bus is adjusted to adjust the driving capability of the target bus, so that the target bus can always maintain a stable and efficient working state.
[0049] According to the embodiment of the present application, the signal detection module detects the timing signal of the target bus to obtain a detection value capable of reflecting the quality and characteristics of the signal transmitted by the target bus from different dimensions. Thus, the control module can generate a resistance adjustment signal according to the difference between the detection value and a preset range, which can reflect whether the driving capability of the target bus is in an optimal state and the direction in which the resistance value of the pull-up resistor needs to be adjusted. The controllable pull-up resistor adjusts the resistance value of the pull-up resistor based on the resistance adjustment signal, so that the driving capability of the target bus is in an optimal state. On this basis, adaptive adjustment of the driving capability of the target bus is realized.
[0050] The following will be based on Figure 1 The scenario described above is described in detail by Figures 2-3 The control device of the embodiment of the present application is described in detail.
[0051] According to the embodiment of the present application, the detection value of the timing signal can be multiple, and the preset range can include multiple sub-ranges respectively for the multiple detection values. The control module is further configured to: for any one of the multiple detection values, determine a deviation value of the any one detection value as a predetermined value in a case where the any one detection value is within a sub-range; in a case where the any one detection value is outside the sub-range, determine a smaller difference between the any one detection value and an upper limit value and a lower limit value of the sub-range as the deviation value; obtain a weighted value of the any one detection value according to the deviation value of the any one detection value and a weight of the any one detection value; and obtain a comprehensive deviation value based on the weighted values of the multiple detection values.
[0052] According to the embodiment of the present application, the detection value of the timing signal can be multiple, such as setup time, hold time, rise time, fall time, etc. The preset range can include multiple sub-ranges respectively for the multiple detection values, i.e., one detection value corresponds to one sub-range. The sub-range of each detection value is set according to the need, and the sub-range can represent the range in which the corresponding detection value should be in under the condition that the driving capability of the target bus is kept in an optimal state.
[0053] According to the embodiment of the present application, the control module, in a case where the detection value of the timing signal transmitted by the signal detection module is received, can be further configured to calculate a deviation value of each detection value, and calculate a weighted value of each detection value in combination with the weight corresponding to the detection value, so as to obtain a comprehensive deviation value based on the weighted values of the multiple detection values.
[0054] Specifically, in a case where any one detection value is within a sub-range, it can be indicated that the detection value is within the ideal range in which the detection value should be in. The deviation value of the detection value can be determined as a predetermined value, where the predetermined value can be 0.
[0055] In an embodiment, if any detection value is out of the sub-range, it can be indicated that the detection value is not in the ideal range. Since the detection value is to be in the sub-range by adjusting the resistance of the controllable pull-up resistor, the smaller one of the difference between the detection value and the upper limit value and the difference between the detection value and the lower limit value can be determined as the deviation value. The difference is the absolute value of the difference.
[0056] Further, if the detection value is greater than the upper limit value of the sub-range, the deviation value of the detection value is the difference between the detection value and the upper limit value; if the detection value is less than the lower limit value of the sub-range, the deviation value of the detection value is the difference between the detection value and the lower limit value.
[0057] According to an embodiment of the present application, each detection value also has a corresponding weight, that is, the detection value and the weight are one-to-one corresponding. The weight is set according to the need, and further, the weight corresponding to the detection value can be set according to the degree of influence of the detection value on the communication stability of the target bus.
[0058] In an embodiment, the greater the weight corresponding to the detection value, the greater the influence of the detection value on the communication stability of the target bus. For example, if the setup time and the hold time have a greater influence on the communication stability, the weights of the setup time and the hold time can be set to 0.3; the weights of the rise time and the fall time are set to 0.2.
[0059] According to an embodiment of the present application, based on the weight allocated to each detection value, it can be used for subsequent comprehensive evaluation, that is, for calculating the comprehensive deviation value.
[0060] Specifically, the weighted value of any detection value can be calculated according to the deviation value of the detection value and the weight of the detection value. For example, the product of the deviation value and the weight of any detection value is taken as the weighted value of the detection value.
[0061] According to an embodiment of the present application, the comprehensive deviation value can be calculated based on the weighted values of the plurality of detection values.
[0062] In an embodiment, if the detection value is greater than the upper limit value of the sub-range, the weighted value of the detection value is unchanged in the process of calculating the comprehensive deviation value; if the detection value is less than the lower limit value of the sub-range, the weighted value of the detection value is taken as the opposite number in the process of calculating the comprehensive deviation value.
[0063] On this basis, based on the judgment of whether to take the opposite number, the sum of the weights of the detection values is determined as the comprehensive deviation value.
[0064] Therefore, in another embodiment, in the case that any detection value is out of the sub-range, the smaller absolute value between the difference between the upper limit value and the lower limit value of the sub-range and the detection value is determined as the deviation value, i.e., the deviation value is positive or negative, so that in the case of calculating the comprehensive deviation value, the weighted values of the detection values can be directly added to obtain the comprehensive deviation value.
[0065] According to the embodiments of the present application, the deviation value of the detection value is determined based on whether the detection value is in the sub-range, and the weighted value is calculated based on the weight of each detection value, so that the comprehensive deviation value is obtained based on the weighted values of the plurality of detection values, to reflect the current driving capability of the target bus, so as to be used to determine whether the driving capability needs to be enhanced or weakened.
[0066] According to the embodiments of the present application, the signal detection module is further configured to: in the case that the comprehensive deviation value is a predetermined value, detecting the timing signal of the target bus again.
[0067] According to the embodiments of the present application, in the case that the comprehensive deviation value calculated by the control module based on the detection values of the signals transmitted by the signal detection module is a predetermined value, it indicates that the driving capability of the target bus at this time is the best state, and there is no need to adjust the resistance value of the controllable pull-up resistor.
[0068] On this basis, in order to make the target bus always in a stable and efficient working state, i.e., to make the target bus in the best driving capability state, it is necessary to continuously detect the timing signal of the target bus.
[0069] Therefore, in the case that the comprehensive deviation value is a predetermined value, the signal detection module can also be used to detect the timing signal of the target bus again.
[0070] In an embodiment, the control module can send an instruction signal for the next detection to the signal detection module in the case that the comprehensive deviation value is a predetermined value; and the signal detection module can detect the timing signal of the target bus again in the case that the instruction signal is received.
[0071] According to the embodiments of the present application, in the case that the comprehensive deviation value is a predetermined value, it indicates that the target bus at this time is in the best driving state, and there is no need to adjust the resistance value of the controllable pull-up resistor. On this basis, in order to make the target bus always in a stable and efficient working state, the signal detection module detects the timing signal of the target bus again.
[0072] According to the embodiments of the present application, the controllable pull-up resistor is further configured to: in the case that the comprehensive deviation value is inconsistent with the predetermined value, decrease or increase the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0073] According to the embodiment of the present application, in the case that the comprehensive deviation value is inconsistent with the predetermined value, the control module can send a resistance adjustment signal to the controllable pull-up resistor; the controllable pull-up resistor can decrease or increase the resistance value of the controllable pull-up resistor according to the resistance adjustment signal in the case that the resistance adjustment signal is received.
[0074] Specifically, in the case that the comprehensive deviation value is greater than the predetermined value on the basis of the predetermined value being 0, it indicates that each detection value of the detected timing signal exceeds the ideal range, and the driving capability of the target bus needs to be enhanced. Thus, the controllable pull-up resistor can decrease the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0075] In the case that the comprehensive deviation value is less than the predetermined value, it indicates that each detection value of the detected timing signal is lower than the ideal range, and the driving capability of the target bus needs to be weakened. Thus, the controllable pull-up resistor can increase the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0076] According to the embodiment of the present application, in the case that the comprehensive deviation value calculated by the control module is inconsistent with the predetermined value, the driving capability adjustment direction of the target bus is determined based on the positive and negative of the comprehensive deviation value, so that the corresponding resistance adjustment signal is sent to the controllable pull-up resistor, so that the controllable pull-up resistor increases or decreases the resistance value of the controllable pull-up resistor according to the resistance adjustment signal, thereby realizing the adjustment of the driving capability of the target bus.
[0077] Figure 2 An operation schematic diagram executed by the signal detection module and the control module in the control device according to the embodiment of the present application is shown.
[0078] As shown in Figure 2 , the embodiment includes operation S210 to operation S270.
[0079] According to the embodiment of the present application, the signal detection module can execute the above-mentioned operation S210, and the control module can execute the above-mentioned operation S220 to operation S270.
[0080] In operation S210, the signal detection module detects the timing signal of the target bus.
[0081] In operation S220, the control module determines the deviation value of any detection value.
[0082] According to the embodiment of the present application, the control module determines the deviation value of the corresponding detection value based on the plurality of detection values of the detected timing signal and the corresponding sub-range.
[0083] In operation S230, the comprehensive deviation value of the plurality of detection values is calculated.
[0084] According to the embodiment of the present application, the comprehensive deviation value is calculated based on the deviation value of each detection value and the corresponding weight.
[0085] In operation S240, it is determined whether the integrated deviation value is consistent with the predetermined value.
[0086] According to embodiments of the present application, in the case where the integrated deviation value is not consistent with the predetermined value, operation S250 is performed; in the case where the integrated deviation value is consistent with the predetermined value, operation S210 is performed.
[0087] In operation S250, it is determined whether the integrated deviation value is greater than the predetermined value.
[0088] According to embodiments of the present application, in the case where the integrated deviation value is greater than the predetermined value, operation S270 is performed; in the case where the integrated deviation value is less than the predetermined value, operation S260 is performed.
[0089] In operation S260, a resistance adjustment signal representing a decrease in the resistance value of the controllable pull-up resistor is sent to the controllable pull-up resistor.
[0090] In operation S270, a resistance adjustment signal representing an increase in the resistance value of the controllable pull-up resistor is sent to the controllable pull-up resistor.
[0091] According to embodiments of the present application, the control module is further configured to: repeatedly send the resistance adjustment signal to the controllable pull-up resistor to cause the controllable pull-up resistor to perform resistance adjustment, until the number of resistance adjustments is equal to a preset number or the integrated deviation value is the predetermined value.
[0092] According to embodiments of the present application, in order to prevent the adjustment process from falling into an infinite loop or over-adjustment, a maximum number of continuous adjustments of the controllable pull-up resistor is set, wherein the preset number can represent the maximum number of allowed continuous resistance adjustments. For example, the preset number can be 10, i.e., the controllable pull-up resistor can be adjusted for a maximum of 10 times.
[0093] According to embodiments of the present application, in the case where the integrated deviation value is not consistent with the predetermined value and the number of resistance adjustments is less than the preset number, the control module can continue to send the resistance adjustment signal to the controllable pull-up resistor to cause the controllable pull-up resistor to perform resistance adjustment.
[0094] According to embodiments of the present application, in the case where the number of resistance adjustments is equal to the preset number or the integrated deviation value is the predetermined value, the control module does not continue to send the resistance adjustment signal to the controllable pull-up resistor.
[0095] Specifically, in the case where the control module continuously sends the resistance adjustment signal to the resistance adjustment module, the control module can increase the number of resistance adjustments by 1 each time the resistance adjustment signal is sent to the controllable pull-up resistor until the preset number.
[0096] In an embodiment, in a case that the resistance adjustment times is less than the preset times and the integrated deviation value calculated at the resistance adjustment times is the predetermined value, the control module can reset the resistance adjustment times, for example, reset the resistance adjustment times to 0.
[0097] For example, in a case that the control module has sent the resistance adjustment signal to the controllable pull-up resistor for 5 times in succession, the resistance adjustment times is 5; in a case that the controllable pull-up resistor receives the resistance adjustment signal for the 5th time, the resistance of the controllable pull-up resistor is adjusted, and if the integrated deviation value calculated by the control module after this adjustment is the predetermined value, the resistance adjustment times can be reset to 0. According to the embodiment of the present application, by setting the preset times, the resistance adjustment times of the controllable pull-up resistor can be limited, so as to prevent the adjustment process from falling into an infinite loop or over-adjustment.
[0098] According to the embodiment of the present application, the signal detection module is further configured to: in a case that the resistance adjustment of the controllable pull-up resistor is completed and the resistance adjustment times is less than or equal to the preset times, detect the timing signal of the target bus again.
[0099] According to the embodiment of the present application, in a case that the resistance adjustment of the controllable pull-up resistor is completed and the resistance adjustment times is less than or equal to the preset times, the signal detection module can further detect the timing signal of the bus again.
[0100] Specifically, in a case that the integrated deviation value calculated by the control module is inconsistent with the predetermined value, the controllable pull-up resistor adjusts the resistance of the controllable pull-up resistor according to the resistance adjustment signal. In a case that the resistance adjustment of the controllable pull-up resistor is completed, the signal detection module detects the timing signal of the bus again to determine whether the driving capability of the target bus remains at the optimal state after the resistance of the controllable pull-up resistor is adjusted.
[0101] According to the embodiment of the present application, in a case that the resistance adjustment of the controllable pull-up resistor is completed and the resistance adjustment times is less than or equal to the preset times, it indicates that the last resistance adjustment fails to make the driving capability of the target bus at the optimal state, and then in a case that the resistance adjustment is completed and the resistance adjustment times is less than or equal to the preset times, the signal detection module is further configured to detect the timing signal of the target bus again to determine whether the resistance adjustment makes the driving capability of the target bus at the optimal state and whether the resistance needs to be adjusted continuously.
[0102] According to the embodiment of the present application, the control module is further configured to issue an alarm information in a case that the resistance adjustment times is greater than the preset times and the integrated deviation value is inconsistent with the predetermined value.
[0103] According to an embodiment of the present application, the preset number of times is the maximum number of times the controllable pull-up resistor can be continuously adjusted. If the comprehensive deviation value is inconsistent with the preset value and the number of resistance adjustments exceeds the preset number, it indicates that the controllable pull-up resistor has been continuously adjusted the preset number of times, but the driving capability of the target bus is still not at an optimal state. Based on this, the control module can issue a warning message.
[0104] In one embodiment, the warning information issued by the control module may be a flashing indicator light or an error message sent to the host.
[0105] According to an embodiment of the present application, if the drive capability of the target bus is still not optimal after the controllable pull-up resistor has been adjusted a predetermined number of times, further resistor adjustment may not be able to achieve optimal drive capability of the target bus. Therefore, the control module may issue an alarm indicating a possible hardware failure or other abnormality requiring manual inspection and maintenance.
[0106] Figure 3 A schematic diagram of operations performed by a control device according to an embodiment of the present application is shown.
[0107] like Figure 3 As shown, this embodiment includes operations S310 to S340.
[0108] In operation S310 , it is determined whether the number of resistance adjustment times is greater than a preset number.
[0109] According to an embodiment of the present application, before the control module performs the above-mentioned operation S250, the control module first performs operation S310 to determine whether the number of resistance adjustment times is greater than a preset number.
[0110] According to an embodiment of the present application, when the number of resistance adjustment times is less than or equal to the preset number, operation S320 is performed; when the number of resistance adjustment times is greater than the preset number, operation S340 is performed.
[0111] In operation S320 , the control module sends a resistance adjustment signal to the controllable pull-up resistor based on the comprehensive deviation value.
[0112] In operation S330 , the controllable pull-up resistor adjusts a resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0113] According to an embodiment of the present application, when the controllable pull-up resistor completes resistance adjustment, since the number of resistance adjustments is less than or equal to the preset number, the signal detection module performs operation S210 to detect the timing signal of the target bus again.
[0114] In operation S340 , an alarm message is issued.
[0115] Based on the above, after the controllable pull-up resistor completes a resistance adjustment, the signal detection module can detect the timing signal of the target bus again to obtain a new detection value. The new detection value is fed back to the control module, and the above steps of calculating the comprehensive deviation value, comparing the comprehensive deviation value with the predetermined value, adjusting the resistance value of the controllable pull-up resistor, etc. are repeated to form a closed-loop control process. Through continuous detection, adjustment and feedback, the driving capability of the target bus can always be maintained in an optimal state to adapt to frequent or intermittent changes in the number of slave devices.
[0116] According to an embodiment of the present application, the controllable pull-up resistor is also used to adjust the resistance value according to a preset resistance adjustment step.
[0117] According to an embodiment of the present application, the controllable pull-up resistor is also provided with a preset resistance adjustment step, wherein the preset resistance adjustment step is set according to needs.
[0118] For example, the preset resistance adjustment step can be 10Ω, that is, the controllable pull-up resistor can increase or decrease the resistance value by 10Ω based on the resistance adjustment signal each time.
[0119] In an embodiment, the controllable pull-up resistor is configured to have a wide adjustment range, high adjustment precision, short adjustment step, and support a sudden load fast response mode.
[0120] According to an embodiment of the present application, by setting the preset resistance adjustment step of the controllable pull-up resistor, the quality of the signal transmitted in the target bus can be prevented from fluctuating sharply due to an excessively large adjustment range, and a relatively gentle and slow adjustment process is achieved.
[0121] According to an embodiment of the present application, the control module and the controllable pull-up resistor are integrated.
[0122] According to an embodiment of the present application, the control module and the controllable pull-up resistor in the control device are integrated, that is, the control module and the controllable pull-up resistor in the control device can be integrated onto the same circuit board.
[0123] On this basis, in an embodiment, the control module, the signal detection module and the controllable pull-up resistor in the control device are integrated onto the same circuit board.
[0124] According to an embodiment of the present application, by integrating the control module and the controllable pull-up resistor in the control device, the hardware design complexity of the control device can be reduced.
[0125] According to an embodiment of the present application, the signal detection module is also used to detect the rise time and the fall time in the timing signal at a predetermined frequency; and the control module is also used to generate a resistance adjustment signal according to the difference between the rise time, the fall time and the preset range.
[0126] According to the embodiments of the present application, the rise time and the fall time in the detected values of the timing signals in the target bus are the parameter values that have greater influence on the signal transmission in the target bus, and thus the signal detection module can directly detect only the rise time and the fall time in the timing signals of the target bus.
[0127] However, since the signal detection module detects only the rise time and the fall time, the detection frequency of the signal detection module is required to be relatively high. The detection frequency of the signal detection module can be set as a predetermined frequency, so that the signal detection module detects the rise time and the fall time in the timing signals at the predetermined frequency.
[0128] In an embodiment, the predetermined frequency is set according to requirements, and the predetermined frequency is greater than 100 MHz.
[0129] According to the embodiments of the present application, since the signal detection module detects only the rise time and the fall time in the timing signals, and does not detect other detected values such as the setup time, the data calculation amount of the subsequent control module is reduced, and the calculation speed is improved. Moreover, since the rise time and the fall time are the parameter values that have greater influence on the target bus transmission, and other detected values have little influence, when the comprehensive deviation value calculated based on the two detected values is consistent with the predetermined value, the driving capability of the target bus can be maintained in a better state.
[0130] According to the embodiments of the present application, the signal detection module includes a first storage unit for storing the detected values of the timing signals, and the control module includes a second storage unit for storing the sub-ranges and the weights of the plurality of detected values.
[0131] According to the embodiments of the present application, the signal detection module can detect the timing signals of the target bus at the predetermined frequency. Each time the signal detection module detects, the signal detection module samples and analyzes the timing signals in a complete communication cycle of the target bus to obtain accurate detected values.
[0132] Therefore, the signal detection module can store the detected values of the detected timing signals in the first storage unit in the internal signal detection module. The first storage unit can be a register.
[0133] According to the embodiments of the present application, the second storage unit can be an EEPROM (Electrically Erasable Programmable Read-Only Memory). The second storage unit in the control module can be used to store the sub-ranges and the weights of the plurality of detected values.
[0134] According to an embodiment of the present application, the first storage unit in the signal detection module can store the detection value of the detected timing signal; and the second storage unit of the control module can store the sub-range and weight of each of the plurality of detection values, so that the subsequent comprehensive deviation value can be calculated directly based on the sub-range and weight stored in the second storage unit.
[0135] According to an embodiment of the present application, the signal detection module is further configured to obtain the detection value from the first storage unit and transmit the detection value to the control module.
[0136] According to an embodiment of the present application, the signal detection module can obtain the detection value of the timing signal from the first storage unit and transmit the detection value to the control module.
[0137] In an embodiment, the signal detection module comprises a communication interface, which can be a SPI (Serial Peripheral Interface).
[0138] Specifically, the signal detection module can transmit the detection value obtained from the first storage unit to the control module through the communication interface.
[0139] According to an embodiment of the present application, based on the first storage unit, the signal detection module can transmit the detection value of the timing signal stored in the first storage unit to the control module, so that the control module can directly calculate the comprehensive deviation value based on the detection value and the sub-range and weight corresponding to the detection value stored in the second storage unit of the control module, thereby determining whether the adjustment of the resistance value of the controllable pull-up resistor is needed.
[0140] Figure 4 A flowchart of a control method according to an embodiment of the present application is shown.
[0141] As shown in Figure 4 , the control method 400 comprises operation S410 to operation S430.
[0142] According to an embodiment of the present application, the control device as shown in Figure 1 may perform the above-mentioned operation S410 to operation S430.
[0143] In operation S410, the timing signal of the target bus is detected by using the signal detection module.
[0144] In operation S420, the control module is used to generate a resistance adjustment signal according to the difference between the detection value of the timing signal and the preset range.
[0145] In operation S430, the controllable pull-up resistor is used to adjust the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
[0146] According to the embodiments of the present application, the signal detection module detects the timing signal of the target bus to obtain a detection value capable of reflecting the quality and characteristics of the signal transmitted by the target bus from different dimensions, so that the control module can generate a resistance adjustment signal according to the difference between the detection value and a preset range, the difference between the detection value and the preset range can reflect whether the driving capability of the target bus is in an optimal state and the direction in which the resistance value of the pull-up resistor needs to be adjusted, so that the controllable pull-up resistor adjusts the resistance value of the pull-up resistor based on the resistance adjustment signal, so that the driving capability of the target bus is in an optimal state. On this basis, adaptive adjustment of the driving capability of the target bus is realized.
[0147] According to the embodiments of the present application, the target bus is configured to transmit signals in an open-drain output mode.
[0148] According to the embodiments of the present application, the target bus is configured to transmit signals in an open-drain output mode, that is, the above-mentioned control method is applicable to signals of which the signal output type is OD (Open Drain, open-drain).
[0149] According to the embodiments of the present application, the target bus transmitting signals in an open-drain output mode can be detected and controlled by the above-mentioned control method to keep the driving capability of the target bus in an optimal state at all times.
[0150] Figure 5 A flowchart of the initialization of the control device according to the embodiments of the present application is shown.
[0151] As shown in Figure 5 , the method 500 includes operation S510 to operation S530.
[0152] According to the embodiments of the present application, the above-mentioned operation S510 to operation S530 are performed in the case of resetting the control device. As shown in Figure 1 , in the case of resetting the control device 100, that is, the control device 100 is powered on, the control device 100 can be hardware initialized.
[0153] In operation S510, the detection frequency of the signal detection module is set.
[0154] The detection frequency is greater than the frequency of the signal transmitted by the target bus.
[0155] Specifically, the signal detection module in the control device can be initialized and configured, the detection frequency of the signal detection module is set, and the measurement accuracy of the signal detection module can also be set.
[0156] The measurement accuracy of the signal detection module is related to the accuracy of the device itself, and the higher the accuracy of the device itself, the higher the accuracy of the signal detection module.
[0157] According to the embodiments of the present application, the detection frequency of the signal detection module is set to be greater than the frequency of the target bus transmission signal, and the measurement precision and other parameters are set, which can ensure the detection precision of the signal detection module on the timing signal of the target bus.
[0158] In operation S520, the transmission rate and data format of the control module are set to support the communication between the signal detection module and the controllable pull-up resistor.
[0159] In an embodiment, the control module can be initialized, and the transmission rate and data format of the communication interface of the control module are set.
[0160] Specifically, the receiving rate of the control module is set to match the sending rate of the signal detection module, and the sending rate of the control module is set to match the receiving rate of the controllable pull-up resistor; the data format of the data transmitted by the control module is set to be the same as the data format of the controllable pull-up resistor and the signal detection module.
[0161] In operation S530, the initial resistance value of the controllable pull-up resistor is set.
[0162] In an embodiment, the controllable pull-up resistor can be initialized, and the initial resistance value of the controllable pull-up resistor is set.
[0163] Specifically, the initial resistance value of the controllable pull-up resistor can be reasonably set according to the default load condition of the target bus, so that the target bus is in a moderate driving capability state.
[0164] According to the embodiments of the present application, in the case of resetting the control device, the signal detection module, the control module and the controllable pull-up resistor in the control device can be initialized respectively. By initializing and setting the detection frequency, measurement precision and other parameters of the signal detection module, it can be ensured that the timing signal of the target bus can be accurately detected, and the detection precision is improved; by initializing and setting the transmission rate and data format of the control module, the normal communication between the signal detection module and the controllable pull-up resistor can be ensured, since the transmission rate is set to avoid data loss, and since the data format is set to ensure that the transmitted data can be correctly processed; by initializing and setting the resistance value of the controllable pull-up resistor, the target bus is in a moderate driving capability state.
[0165] Based on the above control device and control method, it can be applied to various application scenarios. For example, hot plug dynamic adjustment, increase in the number of slave devices, intermittent load change and the like.
[0166] The dynamic hot-swap adjustment solution based on the aforementioned control device is specifically designed for a specific application scenario: within a server, the I2C bus often connects multiple devices (such as temperature sensors, power management chips, and storage modules). Because servers must support hot-swap functionality, the bus load capacity fluctuates in real time when devices are dynamically connected or removed. Traditional fixed pull-up resistor designs are inadequate for such scenarios and can easily lead to signal degradation (e.g., excessive setup time and signal jitter), thus impacting system stability.
[0167] Therefore, the control device capable of adaptively adjusting the driving capability of the I2C bus can ensure that the quality of the signal transmitted on the I2C always meets the specification requirements.
[0168] In one embodiment, the signal detection module may be an integrated high-precision ADC (Analog-to-Digital Converter) and a high-speed sampling circuit (sampling rate ≥ 100 MHz). The signal detection module may be capable of capturing the timing parameters (such as setup time, hold time, and rise / fall time) of the SDA and SCL signals of the I2C bus in real time.
[0169] In one embodiment, the controllable pull-up resistor can be a digitally controlled potentiometer (e.g., AD5270), which supports a wide resistance adjustment range (e.g., 1 kΩ to 100 kΩ) and a fine step size (0.1 Ω / step). The controllable pull-up resistor can also receive control instructions, such as resistance adjustment signals, via an SPI interface.
[0170] In one embodiment, the control module may be an embedded microcontroller on a server motherboard, and may run a PID (Proportional-Integral-Derivative) control algorithm to dynamically generate a resistance adjustment signal according to the deviation value.
[0171] According to the embodiments of the present application, the signal detection module and the controllable pull-up resistor can be integrated into a single chip, thereby reducing the area occupied by the PCB (Printed Circuit Board), improving the response speed, and achieving integrated optimization.
[0172] On this basis, an independent I2C bus monitoring channel can also be set up to avoid interference with main business communications.
[0173] The specific dynamic adjustment process includes the following operations: (1) initialization configuration: initialize the detection frequency (100 MHz) and measurement mode (full cycle capture) of the signal detection module; the initial resistance value of the controllable pull-up resistor can be set to an intermediate value (such as 10 kΩ), which is suitable for the default bus load. (2) Real-time monitoring and feedback: the signal detection module uploads the detection value of the timing signal to the control module after each I2C communication cycle ends; the control module is used to calculate the comprehensive deviation value based on the detection value.
[0174] In an embodiment, the resistance value of the controllable pull-up resistor can be dynamically adjusted according to the comprehensive deviation value. In the case of a positive comprehensive deviation value, it can indicate that the quality of the signal transmitted on the I2C bus is deteriorating, and the resistance value needs to be reduced to enhance the driving current; in the case of a negative comprehensive deviation value, it can indicate that the quality of the signal transmitted on the I2C bus is redundant, and the resistance value needs to be increased to reduce the driving current. At the same time, the resistance value is adjusted gradually, such as setting the resistance adjustment step (such as adjusting the resistance value by 1% each time), to avoid signal oscillation caused by sudden changes.
[0175] In the case of reaching the maximum resistance adjustment times, if the deviation is not eliminated after 10 consecutive adjustments, the control module can trigger an alarm, such as recording a log and lighting an LED (Light Emitting Diode, Light Emitting Diode). Regarding the response to hot plug events, when a slave device is accessed or removed, a complete signal quality detection and adjustment is immediately started.
[0176] For the scenario of increasing the number of slave devices, the specific scenario is: in a smart home control system, the I2C bus is connected to multiple sensors (slave devices), such as temperature sensors, humidity sensors, and light sensors. With the expansion of system functions, several slave devices are added, resulting in an increase in the load of the I2C bus and a decrease in signal quality.
[0177] According to the embodiments of the present application, the signal detection module can detect the timing signal of the I2C bus every 100 ms. When a new slave device is accessed, the establishment time of the timing signal is detected to increase from the original 300 ns to 550 ns, which exceeds the preset ideal range (200 ns-500 ns); the rise time increases from 120 ns to 250 ns, which also exceeds the ideal range (100 ns-200 ns). The signal detection module transmits these detection values to the control module through the SPI interface.
[0178] After the control module receives the detection values, it calculates the deviation values of each detection value. The time to establish the deviation value is 550ns-500ns=50ns, and the rise time deviation value is 250ns-200ns=50ns. Then, according to the preset weight (such as the establishment time weight 0.3 and the rise time weight 0.2), the comprehensive deviation value is calculated: 50ns x 0.3 + 50ns x 0.2 = 15ns + 10ns = 25ns. Since the comprehensive deviation value is positive, it is judged that the driving ability needs to be enhanced.
[0179] Specifically, the control module sends a command to reduce the resistance value to the controllable pull-up resistor, and the adjustment step is set to 10Ω. The controllable pull-up resistor reduces the current resistance value from 100Ω to 90Ω.
[0180] The signal detection module detects the I2C bus signal again and finds that the time to establish is reduced to 450ns and the rise time is reduced to 200ns. At this time, the comprehensive deviation value is calculated again, and it is found that the deviation value has decreased, but it is still not completely back to the ideal range. The control module continues to control the controllable pull-up resistor to reduce the resistance value, and repeats the above detection, analysis and adjustment process until the detection value returns to the ideal range.
[0181] For the intermittent load change scenario, the specific scenario is: in a smart medical device, the I2C bus is connected to multiple functional modules (slave devices). Some modules will be intermittently turned on or off according to the working state of the device, causing the load of the I2C bus to change intermittently.
[0182] The signal detection module continuously detects the I2C bus signal. When a module that intermittently works is turned on, the high hold time is detected to increase from 500ns to 700ns, which exceeds the preset ideal range (400ns-600ns). The signal detection module transmits the detection value to the control module.
[0183] The control module calculates the deviation value of the high hold time as 700ns-600ns=100ns. Since the high hold time weight is 0.1, the comprehensive deviation value is 100ns x 0.1 = 10ns. The comprehensive deviation value is positive, indicating that the driving ability needs to be enhanced.
[0184] The control module sends a command to reduce the resistance value to the controllable pull-up resistor, and the adjustment step is 10Ω. The controllable pull-up resistor reduces the resistance value from 90Ω to 80Ω.
[0185] When the intermittent working module is closed, the signal detection module detects that the high hold time drops to 300 ns, which is lower than the ideal range. The control module calculates the deviation value as 400 ns - 300 ns = 100 ns, and the comprehensive deviation value is 100 ns x 0.1 = 10 ns (negative), and it is judged that the driving ability needs to be weakened. The control module controls the controllable pull-up resistor to increase the resistance value, and the resistance value is increased from 80 Ω to 90 Ω. By continuously adapting to the working state of the module, the signal quality of the I2C bus is ensured to be stable in the case of intermittent load change.
[0186] Based on the above, the control device and the control method of the application can monitor the signal quality of the I2C bus in real time, adjust the resistance value of the pull-up resistor according to the detection values such as the establishment time and the hold time, and optimize the driving ability. Taking the server hot plug scene as an example, the signal quality can be ensured to be stable when the device is connected or removed, and problems such as establishment time exceeding the limit and signal jitter can be avoided, so as to prevent the system stability from being affected due to the decrease of signal quality, and to ensure the stable operation of the system. By integrating the signal detection module and the controllable pull-up resistor into one chip, the hardware design complexity is reduced, and the PCB area occupation is reduced. At the same time, manual frequent calculation and replacement of the pull-up resistor are not needed, the labor cost and the system power-off time cost caused by replacement of the resistor are reduced, and the practicability and maintainability of the system are improved. On this basis, various scenes of frequent or intermittent changes of the number of devices on the I2C bus can be adapted, so that the driving ability can be automatically adjusted when the load is intermittently changed, the bus can always maintain a stable and efficient working state, and the application range of the I2C bus in different application scenes is widened.
[0187] Those skilled in the art can understand that the features described in various embodiments of the application can be combined and / or combined, even if such combinations or combinations are not explicitly described in the application. In particular, the features described in various embodiments of the application can be combined and / or combined without departing from the spirit and teachings of the application. All these combinations and / or combinations fall within the scope of the application.
[0188] The embodiments of the application are described above. However, these embodiments are only for illustrative purposes, and are not intended to limit the scope of the application. Although each embodiment is described above, this does not mean that the measures in each embodiment cannot be used advantageously in combination. Without departing from the scope of the application, those skilled in the art can make various substitutions and modifications, which all fall within the scope of the application.
Claims
1. A control device, characterized in that: The control device includes: a signal detection module, wherein an input end of the signal detection module is connected to a target bus and is used to detect a timing signal of the target bus, wherein the target bus is used to electrically connect a master device with a plurality of slave devices; a control module, configured to generate a resistance adjustment signal according to a difference between a detected value of the timing signal and a preset range; a controllable pull-up resistor, electrically connected to the target bus, and configured to adjust a resistance value of the controllable pull-up resistor according to the resistance adjustment signal, wherein the controllable pull-up resistor is configured to pull up a voltage of a signal line in the target bus to a preset level; In which, there are multiple detection values of the timing signal, and the preset range includes multiple sub-ranges for the multiple detection values respectively; the control module is also used to: for any detection value among the multiple detection values, when the any detection value is within the sub-range, determine that the deviation value of the any detection value is within a predetermined value; when the any detection value is outside the sub-range, determine the smaller difference between the any detection value and the upper limit value and the lower limit value of the sub-range as the deviation value; obtain the weighted value of the any detection value according to the deviation value of the any detection value and the weight of the any detection value; and obtain the comprehensive deviation value based on the weighted values of each of the multiple detection values.
2. The control device according to claim 1, characterized in that The signal detection module is further configured to: re-detect the timing signal of the target bus when the comprehensive deviation value is the predetermined value.
3. The control device according to claim 1, characterized in that The controllable pull-up resistor is also used to: When the comprehensive deviation value is inconsistent with the predetermined value, The resistance value of the controllable pull-up resistor is reduced or increased according to the resistance adjustment signal.
4. The control device according to claim 3, characterized in that The control module is further configured to: Repeat the following operations until the number of resistance adjustments is equal to the preset number, or the comprehensive deviation value is the predetermined value: sending the resistance adjustment signal to the controllable pull-up resistor to enable the controllable pull-up resistor to perform resistance adjustment.
5. The control device according to claim 4, characterized in that The signal detection module is further configured to: detect the timing signal of the target bus again when the controllable pull-up resistor completes resistance adjustment and the number of resistance adjustments is less than or equal to the preset number of times.
6. The control device according to claim 5, characterized in that The control module is further configured to issue an alarm message when the resistance adjustment times are greater than the preset times and the comprehensive deviation value is inconsistent with the predetermined value.
7. The control device according to any one of claims 1 to 6, characterized in that: The controllable pull-up resistor is further used to adjust the resistance value according to a preset resistance adjustment step.
8. The control device according to claim 1, characterized in that The control module and the controllable pull-up resistor are integrated.
9. The control device according to claim 1, characterized in that The signal detection module is further configured to detect a rise time and a fall time in the timing signal at a predetermined frequency; The control module is further configured to generate a resistance adjustment signal according to a difference between the rise time, the fall time and a preset range.
10. The control device according to claim 1, characterized in that The signal detection module includes a first storage unit, and the first storage unit is used to store the detection value of the timing signal; The control module includes a second storage unit configured to store respective sub-ranges and weights of a plurality of detection values.
11. The control device according to claim 10, characterized in that The signal detection module is further configured to obtain the detection value from the first storage unit and transmit the detection value to the control module.
12. A control method, applied to the control device according to any one of claims 1 to 11, characterized in that: The method comprises: Utilize the signal detection module to detect the timing signal of the target bus; generating, by a control module, a resistance adjustment signal according to a difference between a detected value of the timing signal and a preset range; The controllable pull-up resistor is utilized to adjust the resistance value of the controllable pull-up resistor according to the resistance adjustment signal.
13. The method according to claim 12, characterized in that The target bus is configured to transmit signals in an open-drain output manner.
14. The method according to claim 12, characterized in that The method further comprises: In case of a control device reset, Setting a detection frequency of the signal detection module, wherein the detection frequency is greater than a frequency of the target bus transmission signal; Setting the transmission rate and data format of the control module to support communication between the signal detection module and the controllable pull-up resistor; Set the initial resistance value of the controllable pull-up resistor.
Citation Information
Patent Citations
Dynamic regulation method and device for signal quality of I2C bus
CN107301147A
Pull-up resistor adjusting method, control chip and electronic equipment
CN112765064A