Test system and method for ADC and DAC integrated in MCU

By integrating the test system of DSP, digital-to-analog conversion module and analog-to-digital conversion module on the MCU chip, the problem of the MCU on-chip DAC and ADC testing relying on external devices is solved, and an efficient and accurate test process is achieved, reducing cost and time Consumption.

CN118631253BActive Publication Date: 2024-12-27HUNAN ADVANCECHIP ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411089183.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-27
Estimated Expiration
2044-08-09

AI Technical Summary

Technical Problem

Existing MCU on-chip DAC and ADC testing methods rely on a large number of external devices, and the degree of automation is low, resulting in inefficient testing, high cost and inaccurate results.

Method used

Design a test system including main control DSP, digital-to-analog conversion module, analog-to-digital conversion module and MCU to be tested. Through the analog-to-digital conversion module and digital-to-analog conversion module, the on-chip DAC and ADC are tested, and the external The dependence of instruments improves the degree of test automation.

Benefits of technology

It significantly improves the efficiency and accuracy of ADC and DAC tests, reduces the cost and time consumption during the test process, and improves the reliability and consistency of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118631253B_ABST
    Figure CN118631253B_ABST
Patent Text Reader

Abstract

The present invention discloses a test system and method for MCU on-chip integrated ADC and DAC, the system includes a main control DSP, a digital-to-analog conversion module, an analog-to-digital conversion module and an MCU to be tested, the analog-to-digital conversion module is used to test the on-chip DAC of the MCU to be tested; the digital-to-analog conversion module is used to test the on-chip ADC of the MCU to be tested; the main control DSP is responsible for interacting with the analog-to-digital conversion module and the digital-to-analog conversion module, including controlling the digital-to-analog conversion module and the analog-to-digital conversion module to start conversion, calculating the test data converted by the analog-to-digital conversion module and the digital-to-analog conversion module to obtain the desired test results, and controlling the timing of the overall test module. The present invention significantly improves the efficiency and accuracy of ADC and DAC testing by optimizing the test process, integrating key test components and reducing the dependence on external devices, while significantly reducing the cost and time consumption in the test process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of MCU testing, and in particular discloses a testing system and method suitable for ADC and DAC integrated in a MCU chip. Background Art

[0002] With the continuous advancement and innovation of science and technology, the demand for MCU in various fields has also greatly increased. In order to meet the growing market demand, improve the testing efficiency of MCU, ensure the quality and reliability of MCU, develop and improve testing methods, and design more advanced testing technologies have become urgent needs of the industry.

[0003] At present, various industries have higher and higher requirements for product quality and performance, and the accuracy, repeatability and efficiency of test methods have become important factors affecting product competitiveness. In view of the limitations of traditional test methods, R&D personnel urgently need to introduce advanced technical means and algorithms to improve the intelligence of test methods, shorten product testing cycles, reduce costs, and ultimately improve product quality. Therefore, improving test methods has important significance and market demand in the current market environment.

[0004] Currently, there are a series of challenges and limitations in the process of testing the on-chip DAC and ADC of microcontroller units (MCUs). These tests usually require a large number of external instruments and equipment, such as power supplies, signal generators, voltage or current meters, and complex interface circuits, to measure the performance parameters of the MCU.

[0005] The current test solution is too dependent on external equipment and has a low degree of automation, resulting in low test efficiency. Each test requires a lot of time to set up and debug the equipment, which undoubtedly prolongs the product development cycle and increases R&D costs. At the same time, the intervention of manual operation also increases the possibility of errors in the test process and reduces the reliability of the test results.

[0006] Therefore, in order to improve test efficiency, reduce costs, and enhance the accuracy and consistency of test results, the industry urgently needs a more automated and integrated MCU on-chip ADC and DAC test solution. Such a solution should be able to simplify the configuration of test equipment, reduce dependence on external instruments, achieve fast and consistent test processes through automated software, and provide easy-to-interpret test results, which will help shorten product development cycles, improve product quality, and ultimately accelerate the innovation and application of MCU technology. Summary of the invention

[0007] The present invention provides a testing system and method suitable for ADC and DAC integrated in an MCU chip, aiming to solve at least one of the above-mentioned technical problems.

