Analog-to-digital converter
By working together with the discharge component, the integration component, and the comparison component, efficient and stable data transmission between the ADC and the main control chip is achieved, solving the problems of communication methods occupying bus resources and bus paralysis, and improving the reliability and conversion efficiency of the system.
Patent Information
- Application Number
- CN202520275556.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2035-02-20
AI Technical Summary
The existing communication methods between the ADC and the main control chip have problems such as occupying the main control chip's bus resources and being susceptible to bus paralysis due to slave station anomalies. There is a lack of efficient, stable and reliable data transmission solutions.
The system employs a discharge component, an integrator component, and a comparator component working together. It controls signals and transmits data to the analog-to-digital converter through two I/O ports of the main controller, avoiding the occupation of the main control chip's bus resources. The discharge component precisely controls the charging and discharging process of the integrating capacitor, while the comparator component quickly outputs a signal related to the magnitude of the analog signal.
It achieves rapid sampling and conversion of analog signals, reduces the risk of communication failure, improves the reliability and stability of the system, avoids bus paralysis problems, and features simple circuitry, low component cost, and reliable independent operation.
Smart Images

Figure CN223772036U_ABST
Abstract
Description
Technical Field
[0001] This utility model relates to the field of analog-to-digital conversion technology, and in particular to an analog-to-digital converter. Background Technology
[0002] In modern electronic systems, analog-to-digital conversion (ADC) is a crucial process for converting analog signals into digital signals, widely used in various fields such as signal processing, automatic control, and data acquisition. The ADC conversion chip, as a core component in this process, is responsible for accurately and efficiently converting analog signals into digital signals for further processing by the microcontroller unit (MCU) or other digital processing units, such as... Figure 1 As shown.
[0003] The choice of communication method is crucial in the data exchange process between the ADC and the main control microcontroller. Currently, there are four main common communication methods between the ADC and the main control chip:
[0004] ① Parallel communication: uses multiple data lines to transmit data simultaneously, resulting in fast transmission speed, but occupies more pins;
[0005] ②SPI (Serial Peripheral Interface) communication: It uses a high-speed, full-duplex, synchronous communication method, communicating through 4 wires (MOSI / MISO / SCK / SS), with relatively few wires (pin usage);
[0006] ③I2C communication: It uses a half-duplex, multi-master synchronous communication method, occupying 2 lines (SDA / SCL). It uses fewer pins and has strong scalability, but the communication speed is slow;
[0007] ④UART (Universal Asynchronous Receiver / Transmitter) communication: It uses an asynchronous communication method, employs two lines (TX / RX), has simple wiring, but is relatively slow.
[0008] The four communication methods between the ADC and the main control chip mentioned above each have their advantages and disadvantages. However, in practical applications, they all suffer from problems such as consuming the main control chip's bus resources and being susceptible to bus failure due to slave station anomalies. Therefore, developing a more efficient, stable, and reliable communication method to optimize the data transmission process between the ADC and the main control chip has significant practical importance and application value. Utility Model Content
[0009] To address the aforementioned issues, the present invention aims to provide an analog-to-digital converter (ADC) that achieves rapid sampling and conversion of analog signals through the coordinated operation of a discharge component, an integration component, and a comparison component. The ADC utilizes two I / O ports of the main controller for simple signal control and data transmission, thus avoiding the problems of consuming main controller chip bus resources and bus failure due to slave station malfunctions.
[0010] This utility model is achieved through the following technical solution:
[0011] An analog-to-digital converter (ADC) is used to transmit acquired analog signals to a main controller, the main controller having a first I / O port and a second I / O port, comprising:
[0012] A discharge assembly is connected to the first I / O port of the main controller and is used to be turned on or off under the control of the output signal of the first I / O port.
[0013] An integrating component includes an integrator and an integrating capacitor connected in parallel between the output terminal and the inverting input terminal of the integrator; the non-inverting input terminal of the integrator is connected to the acquired analog signal, and the inverting input terminal of the integrator is grounded through an input resistor; the two electrodes of the discharge component are connected in parallel across the integrating capacitor.
[0014] The comparator has an integrator whose output is connected to its input, another input to which a reference voltage is connected, and an output connected to the second I / O port of the main controller.
[0015] The main controller obtains the magnitude of the acquired analog signal based on the output signal of the comparison component.
[0016] Furthermore, the discharge assembly includes a switching transistor and a pull-up resistor connected to the control terminal of the switching transistor. The other end of the pull-up resistor is connected to the power supply. The common terminal of the switching transistor and the pull-up resistor is connected to the first I / O port of the main controller. The two terminals of the switching transistor are respectively connected to the two ends of the integrating capacitor.
[0017] Furthermore, a current-limiting resistor is connected in series between the non-inverting input terminal and the analog signal input terminal of the integrator.
[0018] Furthermore, a diode is connected in series at the output of the integrator, and the cathode of the diode is connected to the common terminal of the integrating capacitor and the comparator.
[0019] Furthermore, the comparison component includes a comparator, the inverting input of which is connected to the output of the integrator, the non-inverting input of which is connected to a reference voltage source, and the output of which is connected to the second I / O port of the main controller.
[0020] Furthermore, an input current-limiting resistor is connected in series between the inverting input terminal of the comparator and the reference voltage input terminal, and / or an output current-limiting resistor is connected in series between the output terminal of the comparator and the main controller.
[0021] Furthermore, the switching transistor is an NPN transistor, the base of the switching transistor is connected to the pull-up resistor, and the emitter of the switching transistor is connected to the inverting input terminal of the comparator.
[0022] Furthermore, the first I / O port outputs a square wave signal.
[0023] Compared with the prior art, the technical solution of this utility model and its beneficial effects are as follows:
[0024] (1) In this analog-to-digital converter, the discharge component is turned on or off under the control of the first I / O port of the main controller. The non-inverting input of the integrator is connected to the acquired analog signal, and the inverting input of the integrator is grounded through an input resistor. The two electrodes of the discharge component are connected in parallel across the integrating capacitor to precisely control the charging and discharging process of the integrating capacitor. The output of the integrator is connected to the input of the comparator, the other input of the comparator is connected to a reference voltage, and the output of the comparator is connected to the second I / O port of the main controller. The comparator quickly outputs a signal related to the magnitude of the analog signal to the main controller. Simple signal control and data transmission are performed between the main controller and the analog-to-digital converter through the two I / O ports of the main controller, avoiding the problems of occupying the main control chip bus resources and bus paralysis due to slave station abnormalities, greatly reducing the risk of communication failure and improving the reliability of the system.
[0025] (2) The combination of the switching transistor and the pull-up resistor in this invention can precisely control the on and off states of the discharge component. The pull-up resistor ensures that the switching transistor is in the off state when it is not controlled, avoiding false triggering and improving the reliability of the system. At the same time, the two terminals of the switching transistor are respectively connected to the two ends of the integrating capacitor, which can quickly discharge the integrating capacitor and ensure the accuracy of the integration process.
[0026] (3) The analog-to-digital converter of this utility model can accurately and quickly convert and transmit the acquired analog signals. The circuit is simple, the component cost is low, the program is simple and there is no need to consider the timing of communication. It can be operated independently as a small module and is stable and reliable. Attached Figure Description
[0027] Figure 1 This is a connection diagram between an existing analog-to-digital converter and an MCU provided in this embodiment of the utility model;
[0028] Figure 2 This is a circuit schematic diagram of an analog-to-digital converter provided in an embodiment of this utility model;
[0029] Figure 3 These are waveform diagrams of the input voltage, reference voltage, integrator output waveform, and comparator output waveform provided in this embodiment of the utility model. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this utility model clearer, the technical solutions of the embodiments of this utility model will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this utility model, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain this utility model and are not intended to limit this utility model. Based on the embodiments of this utility model, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this utility model.
[0031] See Figure 2 An analog-to-digital converter (ADC) is disclosed for transmitting acquired analog signals to a main controller (MCU). The MCU has a first I / O port and a second I / O port. The ADC includes a discharge component, an integrator component, and a comparator component. The discharge component is connected to the first I / O port of the MCU and is used to turn on or off under the control of the output signal of the first I / O port. The integrator component includes an integrator A1 and an integrating capacitor C1 connected in parallel between the output terminal and the inverting input terminal of the integrator A1. The non-inverting input terminal of the integrator A1 is connected to the acquired analog signal Ui, and the inverting input terminal of the integrator A1 is grounded through an input resistor R2. The two electrodes of the discharge component are connected in parallel across the integrating capacitor C1. The charging or discharging of the integrating capacitor C1 is achieved by turning the discharge component on or off.
[0032] The output of integrator A1 is connected to the input of the comparator, the other input of the comparator is connected to a reference voltage Vref, and the output of the comparator is connected to the second I / O port of the main controller MCU. The main controller obtains the magnitude of the acquired analog signal based on the output signal of the comparator.
[0033] Through the coordinated operation of the discharge component, integrator component, and comparator component, rapid sampling and conversion of analog signals are achieved. The integrator and integrating capacitor are designed to quickly integrate analog signals, while the comparator component can quickly output a signal related to the magnitude of the analog signal, thereby improving the overall conversion efficiency of the analog-to-digital converter (ADC). The discharge component, controlled by the first I / O port of the main controller, can precisely control the discharge process of the integrating capacitor, avoiding overcharging or over-discharging and ensuring the stability of the integration process. Simultaneously, the comparator component, by comparing the reference voltage with the integrator output, can accurately output a stable signal, further improving the stability of the ADC. Since it does not rely on traditional parallel or serial communication methods, it avoids the problems of occupying main control chip bus resources and bus paralysis due to slave station malfunctions. Simple signal control and data transmission between the main controller and the ADC via two I / O ports significantly reduces the risk of communication failures and improves system reliability.
[0034] In this embodiment, a current-limiting resistor R1 is connected in series between the non-inverting input terminal of comparator A1 and the analog signal input terminal Ui. This limits the magnitude of the input current and prevents damage to the comparator due to excessive input signal. This improves the system's anti-interference capability and reliability, and avoids system failures caused by abnormal external signals.
[0035] Continue reading Figure 2 The discharge assembly includes a switching transistor Q1 and a pull-up resistor R3 connected to the control terminal of the switching transistor Q1. The other end of the pull-up resistor R3 is connected to the power supply Vcc. The common terminal of the switching transistor Q1 and the pull-up resistor R3 is connected to the first I / O port of the controller MCU. The two terminals of the switching transistor Q1 are respectively connected to the two ends of the integrating capacitor C1. In this embodiment, the switching transistor Q1 is an NPN transistor. The base of the switching transistor Q1 is connected to the pull-up resistor R3, the emitter of the switching transistor Q1 is connected to the inverting input terminal of the integrator A1 (i.e., one end of the integrating capacitor C1), and the collector of the switching transistor Q1 is connected to the output terminal of the integrator A1 (i.e., the other end of the integrating capacitor C1). When the first I / O port outputs a low level, the switching transistor Q1 is off, and the integrating capacitor C1 is in a charging state; when the first I / O port outputs a high level, the switching transistor Q1 is on, and the integrating capacitor C1 is in a discharging state. The combination of the switching transistor Q1 and the pull-up resistor R3 can precisely control the on and off states of the discharge assembly. Pull-up resistor R3 ensures that switch Q1 is in the off state when not controlled, avoiding false triggering and improving system reliability. Meanwhile, the two terminals of switch Q1 are connected to the two ends of the integrating capacitor, enabling rapid discharge of the integrating capacitor and ensuring the accuracy of the integration process.
[0036] The first I / O port outputs a square wave signal. The square wave signal has a clear high and low level and a stable period, which can ensure that the discharge process of the integrating capacitor C1 is carried out in a predetermined time, thereby improving the conversion accuracy of the analog-to-digital converter.
[0037] In this embodiment, a diode D1 is connected in series at the output terminal of integrator A1. The cathode of diode D1 is connected to the common terminal of integrating capacitor C1 and comparator component. This ensures that integrating capacitor C1 has only one charging direction, thereby guaranteeing the unidirectionality and stability of the integration process. Simultaneously, the unidirectional conduction characteristic of diode D1 also prevents external interference signals from entering the integrating circuit through the output terminal of integrator A1, further improving the system's anti-interference capability.
[0038] The comparison component includes comparator A2. The inverting input of comparator A2 is connected to the output of integrator A1, and the non-inverting input of comparator A2 is connected to a reference voltage Vref. The output of comparator A2 is connected to the second I / O port of the main controller MCU. Comparator A2 accurately compares the signal at the integrator output with the reference voltage. The comparator's circuit structure is relatively simple, easy to implement and debug. This simple circuit structure improves system reliability and reduces the failure rate.
[0039] An input current-limiting resistor R4 is connected in series between the inverting input terminal and the reference voltage input terminal of comparator A2 to limit the current input to comparator A2 and prevent damage to the comparator due to abnormal input signals. An output current-limiting resistor R5 is also connected in series between the output terminal of comparator A2 and the main controller MCU to protect the IO port of the main controller and prevent damage to the main controller MCU due to excessive output signals.
[0040] This embodiment provides the relationship between the output signal of the first IO port, the acquired analog signal Ui, and the received signal of the second IO port when using the analog-to-digital converter of this invention.
[0041] For an in-phase integrating operational amplifier, the relationship between its output voltage Uo and input voltage Ui is based on integration.
[0042] Vout=1 / (RC)*∫Vin*dt
[0043] Vout is the output voltage, i.e. Figure 2 In this context, Uo and Vin represent the input and output voltages, i.e. Figure 2 In this context, Ui; R represents the input resistance, i.e. Figure 2 R2; C is the integrating capacitor, i.e. Figure 2 In C1; t represents time.
[0044] Then the calculation formula is transformed.
[0045] ∫Vin*dt=RC*Vout;
[0046] When the input remains constant, ∫Vin*dt=Vin*t, and the above expression is transformed into:
[0047] Vin*t=RC*Vout, from which we can deduce:
[0048] Vin = RC * Vout / t;
[0049] Depend on Figure 3 It's easy to see that the first I / O port P1.0 outputs a regular square wave. When the Ui input is low, the integrator output waveform has a small slope. After comparison with the reference voltage Vref, the waveform of the signal received by the second I / O port P1.1 of the main controller has a larger period T01. When the Ui input is high, the integrator output waveform has a large slope. After comparison with the reference voltage Vref, the waveform of the signal received by the second I / O port P1.1 of the main controller has a smaller period T00.
[0050] The analog-to-digital converter of this invention can accurately and quickly convert and transmit the acquired analog signals. It has a simple circuit, low component cost, and simple program that does not require consideration of communication timing issues. It can be operated independently as a small module and is stable and reliable in operation.
[0051] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the present invention through the foregoing teachings or related technical or knowledge. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. An analog-to-digital converter for transmitting acquired analog signals to a main controller, the main controller having a first I / O port and a second I / O port, characterized in that, The application relates to a signal acquisition circuit, which comprises the following components: a discharge component connected with a first IO port of a master controller and used for conducting or cutting off under the control of a signal outputted by the first IO port; an integration component comprising an integrator and an integration capacitor connected in parallel between the output end of the integrator and the inverting input end; the non-inverting input end of the integrator is connected with a collected analog signal, and the inverting input end of the integrator is connected with the ground through an input resistor; two electrodes of the discharge component are connected in parallel across the integration capacitor; a comparison component, the output end of the integrator is connected with the input end of the comparison component, the other input end of the comparison component is connected with a reference voltage, and the output end of the comparison component is connected with the second IO port of the master controller; wherein the master controller obtains the size of the collected analog signal according to the output signal of the comparison component. The discharge component comprises a switch tube, a pull-up resistor connected with the control end of the switch tube, the other end of the pull-up resistor is connected with a power supply, the common end of the switch tube and the pull-up resistor is connected with the first IO port of the master controller, and the two electrode ends of the switch tube are respectively connected with the two ends of the integration capacitor. A current-limiting resistor is further connected in series between the non-inverting input end of the integrator and the analog signal input end. A diode is further connected in series with the output end of the integrator, and the cathode of the diode is connected with the common end of the integration capacitor and the comparison component. The comparison component comprises a comparator, the inverting input end of the comparator is connected with the output end of the integrator, the non-inverting input end of the comparator is connected with a reference voltage source, and the output end of the comparator is connected with the second IO port of the master controller.
2. An analog-to-digital converter according to claim 1, characterized in that An input current-limiting resistor is further connected in series between the inverting input end of the comparator and the reference voltage input end, and / or an output current-limiting resistor is further connected in series between the output end of the comparator and the master controller.
3. An analog-to-digital converter according to claim 1, characterized in that The switch tube is an NPN triode, the base of the switch tube is connected with the pull-up resistor, and the emitter of the switch tube is connected with the inverting input end of the comparator.
4. An analog-to-digital converter according to claim 1, characterized in that The first IO port outputs a square wave signal.
5. An analog-to-digital converter according to claim 1, wherein 6. An analog-to-digital converter according to claim 5, characterized in that 7. An analog-to-digital converter according to claim 2, wherein 8. An analog-to-digital converter according to claim 1, wherein