Method for automatically setting driving force of integrated circuit and system using same
By automatically adjusting the driving force value between the integrated circuit and the storage device, we can find the correct range of data transmission, and solve the data errors and overshoot problems caused by improper setting of the driving force value in the integrated circuit, achieving higher data transmission accuracy and reliability.
Patent Information
- Application Number
- CN202311740388.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-17
- Filing Date
- 2023-12-18
- Publication Date
- 2025-01-17
AI Technical Summary
In integrated circuits, especially circuits with transmission interfaces, such as I2C or SPI, improper setting of driving force values will lead to data reception errors or overshoots, resulting in manual adjustments by engineers, increasing the burden of experiments and the risk of mistriggering.
By automatically setting the driving force of the integrated circuit, the data end and frequency end between the integrated circuit and the storage device are used for testing, the driving force value is gradually adjusted, the range of correctly transmitted data is recorded, the final most stable driving force value is found, and the final stable driving force value is reduced. Manual settings are required.
It realizes automatic finding of the most stable driving force value, reduces the experimental burden of engineers manually setting, improves the accuracy and reliability of data transmission, and avoids data errors and overshoot problems.
Smart Images

Figure CN119322708A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to an integrated circuit technology, and in particular to a method for automatically setting the driving force of an integrated circuit and a system for automatically setting the driving force of an integrated circuit. Background Art
[0002] Generally speaking, in integrated circuits, especially integrated circuits with transmission interfaces, such as I2C or SPI, it is necessary to set a driver strength value for each data or frequency pin in the circuit. When the circuit board is replaced or the corresponding flash memory is replaced, the driver strength value also needs to be set separately. In general, the driver strength value cannot be set too high or too low. If the driver strength value is set too low, the coupled flash memory will not be able to receive data correctly. If the driver strength value is set too high, it is easy to produce overshoot and cause a ringing effect. This ringing effect is also easy to trigger falsely when triggering data, thereby causing data errors.
[0003] Taking the high-speed transmission of the Quad Serial Peripheral Interface Bus (QSPI) as an example, it is necessary to adjust the driving force value of the input and output pins (I / O pins) corresponding to the Quad Serial Peripheral Interface. It is necessary to know which pins are used in advance to adjust the driving force of the corresponding general-purpose input and output pins (GPIO). When the designer changes the pin to a multifunction pin (MFP), it is necessary to change the driving force of the corresponding general-purpose input and output pins. For the serial transmission interface (SPI), some circuit boards need to set the driving force (driverstrength) = 2 to transmit data normally. When a different circuit board is changed, the driving force (driverstrength) needs to be set to 3 to transmit data normally. Summary of the invention
[0004] The present disclosure provides a method and a system for automatically setting the driving force of an integrated circuit, which are used to automatically find the most stable driving force, thereby reducing the burden of manual setting experiments of engineers.
[0005] The embodiment of the present disclosure provides a method for automatically setting the driving force of an integrated circuit. The method for automatically setting the driving force of an integrated circuit includes: providing an integrated circuit and a storage device, wherein the integrated circuit has at least one data terminal and one frequency terminal, and the storage device is coupled to the data terminal and the frequency terminal; step A: starting from a default driving force as a test driving force, the integrated circuit transmits a default data to the storage device through the data terminal and the frequency terminal; step B: after the storage device receives the default data, it returns a verification message to the integrated circuit; step C: judging whether the default data is correct according to the verification message, and recording it; step D: increasing the default driving force by a default driving force value as the test driving force, and returning to step A until the test is completed; and according to the record of the above step C, finding a specific test driving force range, wherein the specific test driving force range is the test driving force range in which the default data is correct for the most consecutive times, thereby setting a final driving force.
[0006] The embodiment of the present disclosure further provides a system for automatically setting the driving force of an integrated circuit, and the system for automatically setting the driving force of an integrated circuit includes an integrated circuit and a storage device. The integrated circuit has at least one data terminal and a frequency terminal. The storage device is coupled to the data terminal and the storage terminal. When setting the driving force, the following actions are performed: Step A: Starting from a default driving force as a test driving force, the integrated circuit transmits a default data to the storage device through the data terminal and the frequency terminal; Step B: After the storage device receives the default data, it returns a verification message to the integrated circuit; Step C: The integrated circuit determines whether the default data is transmitted correctly based on the verification message and records it; and Step D: Increase the default driving force by a default value as a test driving force, and return to step A until the test is completed; wherein, according to the record of the above step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range in which the default data is transmitted correctly the most times continuously, thereby setting a final driving force.
[0007] According to the preferred embodiment of the present disclosure, the method for automatically setting the driving force of an integrated circuit and the system for automatically setting the driving force of an integrated circuit are described, wherein, according to the record of the above step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range in which the default data transmission is correctly transmitted for the maximum number of consecutive times, and a final driving force is set, including: finding a minimum driving force when the default data transmission is correctly transmitted for the maximum number of consecutive times; finding a maximum driving force when the default data is correctly transmitted for the maximum number of consecutive times; and setting the median of the minimum driving force and the maximum driving force as the final driving force.
[0008] According to the method for automatically setting the driving force of an integrated circuit and the system for automatically setting the driving force of an integrated circuit described in the preferred embodiments of the present disclosure, the integrated circuit and the storage device use a four-wire serial peripheral interface, and the integrated circuit includes four serial peripheral interface data terminals, a serial peripheral interface frequency terminal, and a serial peripheral interface slave device selection terminal.
[0009] According to the method and system for automatically setting the driving force of an integrated circuit according to the preferred embodiment of the present disclosure, step C: judging whether the default data is correct according to the verification message and recording it, includes: setting a temporary continuous correct variable; setting a temporary test driving force variable; when the default data is correct, adding a default value to the temporary continuous correct variable, and adding the driving force default value to the temporary test driving force variable; when the default data is wrong, judging whether the temporary continuous correct variable is greater than a continuous correct variable; and when the temporary continuous correct variable is greater than a continuous correct variable, replacing the continuous correct variable with the temporary continuous correct variable, and replacing a maximum driving force variable with the temporary test driving force variable. In a preferred embodiment, it further includes: when the default data is wrong, setting the temporary continuous correct variable and the temporary test driving force variable to an initial value. In a preferred embodiment, it further includes: when the temporary continuous correct variable is less than the continuous correct variable, abandoning the temporary continuous correct variable and the temporary test driving force variable; and setting the temporary continuous correct variable and the temporary test driving force variable to an initial value.
[0010] In summary, the embodiment of the present disclosure adopts the method of setting different driving forces in sequence for testing. During the test, the default fixed data is transmitted to the storage device. The storage device is responsible for returning the data verification message. The returned data verification message is compared by the transmitting integrated circuit for correctness. In this way, it is determined whether the data transmitted to the storage device by the driving force at this time is correct. Therefore, the range of driving force with continuous correct data can be found. In this way, the most stable driving force can be set.
[0011] In order to further understand the technology, means and effects of the present disclosure, reference may be made to the following detailed description and drawings, so that the purpose, features and concepts of the present disclosure can be thoroughly and specifically understood. However, the following detailed description and drawings are only used for reference and explanation of the implementation of the present disclosure, and are not intended to limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are provided to enable those with ordinary knowledge in the technical field to which the present disclosure belongs to further understand the present disclosure, and are incorporated into and constitute a part of the specification of the present disclosure. The accompanying drawings show exemplary embodiments of the present disclosure, and are used together with the specification of the present disclosure to explain the principles of the present disclosure.
[0013] Figure 1FIG. 4 is a system block diagram of a system for automatically setting driving force of an integrated circuit according to an embodiment of the present disclosure.
[0014] Figure 2 FIG. 4 is a flow chart of a method for automatically setting driving force of an integrated circuit according to an embodiment of the present disclosure.
[0015] Figure 3 FIG. 1 is a flowchart of a method for automatically setting driving force of an integrated circuit according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0016] Reference will now be made in detail to exemplary embodiments of the present disclosure, which are illustrated in the accompanying drawings. Where possible, the same component symbols are used in the drawings and the specification to refer to the same or similar components. In addition, the exemplary embodiments are only one of the implementation methods of the design concept of the present disclosure, and the following examples are not intended to limit the present disclosure.
[0017] Figure 1 FIG. 1 is a block diagram of a system for automatically setting the driving force of an integrated circuit according to an embodiment of the present disclosure. Figure 1In this embodiment, the system for automatically setting the driving force of an integrated circuit includes an integrated circuit 101 and a storage device 102. In this embodiment, the integrated circuit 101 uses a quad serial peripheral interface (Quad Serial Peripheral Interface Bus, QSPI) as an example, so in this embodiment, the integrated circuit 101 includes a quad serial peripheral interface frequency pin CLK, a quad serial peripheral interface slave device selection pin SS, two master device output slave device input pins MOSI0, MOSI1 and two master device input slave device output pins MISO0, MISO1. Among them, since the integrated circuit 101 is only coupled to one slave device, that is, the storage device 102, there is only one quad serial peripheral interface slave device selection pin SS in this embodiment. In other preferred embodiments, if the integrated circuit 101 is coupled to multiple slave devices, the number of the quad serial peripheral interface slave device selection pins SS will also increase with the number of slave devices. In addition, since this embodiment uses a quad serial peripheral interface, the storage device 102 is exemplified by a serial peripheral interface flash memory (SPI Flash). In addition, since the four-way serial peripheral interface is backward compatible with the serial peripheral interface (Serial Peripheral Interface Bus, SPI), the two master device output slave device input pins MOSI0, MOSI1 and the two master device input slave device output pins MISO0, MISO1 are four serial peripheral interface data terminals output in parallel when used in the four-way serial peripheral interface. When used as the original serial peripheral interface (SPI), only one master device output slave device input pin MOSI0, MOSI1 is used as the master device to output data to the slave device, and only one master device input slave device output pin MISO0, MISO1 is used to receive data from the slave device.
[0018] Since the four-way serial peripheral interface is a high-speed transmission, when the wiring or component configuration of the printed circuit board changes, different interferences are often caused, so the requirements for driving force are also relatively strict. Since the driving force of the previous technology is given a driving force value based on the experience of engineers and tested manually, when the wiring or component configuration of the printed circuit board changes, the driving force used by the experience value may be unusable and cause data errors. In this embodiment, a method for automatically setting the driving force of the integrated circuit is adopted to avoid manual testing by engineers and find a relatively stable driving force value.
[0019] Figure 2 FIG. 1 is a flow chart of a method for automatically setting the driving force of an integrated circuit according to an embodiment of the present disclosure. Figure 2 The method for automatically setting the driving force of an integrated circuit comprises the following steps:
[0020] Step S201: Start.
[0021] Step S202: Starting from a default driving force as a test driving force. Generally speaking, each data pin and frequency pin needs to set the driving force. Therefore, here, the data pins can be divided into one group and the frequency pins can be divided into another group. The driving force can be increased from the lowest driving force 0000 by adding a driving force default value each time (for example, adding 0001, 0010 or other numbers, determined according to different designs), and tested one by one. Alternatively, the driving force can be reduced from the highest driving force 1111 by adding a negative driving force default value each time, and tested one by one.
[0022] Step S203: The integrated circuit 101 transmits a default data to the storage device 102 via the data terminal and the clock terminal. In this step, the integrated circuit 101 intentionally transmits the same data to the storage device 102.
[0023] Step S204: After receiving the default data, the storage device 102 returns a verification message to the integrated circuit 101. After the integrated circuit 101 completes the transmission, the message returned by the storage device 102 (SPI Flash) is, for example, a cyclic redundancy check (CRC). The integrated circuit 101 can determine whether the transmitted data is correct through the returned cyclic redundancy check.
[0024] Step S205: According to the verification message, determine whether the default data is correctly received, and record whether it is correct or not. As described in the above steps, the cyclic redundancy check code can be used to determine whether the transmitted data is correct. And record the correct and incorrect information.
[0025] Step S206: the default driving force is increased by a default driving force value as the test driving force, and the process returns to step 203 until the test is completed.
[0026] Step S207: According to the above records, a specific test driving force range is found to set a final driving force. In this embodiment, the driving force range in which the default data is correct the most times is found through the above test. If the cyclic redundancy check code is correct for the consecutive times, it means that the driving force within this range is the most trustworthy driving force range. Therefore, the average or median driving force within this range can be set as the final driving force. In this way, the circuit can operate perfectly.
[0027] In the above embodiment, although the embodiment describes recording the driving force and finding the driving force range in which the default data is correct the most times in a row. In actual operation, as long as the program code is written correctly, only the driving force range in which the default data is correct the most times in a row can be recorded. In addition, in the above embodiment, the verification message is an example of a cyclic redundancy check code. Those with ordinary knowledge in this field should be able to infer that the verification message can also be implemented using a parity check code, a BCH code (Bose–Chaudhuri–Hocquenghem codes) or other types of error detection codes. The present disclosure is not limited to this.
[0028] Figure 3 The flowchart of the method for automatically setting the driving force of an integrated circuit according to an embodiment of the present disclosure is shown. Figure 3 The method for automatically setting the driving force of an integrated circuit comprises the following steps:
[0029] Step S301: Initialize variables r_stride, r_cnt, r_trim, and r_err. In this embodiment, r_stride refers to the default value of the driving force, that is, the amplitude of each increase in the driving force. r_cnt refers to the number of consecutive correct times. r_trim refers to the highest driving force when the number of consecutive correct times is reached. r_err refers to the error flag.
[0030] Step S302: t_trim+=r_stride. In this embodiment, t_trim refers to the test driving force, and each time returning to this step, the test driving force t_trim will be increased by a first-order driving force default value.
[0031] Step S303: Determine whether the cyclic redundancy check code is correct. If it is correct, execute step S304; if it is wrong, execute step S307.
[0032] Step S304: Determine whether the error flag r_err remains at 0. If the error flag r_err remains at 0, it means that no cyclic redundancy check error has occurred before, indicating that the continuous correctness is still in place, and step S305 is performed. If the error flag r_err is 1, it means that a cyclic redundancy check error has occurred before, indicating that the continuous correctness is interrupted, and step S306 is performed.
[0033] Step S305: t_cnt++. In this step, t_cnt represents a temporary continuous correct variable. If the result is correct, the temporary continuous correct variable is incremented by 1.
[0034] Step S306: Temporarily set the continuous correct variable t_cnt and the error flag r_err to 0. Then return to step S302.
[0035] Step S307: r_err is set to 1, and t_cnt>r_cnt is determined. In this embodiment, if a cyclic redundancy check code error occurs, it is determined whether the temporary continuous correct variable t_cnt is greater than the previously recorded continuous correct variable r_cnt. And the error flag r_err is set to 1, indicating that the continuous correct interruption. If the temporary continuous correct variable t_cnt is greater than the previously recorded continuous correct variable r_cnt, step S308 is performed, otherwise it returns to step S302. Since r_err is set to 1 after the continuous correct interruption, even if the correct occurs next time, it will automatically enter step S306 due to the judgment of step S304, so that t_cnt is set to the initial value 0.
[0036] Step S308: replace r_cnt with t_cnt, and replace r_trim with t_trim. Since the previously recorded continuous correct variable r_cnt, that is, the number of continuous correct times, is surpassed by the temporary continuous correct variable t_cnt, that is, the number of continuous correct times this time, this step replaces the continuous correct variable r_cnt with the temporary continuous correct variable t_cnt. In this step, the test driving force t_trim is recorded to replace r_trim. It means that the continuous correctness is interrupted when the driving force t_trim is tested.
[0037] From the above step S308, it can be seen that when this program is finished, two values will be recorded. The first value is the continuous correct variable r_cnt, that is, the longest continuous correct number of times, and the second value is the highest driving force r_trim when the continuous correct is true. In other words, as long as the continuous correct variable r_cnt and the highest driving force r_trim when the continuous correct is true are known, the lowest driving force when the continuous correct is true can be known. In this way, in addition to reducing the use of memory, the recording of invalid data is also greatly reduced.
[0038] For example, assuming that the cyclic redundancy check code errors occur in the driving forces 0000 to 0101, it means that steps S302, S303, and S307 are executed 6 times. Then, assuming that the cyclic redundancy check codes are all correct for 0110 to 1100, it means that steps S302, S303, S304, and S305 are executed 6 times. At this time, the temporary continuous correct variable t_cnt is equal to 6, the error flag r_err is 0, and the current test driving force t_trim is 1100. Then, when t_trim is 1101, a cyclic redundancy check code error occurs. At this time, the step will enter step S307, determine that t_cnt (6) is greater than r_cnt (0), and set the error flag r_err to 1. At this time, enter step S308, the continuous correct variable r_cnt will be replaced by 6, and the highest driving force r_trim when the continuous correct is set will be set to 1101. If it is assumed that cyclic redundancy check code errors occur in the subsequent period, at this time, the system can extract the continuous correct variable r_cnt and the highest driving force variable r_trim when the continuous correctness occurs, and through the above two values, find the median 1001 as the final driving force, and use this setting as the driving force of the data.
[0039] The above embodiment takes the setting of the driving force of two master device output slave device input pins MOSI0 and MOSI1 and two master device input slave device output pins MISO0 and MISO1 as examples. The same method can also be used to set the driving force of the four-way serial peripheral interface frequency pin CLK. Since the method is the same, it will not be repeated here.
[0040] In the above embodiment, although the four-way serial peripheral interface (QSPI) is used as an example, those with ordinary knowledge in the relevant technical field should know that the serial peripheral interface (SPI), I2C, I2S or other transmission interfaces can also automatically set the driving force in the same way. The present disclosure is not limited to this. Furthermore, although the above embodiment uses the median or average as the setting of the driving force. However, this is only a preferred embodiment, and any driving force value within the above range can be set as the final driving force. Therefore, the present disclosure is not limited to this.
[0041] In summary, the embodiment of the present disclosure adopts setting different driving forces in sequence for testing. During the test, the default fixed data is transmitted to the storage device. The storage device is responsible for returning the data verification message. The returned data verification message is compared by the transmitting integrated circuit for correctness. In this way, it is determined whether the data transmitted to the storage device by the driving force at this time is correct. Therefore, the range of driving force with continuous correct data can be found. In this way, the most stable driving force can be set.
[0042] It should be understood that the examples and embodiments described herein are for illustrative purposes only and that various modifications or changes in view thereof will be suggested to those skilled in the art and are to be included within the spirit and scope of the present application and the scope of the appended claims.
Claims
1. A method for automatically setting driving force of an integrated circuit, comprising: An integrated circuit and a storage device are provided, wherein the integrated circuit has at least one data terminal and a clock terminal, and the storage device is coupled to the data terminal and the clock terminal; Step A: Starting from a default driving force as a test driving force, the integrated circuit transmits a default data to the storage device through the data terminal and the clock terminal; Step B: After the storage device receives the default data, it returns a verification message to the integrated circuit; Step C: Based on the verification message, determine whether the default data is correctly received and record it; Step D: increasing the default driving force by a default driving force value as the test driving force, and returning to step A until the test is completed; and According to the record of step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range where the default data is correct for the maximum number of consecutive times, thereby setting a final driving force.
2. The method for automatically setting the driving force of an integrated circuit according to claim 1, wherein: According to the record of step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range in which the default data is correct for the maximum number of consecutive times, thereby setting a final driving force, including: Find the lowest driving force when the default data is correct for the maximum number of consecutive times; Find the highest driving force when the default data is correct for the maximum number of consecutive occurrences; and The median of the lowest driving force and the highest driving force is set as the final driving force.
3. The method for automatically setting the driving force of an integrated circuit according to claim 1, wherein: The integrated circuit and the storage device use a four-wire serial peripheral interface, and The integrated circuit comprises four serial peripheral interface data terminals, a serial peripheral interface frequency terminal and a serial peripheral interface slave device selection terminal.
4. The method for automatically setting the driving force of an integrated circuit according to claim 1, wherein: Step C: judging whether the default data is correctly received according to the verification message and recording it, including: Set a temporary continuous correct variable; Set a temporary test driving force variable; When the default data is correctly received, the temporary continuous correct variable is increased by a default value, and step D is executed; When the default data is wrong, Determining whether the temporary continuous correct variable is greater than a continuous correct variable; and When the temporary continuous correct variable is greater than a continuous correct variable, the temporary continuous correct variable replaces the continuous correct variable, and the temporary test driving force variable replaces a highest driving force variable.
5. The method for automatically setting the driving force of an integrated circuit according to claim 4, further comprising: Set a continuous correct flag; When the default data is wrong, the continuous correct flag variable is set to a specific value; Wherein, when the default data is correctly received, When the default data is correctly received and the continuous correct flag variable is an initial value, the temporary continuous correct variable is added with the default value; When the default data is correctly received and the continuous correct flag variable is the specific value, the temporary continuous correct variable is set to an initial value.
6. The method for automatically setting the driving force of an integrated circuit according to claim 4, wherein: Step C: judging whether the default data is correct according to the verification message and recording it, further comprising: When the temporary continuous correct variable is smaller than the continuous correct variable, the temporary continuous correct variable is abandoned.
7. A system for automatically setting driving force of an integrated circuit, comprising: An integrated circuit having at least a data terminal and a clock terminal; as well as A storage device coupled to the data terminal and the storage terminal; When setting the driving force, the following actions are performed: Step A: Starting from a default driving force as a test driving force, the integrated circuit transmits a default data to the storage device through the data terminal and the clock terminal; Step B: After the storage device receives the default data, it returns a verification message to the integrated circuit; Step C: the integrated circuit determines whether the default data is correctly received according to the verification message, and records it; and Step D: increasing the default driving force by a default value as the test driving force, and returning to step A until the test is completed; According to the record of step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range where the default data is correct for the maximum number of consecutive times, thereby setting a final driving force.
8. The system for automatically setting the driving force of an integrated circuit according to claim 7, wherein: According to the record of step C, a specific test driving force range is found, wherein the specific test driving force range is the test driving force range in which the default data is correct for the maximum number of consecutive times, thereby setting a final driving force, including: Find the lowest driving force when the default data is correct for the maximum number of consecutive times; Find the highest driving force when the default data is correct for the maximum number of consecutive occurrences; and The median of the lowest driving force and the highest driving force is set as the final driving force.
9. The system for automatically setting the driving force of an integrated circuit according to claim 7, wherein: The integrated circuit and the storage device use a four-wire serial peripheral interface, and The integrated circuit comprises four serial peripheral interface data terminals, a serial peripheral interface frequency terminal and a serial peripheral interface slave device selection terminal.
10. The system for automatically setting the driving force of an integrated circuit according to claim 7, wherein: Step C: Based on the verification message, determine whether the default data is correctly received and record it, including: Set a temporary continuous correct variable; Set a temporary test driving force variable; When the default data is correctly received, the temporary continuous correct variable is increased by a default value, and step D is executed; When the default data is wrong, Determining whether the temporary continuous correct variable is greater than a continuous correct variable; and When the temporary continuous correct variable is greater than a continuous correct variable, the temporary continuous correct variable replaces the continuous correct variable, and the temporary test driving force variable replaces a highest driving force variable.
11. The system for automatically setting the driving force of an integrated circuit according to claim 10, further comprising: Set a continuous correct flag; When the default data is wrong, the continuous correct flag variable is set to a specific value; Wherein, when the default data is correctly received, When the default data is correctly received and the continuous correct flag variable is an initial value, the temporary continuous correct variable is added with the default value; When the default data is correctly received and the continuous correct flag variable is the specific value, the temporary continuous correct variable is set to an initial value.
12. The system for automatically setting the driving force of an integrated circuit according to claim 10, wherein: Step C: According to the verification message, determine whether the default data is correctly received and record it, further comprising: When the temporary continuous correct variable is smaller than the continuous correct variable, the temporary continuous correct variable is abandoned.