[0008] One aspect of the present invention relates to a test system suitable for integrating ADC and DAC in an MCU chip, comprising a main control DSP, a digital-to-analog conversion module, an analog-to-digital conversion module and an MCU to be tested, wherein:

[0009] The MCU under test is the module under test;

[0010] The analog-to-digital conversion module is connected to the MCU to be tested and is used to test the on-chip DAC of the MCU to be tested;

[0011] The digital-to-analog conversion module is connected to the MCU to be tested and is used to test the on-chip ADC of the MCU to be tested;

[0012] The main control DSP is connected to the MCU to be tested, the analog-to-digital conversion module and the digital-to-analog conversion module respectively, and is responsible for interacting with the analog-to-digital conversion module and the digital-to-analog conversion module, including controlling the digital-to-analog conversion module and the analog-to-digital conversion module to start conversion, calculating the test data converted by the analog-to-digital conversion module and the digital-to-analog conversion module to obtain the desired test results, and controlling the timing of the overall test module.

[0013] Furthermore, the test system suitable for ADC and DAC integrated in the MCU chip also includes a PC, which is connected to the main control DSP and is responsible for receiving and saving the test data transmitted by the main control DSP.

[0014] Furthermore, the test system suitable for ADC and DAC integrated in the MCU chip also includes a filtering module, which is connected to the MCU to be tested and is responsible for filtering the DAC in the chip of the MCU to be tested.

[0015] Furthermore, the test system suitable for ADC and DAC integrated in the MCU chip also includes a power supply system, which is respectively connected to the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested, and is used to provide power to the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested.

[0016] Furthermore, the MCU includes an MCU chip, which serves as a main control DSP and an MCU to be tested in a digital-to-analog test board, and communicates with a digital-to-analog conversion module and an analog-to-digital conversion module respectively through two SPIs.

[0017] Furthermore, the MCU includes an on-chip ADC and an on-chip DAC.

[0018] The analog-to-digital conversion module is connected to the on-chip DAC to obtain parameters such as integral nonlinear error, differential nonlinear error, gain error and offset error of the on-chip DAC;

[0019] The digital-to-analog conversion module is connected to the on-chip ADC and is used to obtain parameters such as integral nonlinear error, differential nonlinear error, gain error and offset error of the on-chip ADC.

[0020] Further, the analog-to-digital conversion module includes an analog-to-digital conversion chip, the 49th pin of the analog-to-digital conversion chip is connected to the 6th pin of the MCU chip, the 51st pin of the analog-to-digital conversion chip is connected to the 7th pin of the MCU chip, the 53rd pin of the analog-to-digital conversion chip is connected to the 9th pin of the MCU chip, the 55th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 57th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 59th pin of the analog-to-digital conversion chip is connected to the 40th pin of the MCU chip, the 61st pin of the analog-to-digital conversion chip is connected to the 23rd pin of the MCU chip, and the 63rd pin of the analog-to-digital conversion chip is connected to the 22nd pin of the MCU chip; the 24th pin of the analog-to-digital conversion chip is connected to the 54th pin of the MCU chip, and the 25th pin of the analog-to-digital conversion chip is connected to the 76th pin of the MCU chip.

[0021] Furthermore, the digital-to-analog conversion module includes a first digital-to-analog conversion chip and a second digital-to-analog conversion chip, the thirteenth pin of the first digital-to-analog conversion chip is connected to the ninety-fifth pin of the MCU chip, the eighth pin of the first digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the first digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the first digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip; the thirteenth pin of the second digital-to-analog conversion chip is connected to the ninety-fourth pin of the MCU chip, the eighth pin of the second digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the second digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the second digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip.

[0022] Another aspect of the present invention relates to a test method for ADC and DAC integrated in an MCU chip, which is applied to the above-mentioned test system for ADC and DAC integrated in an MCU chip, and comprises the following steps:

[0023] Initialize the system;

[0024] The main control DSP develops output voltage instructions to the digital-to-analog conversion module;

[0025] Determine whether the digital-to-analog conversion module outputs normal voltage according to the instruction;

[0026] If the voltage output is normal, the on-chip ADC of the MCU to be tested samples the voltage;

[0027] The sampling results are sent to the main control DSP for storage;

[0028] Determine whether the test is complete;

[0029] If it is recognized that the test is completed, the main control DSP calculates the test data;

