Design of digital potentiometer based on single chip microcomputer

Publisher:MysticMoonLatest update time:2010-11-19 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The human ear's subjective perception of sound intensity follows Weber's Law. When the volume is low, the human ear is sensitive to changes in the amplitude of sound waves. When the sound reaches a certain loudness, the human ear's hearing characteristics begin to become dull. The resistance value of the exponential potentiometer changes slowly at first and then quickly. If this attenuation characteristic is used in volume adjustment, it can just offset the logarithmic characteristics of the human ear's perception of volume and ensure the smoothness of the subjective hearing experience.

Compared with the traditional mechanical volume potentiometer, the resistance adjustment of the digital potentiometer (DCP) is controlled by the internal CMOS switch, so it has a long service life, high reliability and no mechanical noise; if the cheap general-purpose linear digital potentiometer is directly used for volume adjustment, a slight adjustment of the potentiometer at a low volume will cause the output sound pressure to increase sharply, and the accurate positioning of the volume within a large dynamic range cannot be guaranteed. Therefore, there are not many examples of using digital potentiometers in mature power amplifier products. In fact, if a low-resolution linear digital potentiometer is combined with a general-purpose embedded system, a low-cost, high-resolution exponential potentiometer for volume control can be obtained.

Overall design plan

In the expansion system of digital potentiometers, the main control unit can use common 8-bit or 16-bit mature microcontrollers. Here we mainly expand Intersil's low-resolution linear digital potentiometers X9313 and X9312. The actual resolution that the system can eventually achieve is 31×99=3069 levels; if all 32-tap X9313s are replaced with X9312s, the resolution can be further increased to 9801 levels.

Both X9313 and X9312 DCPs are non-volatile digital potentiometers with three-wire interfaces and power-off automatic saving functions. They contain resistor arrays consisting of 31 and 99 resistor units respectively. The two adjacent resistor units and the ends of the resistor array are equipped with taps that can be accessed by the sliding unit, as shown in Figure 1. The position of the sliding unit is controlled by the three input terminals CS, U/D and INC. The tap position value can be stored in the non-volatile memory for calling and setting at the next power-on.


Figure 1 Internal structure of X931x series DCP

The volume control of each channel of the system is composed of two X9313 and one X9312. Figure 2 is the functional connection diagram of the three digital potentiometers. The U/D and INC terminals of all DCPs are connected together, and the chip select terminal CS occupies one MCU port each. This hardware connection method can easily realize the volume control of four channels or even more channels. In order to be consistent with the common digital volume adjustment habits, it is best not to retain the three-button control method of the general DCP, but only set the UP/DOWN buttons to directly control the increase and decrease of the volume. The connection between the UP/DOWN button and the MCU should set a software delay de-jitter algorithm to eliminate the jitter during key input, and the key jitter is no longer considered between the MCU and the DCP.


Figure 2 System connection diagram

Resolution Scaling

Ra and Rb are connected in parallel at both ends of the input signal Vin, and the number of taps is 32. The outputs of Ra and Rb are used to set the voltages VH and VL of the Rc port. Ra is always one position higher than Rb, so that 31 types of input signal voltage changes from 1/32Vi to 31/32Vi can be added to both ends of Rc. Since Rc uses a 100-tap DCP, 31×(100-1)=3069 levels of Vin linear voltage values ​​can be obtained at the output end of Rc.

As the Rc sliding end moves up and down, the positions of Ra and Rb are also adjusted accordingly under the control of the MCU. During the upward movement, the value obtained by adding the upward movement value of the Rc sliding end and the current position value is set to M. If M is less than 100, it means that only the sliding end of Rc moves at this time, and the sliding contact positions of Ra and Rb remain unchanged; if the M value exceeds 100, the contacts of Ra and Rb both move up by 1 sliding position, and the sliding end of Rc returns to the contact position determined by the actual value obtained by subtracting 100 from M. Similarly, during the downward movement of the tap, if the sliding end of Rc needs to move down below tap 0, the sliding ends of Ra and Rb also need to move down by 1 position synchronously to maintain the balance of the actual adjustment steps of the potentiometer.

A first-stage voltage follower is set at the tap output end of the potentiometer Rc, which can reduce the impact of the load parallel connection on the voltage division coefficient after cascading. The sliding process of the potentiometer contact belongs to an incoherent step adjustment method, so the resistance value of Rc does not change continuously but has the desired output only after the sliding end is adjusted in place, which will cause some small jumps in the output voltage. However, since the absolute increment of the input signal Vin is not large, and the resolution of the entire potentiometer expansion system is very high, we can connect a small capacitor C1 of 1000~2200pF in parallel to the ground at the sliding output end of the Rc potentiometer to reduce the fluctuation of the output voltage.

The above-mentioned idea of ​​expanding the resolution of the potentiometer is highly feasible and portable. It has been previously applied in a system design of a programmable gain high-speed amplifier and achieved good results.

Resistance Indexation

The indexation of DCP is implemented by software, without the need for additional hardware. Since the function operation function of general-purpose microcontrollers is very limited, the number of contact movement steps required for each level of potentiometer switching is saved in the ROM of the microcontroller in the form of an array in the algorithm. When adjusting the resistance value, the MCU obtains the actual offset of each DCP by table lookup according to the UP/DOWN state of the button and the current level value, and then controls the DCP to perform the corresponding step switching action. Considering the actual resolution of 3069 levels, the system sets a total of 24 levels of step levels from zero to full-scale output, which is better than the 18-21 step levels of the mainstream mechanical stepping potentiometers on the market. The specific relationship between the level and the potentiometer tap offset can be seen in Table 1. It is not difficult to see from the table that the system expands the DCP to the high resolution of 3069 just to adapt to the precise analysis of the step value of the potentiometer resistance during the indexation adjustment process.

Table 1 Relationship between order and potentiometer tap offset


X9312 and X9313 cannot directly read the current position of the sliding end from the on-chip storage unit. Therefore, in order to memorize the actual position of the sliding contact of each digital potentiometer, variables must be set in the program to memorize the contact positions of different potentiometers.

Conclusion

The high-resolution exponential digital potentiometer solution realizes the application of general-purpose linear digital potentiometers in audio systems at a relatively low cost, and has good engineering application prospects and promotion value. In addition, since the exponential high-resolution expansion of DCP only occupies a small amount of system resources, the remaining port resources of the MCU can be used in functional links such as volume status indication and infrared signal decoding to improve system functions.

Reference address:Design of digital potentiometer based on single chip microcomputer

Previous article:Design of a certain type of rudder system detection equipment based on PXI bus
Next article:Application of P1 port of new microcontroller AduC812

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号