# AC to DC working principle

AC/DC conversion is the conversion of analog V (eg V = 5V) to digital D (eg D = 255). There are many types of analog/digital (AC/DC) conversions, such as count comparison types, successive approximation types, double integral types, and the like. The successive approximation type is often used in integrated circuit devices, and the basic working principle of AC conversion DC is briefly introduced. The figure shows the structure of the successive approximation. The AC/DC converter is based on a DC/AC converter, plus a comparator, successive approximation register, set logic and clock. The conversion principle is as follows.

Under the control of the enable signal, the first selection logic is set to give the highest position of the successive approximation register “1”. After converting the DC/AC to an analog quantity, it is compared with the input analog quantity, and the voltage comparator gives the comparison result. If the input quantity is greater than or equal to the output of the D / A conversion, the comparator is 1, otherwise 0, the setting logic is modified according to the result of the comparator output to modify the contents of the successive approximation register, so it passes the analog quantity after D The /A transform continuously approximates the input analog quantity. The number of digital changes after several modifications is the amount of AC/DC conversion results.

Most currents approximate AC/DC use a binary search method, which first compares the 1/2 value of the maximum allowable voltage range with the input voltage value, ie up to “1”, and the remaining bits are “0”. If the search value is within this range, a value of 1/2 of the range is taken, that is, the second highest position is “1”. If the search value is not within this range, another 1/2 range of the maximum allowable input voltage value of the search value is sequentially executed, that is, the highest bit is “0”, and the search range is narrowed down. The range is 1/2 each time. An n-bit AC/DC conversion can be obtained by n comparisons. The successive approximation method has a faster conversion speed, so the integrated AC/DC chip mostly adopts the above method.

As can be seen from the figure, the AC/DC conversion needs to perform external start control signals and is divided into two types: pulse start and level start. Chips that use pulse-on-chip include ADC0804, ADC0809, and ADC1210. The chips that use level-on are ADC570, ADC571, ADC572, and so on. This start signal is provided by the CPU. When the AC/DC converter is activated, after n comparisons by the binary search method, the contents of the successive approximation register are the converted digital quantities. Therefore, after the AC/DC conversion is completed, the digital quantity must be taken from the successive approximation register.

To this end, the DC/AC chip specifically sets the conversion end signal pin, sends a conversion end signal to the CPU, notifies the CPU to read the converted digital quantity, and the CPU can detect the AC/DC conversion end signal or the inquiry mode by interrupt, and from A. The digital register is taken from the data register of the /D chip (ie, the successive approximation register in Figure 10-9).