[0030] The master DSP sends the test results and test data to the PC for storage.

[0031] Another aspect of the present invention relates to a test method for ADC and DAC integrated in an MCU chip, which is applied to the above-mentioned test system for ADC and DAC integrated in an MCU chip, and comprises the following steps:

[0032] Initialize the system;

[0033] The DAC output voltage of the MCU under test controls the chip;

[0034] Determine whether the voltage output is normal;

[0035] If the voltage output is normal, the main control DSP sends a start sampling instruction to the analog-to-digital conversion module;

[0036] Determine whether the analog-to-digital conversion module starts sampling;

[0037] Send the sampling results to the main control DSP for storage;

[0038] Determine whether the test is complete;

[0039] If it is recognized that the test is completed, the main control DSP calculates the test data;

[0040] The master DSP sends the test results and test data to the PC for storage.

[0041] The beneficial effects achieved by the present invention are:

[0042] The present invention provides a test system and method for ADC and DAC integrated in MCU chip, the system includes a main control DSP, a digital-to-analog conversion module, an analog-to-digital conversion module and an MCU to be tested, the analog-to-digital conversion module is used to test the DAC on the chip of the MCU to be tested; the digital-to-analog conversion module is used to test the ADC on the chip of the MCU to be tested; the main control DSP is responsible for interacting with the analog-to-digital conversion module and the digital-to-analog conversion module, including controlling the digital-to-analog conversion module and the analog-to-digital conversion module to start conversion, calculating the test data converted by the analog-to-digital conversion module and the digital-to-analog conversion module to obtain the desired test results, and controlling the timing of the overall test module. The present invention provides a test system and method for ADC and DAC integrated in MCU chip, and the beneficial effects achieved are:

[0043] 1. By optimizing the test process, integrating key test components and reducing the dependence on external equipment, the efficiency and accuracy of ADC and DAC testing can be significantly improved, while the cost and time consumption in the test process can be greatly reduced.

[0044] 2. In the digital-analog test board, each module includes power supply, main control, digital-analog conversion, analog-to-digital conversion, filtering, and the MCU to be tested. The power supply system provides a stable power supply for the entire system to ensure the reliability of the test. The main control DSP is responsible for coordinating the entire test process and controlling the transmission and processing of data. The digital-analog conversion module and the analog-to-digital conversion module are responsible for the conversion between analog signals and digital signals, respectively, so that the MCU can process analog input or output. The MCU to be tested is the MCU part that actually performs performance evaluation. By integrating the main control and the MCU to be tested on the same MCU, not only space and cost are saved, but also the system integration and test flexibility are improved.

[0045] 3. For the test of analog voltage output, the MCU uses the main control DSP to guide the analog-to-digital conversion module to perform accurate voltage sampling, and then transmits the sampling results back to the main control DSP for analysis. The main control DSP can further process the data or directly transmit it to the PC for storage and subsequent analysis. This method is suitable for efficient testing of multiple parameters such as DAC INL, DNL, ​​gain error and offset error. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 The present invention is a functional block diagram of a test system for integrating ADC and DAC in an MCU chip;

[0047] FIG2 is a circuit diagram of an MCU in a test system for integrating ADC and DAC in an MCU chip according to the present invention, wherein FIG2(a) is an MCU chip, FIG2(b) is a capacitor connected to its power supply port, FIG2(c) is a passive crystal oscillator circuit for providing a clock to the MCU; FIG2(d) is an MCU reset circuit, and FIG2(e) is a JTAG circuit for burning a program. The various parts in FIG2 constitute a minimum system of the MCU;

[0048] FIG3 is a circuit diagram of an analog-to-digital conversion module in a test system for integrating ADC and DAC in an MCU chip according to the present invention, wherein FIG3 (a) is an analog-to-digital conversion chip, and FIG3 (b) is a capacitor connected to its power supply port;

[0049] FIG4 is a circuit diagram of a digital-to-analog conversion module in a test system for integrating ADC and DAC in an MCU chip according to the present invention, wherein FIG4(a) is a digital-to-analog conversion chip, and FIG4(b) is a capacitor connected to its power supply port;

