Amplitude control and system structure diagram of digital audio signal source of microcontroller 8051F

Publisher:jingyanLatest update time:2024-02-28 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


Reference address:Amplitude control and system structure diagram of digital audio signal source of microcontroller 8051F

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

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号