A LIN automatic addressing adjustment system and method
By using current and amplification trimming technology in the LIN automatic addressing system, the problem of addressing errors caused by shunt current and resistance deviation is solved, and precise control and reliable automatic addressing are achieved.
Patent Information
- Application Number
- CN202411080724.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Deviations in the existing LIN shunt method automatic addressing technology during the process and manufacturing process lead to deviations in shunt current and shunt resistance, affecting the addressing accuracy and leading to addressing errors.
A trimming system including a shunt resistor, a current generation trimming module, a sampling amplification trimming module and a processor is used. Through the graph approximation algorithm model of the current trimming code and the amplification trimming code, the current and amplification factor are gradually adjusted, reducing the Small deviation to achieve precise control.
It minimizes the deviation of shunt current and shunt resistance during the test phase, ensuring the accuracy and reliability of LIN automatic addressing.
Smart Images

Figure CN118611665B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a trimming system and method thereof, in particular to a LIN automatic addressing trimming system and method thereof, belonging to the technical field of semiconductor integrated circuits. Background Art
[0002] LIN (Local Interconnect Network) shunt method automatic addressing technology is a method for automatically identifying the addresses of each slave device on the LIN bus. It is particularly suitable for automotive electronic systems that need to automatically configure node addresses during installation, such as interior ambient light systems. This method determines the location of each node by injecting specific current signals on the LIN bus and monitoring the response of these signals at different nodes.
[0003] like Figure 6 As shown in the figure, the current LIN addressing scheme is to inject current into the LIN bus under the control of the control unit, and this current flows to each slave node through a shunt resistor (Rshunt). The LIN input and output ports of each slave node are connected through a shunt resistor. It is usually implemented by combining a shunt resistor with an operational amplifier. By measuring the voltage difference, the master control unit can calculate the current flowing through each node, and then infer the number and location of the nodes connected to the bus.
[0004] Due to deviations in the process and manufacturing process, there will be deviations in shunt current and shunt resistance, which deviate from the ideal value and cause addressing failure. LIN shunt automatic addressing technology relies on precisely controlled current and preset resistance values to identify and configure each node in the network. If the deviation of current and resistance is too large in actual application, it may cause the following effects and consequences: 1. Addressing error: Each LIN slave device usually responds to a specific current injection through its unique shunt resistor to identify its position on the bus. If the resistance value deviation is large, the measured voltage change will not match the expectation, which may cause a node to be incorrectly identified or unable to be identified, affecting the configuration accuracy of the entire network. Therefore, ensuring the accuracy of current control and the stability of resistance value is crucial to achieve reliable LIN shunt automatic addressing. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a LIN automatic addressing adjustment system and method thereof, which can minimize the deviation of shunt current and shunt resistance in the test phase.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A LIN automatic addressing adjustment system comprises a shunt resistor Rshunt, a current generating adjustment module, a sampling amplifying adjustment module and a processor. The shunt resistor Rshunt is connected between LININ and LINOUT of a LIN bus to convert the current flowing through the shunt resistor Rshunt into a voltage signal. The output end of the electric field generating adjustment module is connected to LININ of the LIN bus. The two input ends of the sampling amplifying adjustment module are connected to the two ends of the shunt resistor Rshunt. The processor controls the current generating adjustment module and the sampling amplifying adjustment module.
[0008] Furthermore, the current generation and trimming module includes a current generating module and a first storage medium. The output end of the current generating module is connected to LININ of the LIN bus. The current generating module configures different currents according to the current code Ishut_Code_DAC to meet the requirements of different current sizes in different addressing stages. The current generating module further adjusts the current size according to the current trimming code Trimming_Code_DAC. The current code Ishut_Code_DAC and the current trimming code Trimming_Code_DAC are stored in the first storage medium.
[0009] Furthermore, the current generating module includes a DAC and a current conversion module, the DAC is connected to the current code Ishut_Code_DAC, and the output of the DAC is changed by the current code Ishut_Code_DAC to select different output gears. The output end of the DAC is connected to the input end of the current conversion module, and the output voltage of the DAC is converted into current through the current conversion module. The current conversion module is connected to the current trimming code Trimming_Code_DAC, and the current trimming code Trimming_Code_DAC selects different output currents by controlling the current output stage current mirror ratio.
[0010] Furthermore, the sampling, amplifying and trimming module includes a sampling, amplifying module, a computing module and a second storage medium. The two input ends of the sampling, amplifying module are connected to the two ends of the shunt resistor Rshunt. The sampling, amplifying module collects and amplifies the voltage signal of the shunt resistor Rshunt. The sampling, amplifying module modifies the amplification factor according to the amplification factor trimming code Trimming_Code_PGA. The amplification factor trimming code Trimming_Code_PGA is stored in the second storage medium. The output end of the sampling, amplifying module is connected to the input end of the computing module.
[0011] Furthermore, the sampling and amplification module includes a first-level sampling and amplification and a PGA. The first-level sampling and amplification performs a first-level amplification on the voltage signal collected on the shunt resistor Rshunt, and then performs a second-level amplification through the PGA. The PGA is connected to the amplification factor trimming code Trimming_Code_PGA, and the amplification factor trimming code Trimming_Code_PGA modifies the amplification factor of the PGA.
[0012] Furthermore, the operation module is an ADC, the output end of the PGA is connected to the input end of the ADC, and the ADC quantizes the amplified voltage signal output by the PGA.
[0013] A LIN automatic addressing adjustment method, based on a LIN automatic addressing adjustment system, comprises the following steps:
[0014] The gain of the first-stage sampling amplifier is Gain1, the output signal of the first-stage sampling amplifier is VPGA1, the gain of the PGA is Gain2, and the output signal of the PGA is VPF2;
[0015] VPGA2=VPGA1 Gain2=Vcom+Ishunt Rshunt Gain1 Gain2 (1)
[0016] Wherein, Vcom is the common mode value;
[0017] S1. First, disconnect the LIN_IN pull-up inside the chip through the processor, and connect LIN_OUT to the measuring resistor Rtest;
[0018] S2, the chip starts working, when the addressing module is enabled and disabled, the offset current I0 flowing through the measurement Rtest is recorded at this time, and the initial output code ADCcode0 of the ADC is recorded at this time;
[0019] VPGA2=Vcom+I0 Rshunt Gain1 Gain2 (2)
[0020] (3);
[0021] Where N is the number of quantization bits of the ADC;
[0022] S3, turn on the chip addressing module enable switch, the current generating module starts to generate current, and the measurement current I1 flowing through the measurement resistor Rtest at this time is recorded;
[0023] S4, addressing injection current is I1-I0;
[0024] S5. Execute the algorithm model based on the graph approximation method of the current trimming code Trimming_Code_DAC; first construct a first relationship graph between the current and the current trimming code Trimming_Code_DAC, compare the current addressing injection current value with the accuracy requirement, observe the corresponding position on the first relationship graph, mark the deviation between the actual current value and the target accuracy requirement, and intuitively display the gap; based on the first relationship graph, identify the direction of reducing the deviation, and gradually adjust the value of the current trimming code Trimming_Code_DAC; after each adjustment, re-measure the current and update the corresponding point on the first relationship graph; repeat the above process, observe the position change of the point on the relationship graph after each adjustment, until the current measurement value and the accuracy requirement tend to coincide on the first relationship graph; set a convergence threshold, when after several consecutive iterations, the deviation between the current measurement value and the accuracy requirement on the first relationship graph is less than the convergence threshold or the value change of the current trimming code Trimming_Code_DAC is less than 1, it is determined that the requirement is met; record the value of the current trimming code Trimming_Code_DAC at the last iteration as the target value of the current trimming code Trimming_Code_DAC;
[0025] S6. The current trimming code Trimming_Code_DAC is first configured as the target value, and the first current Ishunt1 flowing through the measurement Rtest is recorded at this time, and the first output code ADCcode1 of the ADC is recorded at this time, and the gain Gain2 of the PGA is calculated according to the formula;
[0026] (4)
[0027] (5)
[0028] (6)
[0029] (7)
[0030] Among them, ADCcode diff is the difference between the first output code ADCcode1 of the ADC and the initial output code ADCcode0 of the ADC; is the measured calculated value, is the ideal value, Calculated value for ADC output code measurement, is the ideal value of ADC output code;
[0031] S7, execute the algorithm model based on the graph approximation method of the amplification factor trimming code Trimming_Code_PGA; first construct a second relationship graph between the gain Gain2 of PGA and the amplification factor trimming code Trimming_Code_PGA; compare the current test value with the accuracy requirement, and observe the position of the corresponding point on the second relationship graph; mark the deviation between the actual test value and the target accuracy requirement, and intuitively display the gap; based on the second relationship graph, identify the direction of reducing the deviation, and gradually adjust the value of the amplification factor trimming code Trimming_Code_PGA; after each adjustment, re-measure and Update the corresponding points on the second relationship chart; repeat the above process, observe the position change of the points on the second relationship chart after each adjustment, until the measured value and the accuracy requirement tend to coincide on the second relationship chart; set a convergence threshold, when after several consecutive iterations, when the deviation between the measured value and the accuracy requirement on the second relationship chart is less than the convergence threshold or the value change of the magnification trimming code Trimming_Code_PGA is less than 1, it is determined that the requirement is met; record the value of the magnification trimming code Trimming_Code_PGA at the last iteration as the target value of the trimming code Trimming_Code_PGA;
[0032] S8. Finally, the target current trimming code Trimming_Code_DAC and the target gain trimming code Trimming_Code_PGA are obtained, the trimming components are burned, and the trimming codes are solidified.
[0033] Compared with the prior art, the present invention has the following advantages and effects: The present invention provides a LIN automatic addressing adjustment system and method, which can accurately control the current and ADC output coding through the adjustment technology to achieve reliable LIN shunt method automatic addressing. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic diagram of the architecture of a LIN automatic addressing adjustment system of the present invention.
[0035] Figure 2 It is a schematic diagram of a specific embodiment of a LIN automatic addressing adjustment system of the present invention.
[0036] Figure 3 The present invention is a flow chart of a LIN automatic addressing adjustment method.
[0037] Figure 4 4 is a table showing the ratio of change of the injection current corresponding to the Trimming_Code_DAC according to an embodiment of the present invention.
[0038] Figure 5It is a table showing the change ratio of Trimming_Code_PGA corresponding to the amplification factor Gain2 according to an embodiment of the present invention.
[0039] Figure 6 It is a schematic diagram of the automatic addressing architecture of the LIN split method in the prior art. DETAILED DESCRIPTION
[0040] In order to elaborate on the technical scheme adopted by the present invention to achieve the predetermined technical purpose, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only partial embodiments of the present invention, rather than all embodiments, and the technical means or technical features in the embodiments of the present invention can be replaced without paying creative work. The present invention will be described in detail below with reference to the drawings and in conjunction with the embodiments.
[0041] like Figure 1 As shown, a LIN automatic addressing adjustment system of the present invention includes a shunt resistor Rshunt, a current generating adjustment module, a sampling amplifying adjustment module and a processor. The shunt resistor Rshunt is connected between LININ and LINOUT of the LIN bus to convert the current flowing through the shunt resistor Rshunt into a voltage signal. The output end of the electric field generating adjustment module is connected to LININ of the LIN bus. The two input ends of the sampling amplifying adjustment module are connected to the two ends of the shunt resistor Rshunt. The processor controls the current generating adjustment module and the sampling amplifying adjustment module.
[0042] like Figure 2 As shown, the current generation and trimming module includes a current generation module and a first storage medium. The output end of the current generation module is connected to LININ of the LIN bus. The current generation module configures different currents according to the current code Ishut_Code_DAC to meet the needs of different current sizes in different addressing stages. The current generation module further adjusts the current size according to the current trimming code Trimming_Code_DAC. The current code Ishut_Code_DAC and the current trimming code Trimming_Code_DAC are stored in the first storage medium. The current code Ishut_Code_DAC is used to configure a wide range of currents, and the current trimming code Trimming_Code_DAC is used to finely adjust the current to ensure current accuracy. The more code words of the trimming code, the higher the trimming accuracy.
[0043] Among them, the current generation module includes a DAC (digital-to-analog converter) and a current conversion module. The DAC is connected to the current code Ishut_Code_DAC. The output of the DAC is changed by the current code Ishut_Code_DAC to select different output gears. The output end of the DAC is connected to the input end of the current conversion module. The output voltage of the DAC is converted into current through the current conversion module. The converted current is linearly related to the output voltage of the DAC. The current conversion module is connected to the current trimming code Trimming_Code_DAC. The current trimming code Trimming_Code_DAC selects different output current gears by controlling the current output stage current mirror ratio.
[0044] It is also possible to use only a set of adjustment codes with more bits to adjust the DAC or current conversion module to achieve the same effect, but this will increase the hardware cost of the DAC or current conversion module. Splitting it into two parts, the DAC and the current conversion module, can reduce the hardware cost.
[0045] like Figure 2 As shown, the sampling and amplification trimming module includes a sampling and amplification module, a computing module and a second storage medium. The two input ends of the sampling and amplification module are connected to the two ends of the shunt resistor Rshunt. The sampling and amplification module collects and amplifies the voltage signal of the shunt resistor Rshunt. The original signal of the voltage signal of the shunt resistor Rshunt is only a few mV. The original voltage signal is amplified by the sampling and amplification module. The sampling and amplification module modifies the amplification factor according to the amplification factor trimming code Trimming_Code_PGA. The amplification factor trimming code Trimming_Code_PGA is stored in the second storage medium. The output end of the sampling and amplification module is connected to the input end of the computing module.
[0046] Among them, the sampling and amplification module includes a first-stage sampling and amplification and a PGA (adjustable gain amplifier). The first-stage sampling and amplification performs a first-stage amplification on the voltage signal collected on the shunt resistor Rshunt, and then performs a second-stage amplification through the PGA. The PGA is connected to the amplification factor trimming code Trimming_Code_PGA, and the amplification factor trimming code Trimming_Code_PGA modifies the amplification factor of the PGA. The sampling and amplification module can adopt a first-stage amplification or a multi-stage amplification. Considering the chip area and performance as a compromise, the present invention preferably adopts a two-stage amplification.
[0047] The operation module is an ADC (analog-to-digital converter). The output end of the PGA is connected to the input end of the ADC. The ADC quantizes the amplified voltage signal output by the PGA.
[0048] like Figure 3 As shown, a LIN automatic addressing adjustment method and an adjustment system based on LIN automatic addressing include the following steps:
[0049] The gain of the first-stage sampling amplifier is Gain1, the output signal of the first-stage sampling amplifier is VPGA1, the gain of the PGA is Gain2, and the output signal of the PGA is VPF2;
[0050] VPGA2=VPGA1 Gain2=Vcom+Ishunt Rshunt Gain1 Gain2 (1)
[0051] Among them, Vcom is the common mode value.
[0052] S1. First, disconnect the LIN_IN pull-up inside the chip through the processor, and connect LIN_OUT to the measuring resistor Rtest.
[0053] S2, the chip starts working. When the addressing module is enabled and disabled, the offset current I0 flowing through the measurement Rtest is recorded at this time, and the initial output code ADCcode0 of the ADC is recorded at this time.
[0054] VPGA2=Vcom+I0 Rshunt Gain1 Gain2 (2)
[0055] (3);
[0056] Where N is the number of quantization bits of the ADC.
[0057] S3. Turn on the chip addressing module enable switch, and the current generating module starts to generate current. The current direction is from the power supply end to LIN_IN, then flows out from LIN_OUT through the shunt resistor Rshunt, and then flows into the measuring resistor Rtset. The measuring current I1 flowing through the measuring resistor Rtest at this time is recorded.
[0058] S4. The addressing injection current is I1-I0.
[0059] S5. Execute an algorithm model based on the graph approximation method of the current trimming code Trimming_Code_DAC; first construct a first relationship graph between the current and the current trimming code Trimming_Code_DAC, which describes the current value corresponding to different current trimming codes Trimming_Code_DAC; compare the current addressing injection current value with the accuracy requirement, observe the corresponding position on the first relationship graph, mark the deviation between the actual current value and the target accuracy requirement, and intuitively display the gap; based on the first relationship graph, identify the direction of reducing the deviation, and gradually adjust the value of the current trimming code Trimming_Code_DAC; After each adjustment, re-measure the current and update the corresponding point on the first relationship chart; repeat the above process, observe the position change of the point on the first relationship chart after each adjustment, until the current measurement value and the accuracy requirement tend to coincide on the first relationship chart; set a convergence threshold, when after several consecutive iterations, when the deviation between the current measurement value and the accuracy requirement on the first relationship chart is less than the convergence threshold or the change in the value of the current trimming code Trimming_Code_DAC is less than 1, it is determined that the requirement is met; record the value of the current trimming code Trimming_Code_DAC at the last iteration as the target value of the current trimming code Trimming_Code_DAC.
[0060] For example, ideally, the expected injection current is 2mA, that is, ITHEORY = 2mA, and the accuracy convergence value is set to 3%. The actual test injection current is 2.4mA, that is, ITEST = 2.4mA. The actual test value is larger than the ideal value of 2mA, so it is necessary to adjust the current trimming code Trimming_Code_DAC to adjust ITEST to the target value of 2mA. Taking Table 4 as an example, in the default state, the current trimming code Trimming_Code_DAC = 16, ITEST = 2mA; but the actual test value, ITEST = 2.4mA, to achieve the target value of 2mA, it needs to be reduced to 2 / 2.4 = 0.8333, and the current trimming code Trimming_Code_DAC needs to be changed to reduce ITEST by 16.667%. Therefore, the current trimming code Trimming_Code_DAC is adjusted from the default value 16 to 26.
[0061] S6. The current trimming code Trimming_Code_DAC is first configured as a target value, and the first current Ishunt1 flowing through the measurement Rtest at this time is recorded, and the first output code ADCcode1 of the ADC at this time is recorded, and the gain Gain2 of the PGA is calculated according to the formula.
[0062] (4)
[0063] (5)
[0064] Among them, ADCcode diff It is the difference between the first output code ADCcode1 of the ADC and the initial output code ADCcode0 of the ADC, representing the change of the injected current value corresponding to the ADC output code.
[0065] In formula (5), if any of the shunt resistor Rshunt, the gain Gain1 of the first-stage sampling amplifier, the gain Gain2 of the PGA, the reference voltage Vref_ADC of the ADC deviates from the preset value, the ADC output code will change, so it is necessary to adjust it to the required accuracy range through adjustment means. The output can be guaranteed to meet the requirements by adjusting the shunt resistor Rshunt, the gain Gain1 of the first-stage sampling amplifier, the gain Gain2 of the PGA, and the reference voltage Vref_ADC of the ADC, but the shunt resistor Rshunt is generally a resistor less than 1 ohm. If 1% high accuracy is to be achieved, a 0.01 ohm resistor needs to be introduced, which requires a larger chip area and high hardware cost. The reference voltage Vref_ADC is generally also adjusted to the preset value in advance through adjustment means. Therefore, the gain Gain1 of the first-stage sampling amplifier or the gain Gain2 of the second-stage amplifier can be adjusted. In the embodiment of the present invention, Gain2 is selected for adjustment.
[0066] (6)
[0067] (7)
[0068] in, is the measured calculated value, is the ideal value, Calculated value for ADC output code measurement, is the ideal value of the ADC output code.
[0069] S7. Execute the algorithm model based on the graph approximation method of the amplification factor trimming code Trimming_Code_PGA; first construct a second relationship graph between the gain Gain2 of PGA and the amplification factor trimming code Trimming_Code_PGA, which depicts the gain Gain2 value of PGA corresponding to different amplification factor trimming codes Trimming_Code_PGA; compare the current test value with the accuracy requirement, and observe the position of the corresponding point on the second relationship graph; mark the deviation between the actual test value and the target accuracy requirement, and intuitively display the gap; based on the second relationship graph, identify the direction of reducing the deviation, and gradually adjust the amplification factor trimming code Trimming_Code_PGA. g_Code_PGA value; after each adjustment, re-measure and update the corresponding point on the second relationship chart; repeat the above process, observe the position change of the point on the second relationship chart after each adjustment, until the measured value and the accuracy requirement tend to coincide on the second relationship chart; set a convergence threshold, when after several consecutive iterations, when the deviation between the measured value and the accuracy requirement on the second relationship chart is less than the convergence threshold or the value change of the magnification trimming code Trimming_Code_PGA is less than 1, it is determined that the requirement is met; record the value of the magnification trimming code Trimming_Code_PGA at the last iteration as the target value of the trimming code Trimming_Code_PGA.
[0070] For example, in an ideal situation: Rshunt=0.8Ω, Gain1=24, Vref_ADC=2.4V, N=11, Gain2=8, =308.
[0071] Test value: =277, calculated according to formula (7) _test=7.386, the actual test value is smaller than the ideal value of 8.
[0072] Therefore, it is necessary to adjust the magnification trimming code Trimming_Code_PGA to adjust to the target value of 8. Figure 5 For example, the magnification trimming code Trimming_Code_PGA corresponds to the change of Gain2. In the default state, Trimming_Code_PGA=16, Gain2=8; the test value, Gain2=7.386, to reach the target value of 8, it needs to increase 8 / 7.386=1.083 times, and the magnification trimming code Trimming_Code_PGA needs to be changed to increase Gain2 by 8.3%. Therefore, the magnification trimming code Trimming_Code_PGA is adjusted from the default value of 16 to 12.
[0073] S8. Finally, the target current trimming code Trimming_Code_DAC and the target gain trimming code Trimming_Code_PGA are obtained, the trimming components are burned, and the trimming codes are solidified.
[0074] The present invention provides a LIN automatic addressing adjustment system and method thereof, which can accurately control the current and ADC output coding through the adjustment technology to realize reliable LIN current shunting method automatic addressing.
[0075] The above is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent replacement and improvement made to the above embodiments without departing from the content of the technical solution of the present invention, based on the technical essence of the present invention, within the spirit and principles of the present invention, still fall within the protection scope of the technical solution of the present invention.
Claims
1. A LIN automatic addressing adjustment system, characterized in that: It includes a shunt resistor Rshunt, a current generation and adjustment module, a sampling and amplification adjustment module and a processor. The shunt resistor Rshunt is connected between LININ and LINOUT of the LIN bus to convert the current flowing through the shunt resistor Rshunt into a voltage signal. The output end of the electric field generation and adjustment module is connected to LININ of the LIN bus. The two input ends of the sampling and amplification adjustment module are connected to the two ends of the shunt resistor Rshunt. The processor controls the current generation and adjustment module and the sampling and amplification adjustment module. The current generation and trimming module comprises a current generation module and a first storage medium, wherein the output end of the current generation module is connected to LININ of the LIN bus, the current generation module configures different currents according to the current code Ishut_Code_DAC to meet the requirements of different current sizes at different addressing stages, the current generation module further adjusts the current size according to the current trimming code Trimming_Code_DAC, and the current code Ishut_Code_DAC and the current trimming code Trimming_Code_DAC are stored in the first storage medium; The current generating module comprises a DAC and a current conversion module. The DAC is connected to the current code Ishut_Code_DAC. The output of the DAC is changed by the current code Ishut_Code_DAC to select outputs of different gears. The output end of the DAC is connected to the input end of the current conversion module. The output voltage of the DAC is converted into current through the current conversion module. The current conversion module is connected to the current trimming code Trimming_Code_DAC. The current trimming code Trimming_Code_DAC selects output currents of different gears by controlling the current mirror ratio of the current output stage.
2. A LIN automatic addressing adjustment system according to claim 1, characterized in that: The sampling, amplifying and trimming module includes a sampling, amplifying module, a computing module and a second storage medium. The two input ends of the sampling, amplifying module are connected to the two ends of the shunt resistor Rshunt. The sampling, amplifying module collects and amplifies the voltage signal of the shunt resistor Rshunt. The sampling, amplifying module modifies the amplification factor according to the amplification factor trimming code Trimming_Code_PGA. The amplification factor trimming code Trimming_Code_PGA is stored in the second storage medium. The output end of the sampling, amplifying module is connected to the input end of the computing module.
3. A LIN automatic addressing adjustment system according to claim 2, characterized in that: The sampling and amplification module includes a first-level sampling and amplification and a PGA. The first-level sampling and amplification performs a first-level amplification on the voltage signal collected on the shunt resistor Rshunt, and then performs a second-level amplification through the PGA. The PGA is connected to the amplification factor trimming code Trimming_Code_PGA, and the amplification factor trimming code Trimming_Code_PGA modifies the amplification factor of the PGA.
4. A LIN automatic addressing adjustment system according to claim 2, characterized in that: The operation module is an ADC, the output end of the PGA is connected to the input end of the ADC, and the ADC quantizes the amplified voltage signal output by the PGA.
5. A LIN automatic addressing adjustment method, based on the LIN automatic addressing adjustment system according to any one of claims 1 to 4, characterized in that The following steps are involved: The gain of the first-stage sampling amplifier is Gain1, the output signal of the first-stage sampling amplifier is VPGA1, the gain of the PGA is Gain2, and the output signal of the PGA is VPF2; VPGA2=VPGA1 Gain2=Vcom+Ishunt Rshunt Gain1 Gain2 (1) Wherein, Vcom is the common mode value; S1. First, disconnect the LIN_IN pull-up inside the chip through the processor, and connect LIN_OUT to the measuring resistor Rtest; S2, the chip starts working. When the addressing module is disabled, the offset current I0 flowing through the measurement Rtest is recorded, and the initial output code ADCcode0 of the ADC is recorded; VPGA2=Vcom+I0 Rshunt Gain1 Gain2 (2) (3); Where N is the number of quantization bits of the ADC; S3, turn on the chip addressing module enable switch, the current generating module starts to generate current, and the measurement current I1 flowing through the measurement resistor Rtest at this time is recorded; S4, addressing injection current is I1-I0; S5. Execute the algorithm model based on the graph approximation method of the current trimming code Trimming_Code_DAC; first construct a first relationship graph between the current and the current trimming code Trimming_Code_DAC, compare the current addressing injection current value with the accuracy requirement, observe the corresponding position on the first relationship graph, mark the deviation between the actual current value and the target accuracy requirement, and intuitively display the gap; based on the first relationship graph, identify the direction of reducing the deviation, and gradually adjust the value of the current trimming code Trimming_Code_DAC; after each adjustment, re-measure the current and update the corresponding point on the first relationship graph; repeat the above process, observe the position change of the point on the relationship graph after each adjustment, until the current measurement value and the accuracy requirement tend to coincide on the first relationship graph; set a convergence threshold, when after several consecutive iterations, the deviation between the current measurement value and the accuracy requirement on the first relationship graph is less than the convergence threshold or the value change of the current trimming code Trimming_Code_DAC is less than 1, it is determined that the requirement is met; record the value of the current trimming code Trimming_Code_DAC at the last iteration as the target value of the current trimming code Trimming_Code_DAC; S6. The current trimming code Trimming_Code_DAC is first configured as the target value, and the first current Ishunt1 flowing through the measurement Rtest is recorded at this time, and the first output code ADCcode1 of the ADC is recorded at this time, and the gain Gain2 of the PGA is calculated according to the formula; (4) (5) (6) (7) Among them, ADCcode diff is the difference between the first output code ADCcode1 of the ADC and the initial output code ADCcode0 of the ADC; is the measured calculated value, is the ideal value, Calculated value for ADC output code measurement, is the ideal value of ADC output code; S7, execute the algorithm model based on the graph approximation method of the amplification factor trimming code Trimming_Code_PGA; first construct a second relationship graph between the gain Gain2 of PGA and the amplification factor trimming code Trimming_Code_PGA; compare the current test value with the accuracy requirement, and observe the position of the corresponding point on the second relationship graph; mark the deviation between the actual test value and the target accuracy requirement, and intuitively display the gap; based on the second relationship graph, identify the direction of reducing the deviation, and gradually adjust the value of the amplification factor trimming code Trimming_Code_PGA; after each adjustment, re-measure and Update the corresponding points on the second relationship chart; repeat the above process, observe the position change of the points on the second relationship chart after each adjustment, until the measured value and the accuracy requirement tend to coincide on the second relationship chart; set a convergence threshold, when after several consecutive iterations, when the deviation between the measured value and the accuracy requirement on the second relationship chart is less than the convergence threshold or the value change of the magnification trimming code Trimming_Code_PGA is less than 1, it is determined that the requirement is met; record the value of the magnification trimming code Trimming_Code_PGA at the last iteration as the target value of the trimming code Trimming_Code_PGA; S8. Finally, the target current trimming code Trimming_Code_DAC and the target gain trimming code Trimming_Code_PGA are obtained, the trimming components are burned, and the trimming codes are solidified.
Citation Information
Patent Citations
LIN (Local Interconnect Network) bus automatic addressing system and slave equipment with anti-reverse connection protection
CN116915542A