[0050] FIG5 is a circuit diagram of a filter module in a test system for integrating ADC and DAC in an MCU chip according to the present invention, wherein FIG5(a) is a filter capacitor connected to a digital-to-analog conversion port, and FIG5(b) is a filter capacitor connected to an analog-to-digital conversion port;

[0051] FIG6 is a circuit diagram of a power supply module in a test system for integrating ADC and DAC in an MCU chip according to the present invention, wherein FIG6 (a) is a 5V power supply circuit diagram, FIG6 (b) is a 3.3V power supply circuit diagram, and FIG6 (c) is a 1.2V power supply circuit diagram;

[0052] Figure 7 It is a flow chart of a first embodiment of a test method applicable to ADC and DAC integrated in an MCU chip of the present invention;

[0053] Figure 8 It is a flow chart of a second embodiment of the test method applicable to ADC and DAC integrated in MCU chip of the present invention;

[0054] Fig. 9 The present invention is a schematic diagram of the DNL data of the on-chip ADC in the MCU measured by the digital-to-analog conversion module in the digital-to-analog test board, wherein the abscissa represents the sampling value of the ADC, and the ordinate represents the DNL (LSB) of the ADC under the sampling value;

[0055] Fig.10 The present invention uses the digital-to-analog conversion module in the digital-to-analog test board to measure the INL data of the on-chip ADC in the MCU, wherein the abscissa represents the sampling value of the ADC, and the ordinate represents the INL (LSB) of the ADC under the sampling value;

[0056] Fig.11 The present invention is a schematic diagram of the DNL data of the on-chip DAC in the MCU measured by the analog-to-digital conversion module in the digital-to-analog test board, wherein the abscissa represents the sampling value of the DAC, and the ordinate represents the DNL (LSB) of the DAC under the sampling value;

[0057] Fig.12 The figure is a schematic diagram of the INL data of the on-chip DAC in the MCU measured by the analog-to-digital conversion module in the digital-to-analog test board of the present invention, wherein the horizontal axis represents the sampling value of the DAC, and the vertical axis represents the INL (LSB) of the DAC under the sampling value. DETAILED DESCRIPTION

[0058] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0059] like Figure 1As shown, the first embodiment of the present invention proposes a test system suitable for MCU chip integrated ADC, DAC, applied to the digital-analog test board, including a main control DSP, a digital-analog conversion module, an analog-to-digital conversion module and a MCU to be tested, wherein the MCU to be tested is a module to be tested; the analog-to-digital conversion module is connected to the MCU to be tested, and is used to test the DAC on the chip of the MCU to be tested; the digital-to-analog conversion module is connected to the MCU to be tested, and is used to test the ADC on the chip of the MCU to be tested; the main control DSP is connected to the MCU to be tested, the analog-to-digital conversion module and the digital-to-analog conversion module respectively, and is responsible for interacting with the analog-to-digital conversion module and the digital-to-analog conversion module, including controlling the digital-to-analog conversion module and the analog-to-digital conversion module to start conversion, calculating the test data converted by the analog-to-digital conversion module and the digital-to-analog conversion module to obtain the desired test results, and controlling the timing of the overall test module. In this embodiment, the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested can all adopt existing functional modules. The main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested can be centrally arranged in the digital-to-analog test board.

[0060] Further, see Figure 1 As shown in Figure 6, the test system for MCU integrated ADC and DAC in this embodiment also includes a PC, a filtering module and a power supply system. The PC is connected to the main control DSP and is responsible for receiving and saving the test data transmitted by the main control DSP. The filtering module is connected to the MCU to be tested and is responsible for filtering the DAC in the chip of the MCU to be tested. The power supply system is respectively connected to the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested, and is used to provide power to the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested. The main control DSP and the MCU to be tested are integrated into one MCU. While the MCU interacts with the analog-to-digital conversion module and the digital-to-analog conversion module as the main control DSP, the analog-to-digital conversion module and the digital-to-analog conversion module respectively, the analog-to-digital conversion module and the digital-to-analog conversion module are controlled to test the analog part of the MCU. The test system for MCU integrated ADC and DAC in this embodiment, the power supply system provides a stable power supply for the entire system to ensure the reliability of the test. The main control DSP is responsible for coordinating the entire test process and controlling the transmission and processing of data. The digital-to-analog conversion module and the analog-to-digital conversion module are responsible for the conversion between analog signals and digital signals, respectively, so that the MCU can process analog input or output. The MCU under test is the MCU part that actually performs performance evaluation. By integrating the main control and the MCU under test on the same MCU, not only space and cost are saved, but also the system integration and test flexibility are improved.

