Audio analog signal circuits often need to adjust the level within a wide range, and the adjustment range of high-precision circuits can reach more than 100 dB. It is equivalent to 18 bits of binary linear numbers, and also requires a higher adjustment step value. Use a digital signal source to directly change the amplitude, generally with a resolution of only a few dB. Many audio attenuators on the market have specific attenuation, attenuation step values, and characteristic impedance. However, in practical applications, audio attenuators are required to have different parameters; and in some applications, it is also hoped that the attenuation can be designed as needed and can be adjusted at any time. In response to these needs, an audio control system based on a single-chip microcomputer consisting of a resistor attenuator and an analog switch is introduced. This system can set the attenuation of the audio signal through the microcontroller and the host PC, and control the increase or decrease of the attenuation. This system has the characteristics of wide application, easy use and high portability.
Overall system design
The structure of the audio control system based on 805lF330 is shown in Figure 1. It is mainly composed of 8051F330 microcontroller, attenuator module, control module and other parts. The microcontroller sends a control signal to the control module in an interrupt mode, and the attenuator attenuation is changed through the control module to generate an audio signal with the required attenuation. The attenuator module is used to attenuate audio signals and is designed using a resistor attenuator network; the analog switch CD4053 is used to control the amount of attenuation. The host PC controls the attenuation of the attenuator module through the 8051F330 microcontroller to achieve the purpose of controlling the attenuation of the audio signal.
2.1 Audio attenuator module
The signal attenuator is a type of passive network used in the transmission system to reduce the signal level so that it does not produce significant distortion. It is used to decouple the signal source, adjust the transmission level of the circuit, or buffer the impedance. transformation effects to improve impedance matching. Attenuators have been widely used in radio test instruments, instruments, transmission lines, standard attenuators and postal and telecommunications, communications, signal carriers, radio and television, computer and other systems. The working frequency can reach VHF (very high frequency) and is suitable for audio signal attenuation. The attenuator structure can be divided into T, H, π, L, and O types according to the resistor arrangement. The most commonly used ones are T type and π type. The attenuator structure is shown in Figure 2.
In Figure 2, zin and Zout are the input and output impedances of the attenuator respectively. In practical applications, the resistor value is calculated based on the input and output impedances of the attenuator and the required attenuation.
2.2 Control module design
The attenuation circuit control module is shown in Figure 3. Several groups of T-shaped networks form the basic unit of the attenuator, and the attenuation amount can be calculated and combined as needed; a switch circuit is used to switch several groups of basic units, and its control is transmitted by the digital control part. implemented in binary code. If control A1 is turned on, it means that the R1 part is short-circuited, and the total attenuation is R2+R3; similarly, if control B1 is turned on, it means that the R2 part is short-circuited, and the total attenuation is Rl+R3.
The switch circuit in the control module uses three sets of two-way analog switches CD4053, and its pin configuration is shown in Figure 4. In the figure, VDD and VEE are the power supply terminals. VDD should be kept > VEE, and VCD-VEE can work normally if it is equal to 5 V, 10 V or 15 V; VSS is the ground terminal; INH is the enable terminal, active low; A. B and C are control bits; XO, Xl, Y0, Yl, ZO and Z1 are input terminals; X, Y and Z are output terminals. When INH=O, the logical relationship between each pin is as shown in Table 1.
2.3 Audio signal source
C8051F330 microcontroller has a built-in 10-bit current digital/analog converter, which can convert digital signals into analog current. The output current is determined by the IDAC data register. The audio signal is generated using the DDS wavemaking method, or read and stored in memory in advance. The audio signal in the audio signal can also use other audio signal sources, which will not be described here. Since the C8051F330 outputs a current signal, a resistor R4 needs to be connected between the output terminal and ground to obtain the voltage signal.
3 An example of a high-precision audio control system based on a single-chip microcomputer
is shown in Figure 5. Seven-level T-shaped resistor attenuators from R1 to R7 are connected in series to form a basic audio attenuator path. A set of digital control switches are used to switch several groups of basic units to access the audio. The path may be short-circuited, changing the control quantity. Three sets of two-way analog switches CD4053 are selected as digital control switches to switch the attenuators at each level to connect to the audio path or to be short-circuited to change the control amount.
Taking R7 as an example, when the pin A of U5 CD413153 is high level, the X pin is controlled to simulate connecting the X1 pin, the control nodes h and g are disconnected, and R7 is connected to the audio path to produce corresponding attenuation; the A pin of U5 CD4053 When the pin is low level, the X pin is simulated to connect the X0 pin, nodes h and g are short-circuited, and the audio signal does not pass through the R7 attenuator. In order to save the I/O port of the microcontroller, an 8-bit serial input and parallel output shift register 74HCl64 is used to output control signals to CD4053 to achieve centralized multi-channel output. The microcontroller outputs QG~QA control signals to 74LSl64. Each bit corresponds to a first-level attenuator. If a certain level of attenuator needs to be connected, the corresponding position is 1; if there is no need to connect to an attenuator of this level, the corresponding position is 0.
The application uses a 7-level attenuator and sets the attenuation values: R1=1 dB, R2=2 dB, R3=4 dB, R4=8 dB, R5=16 dB, R6=32 dB, R7=40 dB, then it can be satisfied O~103 dB, attenuation requirement with step value l. If you want to produce 83 dB attenuation, choose to connect Rl, R2, R4, R6, and R7. Correspondingly, nodes c and d in the circuit are short-circuited, and the C pin of U3 CD4053 should be low level, that is, QE=O. Nodes e and f are short-circuited, and the B pin of U4 CD4053 should be low level, that is, QC=0. The corresponding control signals are: 0G~QA=llOl01l. If you want to produce an attenuation of 29 dB, choose to connect Rl, R3, R4, and R5. The attenuation value is 29 dB, and the corresponding control signal is QG~QA=1011100. By analogy, the control signal corresponding to each 1 dB value in the range of 0~103 dB can be written as an array, which can be stored in C8051F330 in advance, and can be read out by looking up the table during use.
If larger attenuation values are required, more stages of attenuators can be used. In software design, interrupts can be used. After the control signal is completely output, the main signal path is connected to avoid unnecessary noise and program runaway.
The attenuation amount of the attenuator required by the actual circuit design and the impedance matching of the front and rear stages are often different. The attenuators on the market only have fixed attenuation value, attenuation step value and matching impedance. Using a combined attenuator network, in actual application, according to the design needs, independently design the required attenuator series and attenuation value combinations, and flexibly calculate the attenuator resistance value, which has extremely high flexibility and portability; greatly reduces It reduces design costs and has extremely high practical value.
Previous article:Design of stereo signal phase difference level difference tester by using C8051F020 microcontroller
Next article:Design of program-controlled three-phase AC power source based on C8051F016 microcontroller and power amplifier
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [Last 9 hours] Prize activity: Show off your favorite electronic products
- MicroPython common IO port simulates SPI communication, which may be used when porting to some boards
- Three-coordinate programming
- ADI reference design geber file import ad problem
- Beijing's well-known 5G chip developer is recruiting: digital front-end engineer (RISCv or CPU digital front-end direction)
- Bike modification series: solar energy and batteries
- 【AT-START-F403A Review】Part 3 F403A STOP Mode Current Test
- [Free book 100% gift] A book teaches you how to develop test systems and gain an in-depth understanding of data acquisition systems
- 【DIY Creative LED】Circuit Analysis
- Participate in the PI energy-saving test, contribute the power of engineers, and protect the earth together!