[0061] Preferably, see Figure 1As shown in Figure 6, the test system for ADC and DAC integrated in the MCU chip proposed in this embodiment includes an MCU chip U2, and the model of the MCU chip U2 is AVP32F0049. The MCU chip serves as the main control DSP and the MCU to be tested in the digital-analog test board, and communicates with the digital-to-analog conversion module and the analog-to-digital conversion module through two SPIs (Serial Peripheral Interfaces) respectively. Specifically, the MCU includes an on-chip ADC and an on-chip DAC, and the analog-to-digital conversion module is connected to the on-chip DAC to obtain the integral nonlinear error, differential nonlinear error, gain error, and offset error of the on-chip DAC; the digital-to-analog conversion module is connected to the on-chip ADC to obtain the integral nonlinear error, differential nonlinear error, gain error, and offset error of the on-chip ADC. The test system for ADC and DAC integrated in the MCU chip proposed in this embodiment includes an analog-to-digital conversion module including an analog-to-digital conversion chip U1, and the model of the analog-to-digital conversion chip U1 is AD7606BSTZ. The 49th pin of the analog-to-digital conversion chip is connected to the 6th pin of the MCU chip, the 51st pin of the analog-to-digital conversion chip is connected to the 7th pin of the MCU chip, the 53rd pin of the analog-to-digital conversion chip is connected to the 9th pin of the MCU chip, the 55th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 57th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 59th pin of the analog-to-digital conversion chip is connected to the 40th pin of the MCU chip, the 61st pin of the analog-to-digital conversion chip is connected to the 23rd pin of the MCU chip, the 63rd pin of the analog-to-digital conversion chip is connected to the 22nd pin of the MCU chip; the 24th pin of the analog-to-digital conversion chip is connected to the 54th pin of the MCU chip, and the 25th pin of the analog-to-digital conversion chip is connected to the 76th pin of the MCU chip. The digital-to-analog conversion module includes a first digital-to-analog conversion chip U5 and a second digital-to-analog conversion chip U7, and the first digital-to-analog conversion chip U5 and the second digital-to-analog conversion chip U7 are both AD5686RARUZ. The thirteenth pin of the first digital-to-analog conversion chip is connected to the ninety-fifth pin of the MCU chip, the eighth pin of the first digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the first digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the first digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip; the thirteenth pin of the second digital-to-analog conversion chip is connected to the ninety-fourth pin of the MCU chip, the eighth pin of the second digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the second digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the second digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip.The test system for ADC and DAC integrated in the MCU chip proposed in this embodiment, when executing the test requiring external analog voltage input, the MCU sends instructions to the digital-to-analog conversion module through the built-in main control DSP. The high-performance AD5686RARUZ chip is used as the digital-to-analog converter, and its SPI communication interface is used to receive the instructions from the MCU, and accurate voltage output is generated in the specified channel according to these instructions.

[0062] The test system for ADC and DAC integrated in MCU chip proposed in this embodiment, when testing the ADC in the MCU chip to be tested, the main control DSP sends instructions to the digital-to-analog conversion module. The high-performance AD5686RARUZ chip is used as a digital-to-analog converter, and its SPI communication interface is used to receive instructions from the main control DSP, and accurate voltage output is generated in the specified channel according to these instructions. These output voltages are applied to the ADC module sampling port of the MCU to be tested so that the voltage can be sampled. By recording the sampled values ​​of the ADC and the SPI transmission code, the parameters such as INL, DNL, ​​offset error of the ADC are calculated. This automated test method eliminates the time consumption and possible human errors in traditional tests, and improves the efficiency of the test process and the accuracy of the results.

[0063] For the test of the DAC on the MCU to be tested, the analog-to-digital conversion module uses the high-precision AD7606BSTZ. The DAC module on the MCU to be tested generates the corresponding voltage, which is applied to the sampling port of the analog-to-digital conversion module. The main control DSP sends instructions to the analog-to-digital conversion module to make it perform accurate voltage sampling, and then the sampling results are sent back to the main control DSP for analysis. The main control DSP can further process the data or directly transmit it to the PC for storage and subsequent analysis. This method is suitable for efficient testing of multiple parameters such as DAC INL, DNL, ​​gain error and offset error.

[0064] Further, see Figure 7 , Figure 7 The present invention is a flow chart of a first embodiment of a test method for an ADC and a DAC integrated in an MCU chip. In this embodiment, the test method for an ADC and a DAC integrated in an MCU chip is applied to the above-mentioned test system for an ADC and a DAC integrated in an MCU chip, and includes the following steps:

[0065] Step S11, initializing the system.

[0066] Step S12: The main control DSP generates an output voltage instruction to the digital-to-analog conversion module.

[0067] Step S13: determine whether the digital-to-analog conversion module outputs a normal voltage according to the instruction.

[0068] Step S14: If the voltage output is normal, the on-chip ADC of the MCU to be tested samples the voltage.

[0069] Step S15: The sampling result is sent to the main control DSP for storage.

[0070] Step S16: Determine whether the test is completed.

[0071] Step S17: If it is recognized that the test is completed, the main control DSP calculates the test data.

[0072] Step S18: The master control DSP sends the test results and test data to the PC for storage.

[0073] The test method for ADC and DAC integrated in the MCU chip proposed in this embodiment can be sampled multiple times according to the requirements of the simulation test project. In the case of multiple sampling, the results of multiple sampling are averaged to obtain the final sampled value; the MCU and the digital-to-analog conversion module are controlled by sending instructions through the communication protocol. Commonly used communication protocols include SPI, I 2 C, etc.; the output voltage value of the digital-to-analog conversion is related to the resolution and maximum output voltage of the digital-to-analog conversion chip; the test results can be sent to a PC (Personal Computer) through a communication protocol for storage.

[0074] Preferably, see Figure 8 , Figure 8 The flowchart of the second embodiment of the test method for ADC and DAC integrated in MCU chip of the present invention is shown in FIG. 1 . In the present embodiment, the test method for ADC and DAC integrated in MCU chip is applied to the test system for ADC and DAC integrated in MCU chip, and includes the following steps:

[0075] Step S21, initialize the system.

[0076] Step S22: The MCU to be tested controls the on-chip DAC to output voltage.

[0077] Step S23: determine whether the voltage output is normal.

[0078] Step S24: If the voltage output is normal, the main control DSP sends a start sampling instruction to the analog-to-digital conversion module.

[0079] Step S25: determine whether the analog-to-digital conversion module starts sampling.

[0080] Step S26: Send the sampling result to the main control DSP for storage.

[0081] Step S27: Determine whether the test is completed.

[0082] Step S28: If it is recognized that the test is completed, the main control DSP calculates the test data.

[0083] Step S29: The master control DSP sends the test results and test data to the PC for storage.

[0084] The test method for ADC and DAC integrated in the MCU chip proposed in this embodiment can be sampled multiple times according to the requirements of the simulation test project. In the case of multiple sampling, the results of multiple sampling are averaged to obtain the final sampled value; the MCU and the digital-to-analog conversion module are controlled by sending instructions through the communication protocol. Commonly used communication protocols include SPI, I 2 C, etc.; the output voltage value of the digital-to-analog conversion is related to the resolution and maximum output voltage of the digital-to-analog conversion chip; the test results can be sent to a PC (Personal Computer) through a communication protocol for storage.

[0085] like Figures 1 to 12 As shown, the test system and method for ADC and DAC integrated in MCU provided in this embodiment have the following working principles:

[0086] Taking AVP32F0049 as an example, the digital-analog test board is shown in Figure 2: the chip used for the digital-analog conversion module is AD5686RARUZ; the analog-to-digital conversion chip is AD7606BSTZ.

[0087] The AVP32F0049 chip is used as the master DSP and the MCU to be tested in this board. The AVP32F0049 can communicate with the digital-to-analog conversion chip AD5686RARUZ and the analog-to-digital conversion chip AD7606BSTZ through two SPIs, that is, the AVP32F0049 can interact with the digital-to-analog conversion chip and the analog-to-digital conversion chip as the master DSP. At the same time, the analog modules such as the ADC module and DAC module in the AVP32F0049 can be tested through the analog-to-digital conversion module and the digital-to-analog conversion module. Therefore, in this board, the master DSP and the MCU to be tested are the same MCU.

[0088] The analog-to-digital conversion chip AD7606BSTZ can sample the signals input from V1 to V8, and the sampling results can be sent to AVP32F0049 via ports DOUTA and DOUTB through the SPI protocol. Taking the INL (Integral nonlinearity) / DNL (Differential nonlinearity) test of the on-chip DAC as an example, the DAC in the AVP32F0049 is 12 bits, and the DAC values ​​can be configured to be 0 to 4095 respectively. The DAC will output the corresponding voltage. Each time the voltage is output, the AD7606BSTZ is configured to perform 128 samples and send the 128 sampling results to the AVP32F0049, and the AVP32F0049 takes the average value. The 4096 AD7606BSTZ sampling values ​​and the DAC values ​​input by the AVP32F0049 are calculated accordingly to obtain the INL / DNL of the DAC.

[0089] The digital-to-analog conversion chip AD5686RARUZ can receive the corresponding code through SPI, convert it into the corresponding voltage and output it through the VOUTA~VOUTD pins. Taking the ADC INL / DNL test as an example, the ADC of AVP32F0049 can be configured as a 3.3V reference mode. AVP32F0049 sends the code corresponding to 0~3.3V to AD5686RARUZ through SPI, so that AD5686RARUZ outputs the corresponding voltage. For each output voltage, the ADC of AVP32F0049 will sample it, and the average value of 128 samples can be obtained to obtain the value corresponding to the output voltage of AD5686RARUZ. The INL / DNL of the ADC can be obtained by calculating these two values ​​accordingly.

[0090] The filter module filters the signal through resistors / capacitors.

[0091] The power supply system supplies power to AVP32F0049, AD5686RARUZ, and AD7606BSTZ through 5V to 3.3V LDO and 5V to 1.2V LDO respectively.

[0092] Embodiment 1: Now use this board card digital-to-analog conversion module to measure the INL / DNL data of ADC as follows: Fig. 9 and Fig.10 As shown:

[0093] The range of DNL is within ±0.5LSB; the range of INL is within ±2LSB. The measured data is within the specified range.

[0094] Embodiment 2

[0095] The analog-to-digital conversion module of the above board is used to test the INL / DNL of the DAC module of AVP32F0049C. The test data is as follows: Fig.11 and Fig.12 As shown:

[0096] The range of DNL is within ±0.4LSB; the range of INL is within ±1.5LSB. The measured data is within the specified range.

[0097] The test system and method for ADC and DAC integrated in MCU provided by the present invention simplifies the simulation test process of MCU, reduces the dependence on expensive external test equipment, and realizes a highly automated test process. This not only lowers the threshold related to MCU testing, but also provides MCU manufacturers and users with a fast, economical and more accurate test solution.

[0098] Although preferred embodiments of the present invention have been described, additional changes and modifications may be made to these embodiments by those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A test system suitable for ADC and DAC integrated in MCU chip, characterized in that: It includes a main control DSP, a digital-to-analog conversion module, an analog-to-digital conversion module and an MCU to be tested, wherein the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested are centrally arranged in a digital-to-analog test board, wherein: The MCU to be tested is the module to be tested; The analog-to-digital conversion module is connected to the MCU to be tested, and is used to test the on-chip DAC of the MCU to be tested; The digital-to-analog conversion module is connected to the MCU to be tested, and is used to test the on-chip ADC of the MCU to be tested; The main control DSP is connected to the MCU to be tested, the analog-to-digital conversion module and the digital-to-analog conversion module respectively, and is responsible for interacting with the analog-to-digital conversion module and the digital-to-analog conversion module, including controlling the digital-to-analog conversion module and the analog-to-digital conversion module to start conversion, calculating the test data converted by the analog-to-digital conversion module and the digital-to-analog conversion module to obtain the test result, and controlling the timing of the overall test module; The test system suitable for integrating ADC and DAC in MCU chip also includes a PC, which is connected to the main control DSP and is responsible for receiving and saving the test data transmitted by the main control DSP; The MCU includes an MCU chip, which serves as a master DSP and an MCU to be tested in a digital-analog test board, and communicates with the digital-analog conversion module and the analog-to-digital conversion module respectively through two SPIs; The MCU includes an on-chip ADC and an on-chip DAC. The analog-to-digital conversion module is connected to the on-chip DAC and is used to obtain the integral nonlinearity error, differential nonlinearity error, gain error and offset error of the on-chip DAC; The digital-to-analog conversion module is connected to the on-chip ADC and is used to obtain the integral nonlinear error, differential nonlinear error, gain error and offset error of the on-chip ADC.

2. The test system for ADC and DAC integrated in MCU chip as claimed in claim 1, characterized in that: The test system suitable for ADC and DAC integrated in MCU chip also includes a filtering module, which is connected to the MCU to be tested and is responsible for filtering the DAC in the chip of the MCU to be tested.

3. The test system for ADC and DAC integrated in MCU chip as claimed in claim 2, characterized in that: The test system suitable for MCU chip-integrated ADC and DAC also includes a power supply system, which is respectively connected to the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested, and is used to provide power for the main control DSP, the digital-to-analog conversion module, the analog-to-digital conversion module and the MCU to be tested.

4. The test system for ADC and DAC integrated in MCU chip as claimed in claim 1, characterized in that: The analog-to-digital conversion module includes an analog-to-digital conversion chip, the 49th pin of the analog-to-digital conversion chip is connected to the 6th pin of the MCU chip, the 51st pin of the analog-to-digital conversion chip is connected to the 7th pin of the MCU chip, the 53rd pin of the analog-to-digital conversion chip is connected to the 9th pin of the MCU chip, the 55th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 57th pin of the analog-to-digital conversion chip is connected to the 36th pin of the MCU chip, the 59th pin of the analog-to-digital conversion chip is connected to the 40th pin of the MCU chip, the 61st pin of the analog-to-digital conversion chip is connected to the 23rd pin of the MCU chip, and the 63rd pin of the analog-to-digital conversion chip is connected to the 22nd pin of the MCU chip; the 24th pin of the analog-to-digital conversion chip is connected to the 54th pin of the MCU chip, and the 25th pin of the analog-to-digital conversion chip is connected to the 76th pin of the MCU chip.

5. The test system for ADC and DAC integrated in MCU chip as claimed in claim 4, characterized in that: The digital-to-analog conversion module includes a first digital-to-analog conversion chip and a second digital-to-analog conversion chip, the thirteenth pin of the first digital-to-analog conversion chip is connected to the ninety-fifth pin of the MCU chip, the eighth pin of the first digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the first digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the first digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip; the thirteenth pin of the second digital-to-analog conversion chip is connected to the ninety-fourth pin of the MCU chip, the eighth pin of the second digital-to-analog conversion chip is connected to the ninety-seventh pin of the MCU chip, the fourteenth pin of the second digital-to-analog conversion chip is connected to the ninety-eighth pin of the MCU chip, and the twelfth pin of the second digital-to-analog conversion chip is connected to the ninety-sixth pin of the MCU chip.

6. A test method for ADC and DAC integrated in MCU, applied to the test system for ADC and DAC integrated in MCU as claimed in any one of claims 1 to 5, characterized in that: The following steps are involved: Initialize the system; The main control DSP sends the output voltage instruction to the digital-to-analog conversion module; Determining whether the digital-to-analog conversion module outputs a normal voltage according to the instruction; If the voltage output is normal, the on-chip ADC of the MCU to be tested samples the voltage; The sampling results are sent to the master control DSP for storage; Determine whether the test is complete; If it is recognized that the test is completed, the master control DSP calculates the test data; The master control DSP sends the test results and test data to the PC for storage.

7. A test method for ADC and DAC integrated in MCU, applied to the test system for ADC and DAC integrated in MCU as claimed in any one of claims 1 to 5, characterized in that: The following steps are involved: Initialize the system; The DAC output voltage of the MCU under test controls the chip; Determine whether the voltage output is normal; If the voltage output is normal, the main control DSP sends a start sampling instruction to the analog-to-digital conversion module; Determine whether the analog-to-digital conversion module starts sampling; The sampling results are sent to the master control DSP for storage; Determine whether the test is complete; If it is recognized that the test is completed, the master control DSP calculates the test data; The master control DSP sends the test results and test data to the PC for storage.