Using MAXQ3210 in audio attenuator circuits

Abstract: This application note describes a system that can automatically implement a stereo audio attenuator. The MAXQ3210 low-power 16-bit RISC microcontroller is a system controller. It generates various timing intervals, drives the audio signal to gradually decay, and ends in a silent state. Use DS1801 level 65, audio taps, dual digital potentiometer to produce attenuation. The MAX1467 dual, single-supply operational amplifier provides signal buffering. The firmware source code can be downloaded from the Maxim website.

Introduction Many entertainment devices can stop working automatically without human intervention. For example, modern wireless devices and home TVs can be turned off at a certain time or within a preset period, and these applications are already common. This function facilitates the implementation of "sleep" mode, when people fall asleep, the device automatically shuts down.

However, not all entertainment devices have such features; synthetic stereo systems generally do not provide such features. In this case, an external device is needed to increase the sleep mode function. Simply turning off the power to such systems is not enough. This will suddenly end the audio and go to mute. A better approach is to let the audio level fall for a relatively long period of time, and the audio gradually stops in an almost imperceptible way. The low-cost device described in this application note can achieve this function.

The device can be inserted into the audio stream of a synthesized stereo system, between the audio source and the final power amplifier. The device requires a linear level signal input and output, so it can be placed anywhere in the system where the signal level is present. When powering up, the device passes through the audio signal without any attenuation, and maintains this state until its "Start" button is pressed. This action initiates an initial time delay, allowing the device to maintain this "full output" state for a preset countdown interval. After the countdown interval, the device begins to increase the audio attenuation smoothly and gradually until the signal is completely muted.

System hardware system hardware schematic diagram shown in Figure 1. It can be seen that the system has only a few active components: MAXQ3210 RISC microcontroller, DS1801 dual audio tap potentiometer, and MAX4167 dual single-supply operational amplifier. The following describes each component and its function in the system.

The MAXQ3210 microcontroller MAXQ3210 controls the system. The MAXQ3210 is a 16-bit RISC machine with a maximum clock rate of 3.58MHz. Since almost every instruction is executed in 1 clock cycle, the performance of the processor is close to 1 million instructions per megahertz. As a result, the peak processor performance reached 3.558 million instructions per second (MIPS). The MAXQ3210 contains 1K 16-bit EEPROM for program storage, 128-word EEPROM and 64-byte SRAM for data storage. The EEPROM memory is configured to program in the system using the device's built-in boot loader, or in the application program through user-supplied code. The microcontroller also contains a 9V to 5V voltage regulator, a piezoelectric speaker driver, and 15 general-purpose I / O (GPIO) pins.

The MAXQ3212, another version of the MAXQ3210 processor, is the same as it except that it does not contain a piezoelectric speaker driver and a 9V to 5V regulator. Since no speaker driver and voltage regulator are required, the MAXQ3212 is also a good choice for this application. MAXQ3212 is a lower cost solution.

In the end, this application chose MAXQ3210 for prototype development to increase system flexibility and facilitate future updates.

Figure 1. System schematic
Figure 1. System schematic

The MAXQ3210 also contains an I / O pin that can directly drive an LED. This application uses the direct LED drive function to flash the LED at different rates to indicate the system status. The system status indication section below will introduce this function in detail.

The DS1801 digital potentiometer Maxim offers multiple options on the digital potentiometer. This application chose the DS1801 for several reasons. The device contains two audio tap digital potentiometers, each with 65 independent contact positions. Positions 0 to 63 indicate the attenuation level (ie, attenuation from 0dB to -63dB). Position 64 is a special "silent" position that provides attenuation greater than -90dB.

Each potentiometer uses an 8-bit shift register to maintain the contact position setting, as shown in Table 1. Among these 8 bits, the lower 6 bits indicate that the contact position of the potentiometer is between 0 and 63. When set to 1, the 7th bit is forced to mute regardless of other bits. The 8th bit of each shift register is "not important" and has no effect on the setting of the potentiometer. When setting the contact position of each potentiometer or all potentiometers, all 16 bits must be moved into these registers. The arrangement of the shift register and its bit definition are shown in Table 1.

Table 1. DS1801 Digital Potentiometer Register
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Don't Care Mute Pot 1 Value MSB Pot 1 Value Pot 1 Value Pot 1 Value Pot 1 Value Pot 1 Value LSB Don't Care Mute Pot 0 Value MSB Pot 0 Value Pot 0 Value Pot 0 Value Pot 0 Value Pot 0 Value LSB

The reason why the DS1801 is selected is because it reduces the noise caused by a large change in the position of the potentiometer contact. The device contains a "zero crossing detector", only when the signal across the potentiometer is zero or 50ms timeout, the contact can change position. By limiting the contact movement to the point where the signal is zero, the sudden change in amplitude caused by contact displacement is eliminated. After the new contact position is written for 50ms, if the DS1801 does not detect a zero crossing, then the contact will change position regardless of the state of the input signal. As shown in the schematic diagram of Figure 1, the connection mode of the digital potentiometer makes the two ends of the potentiometer have equal DC bias. In this way, the AC signal that appears can pass 0V even on the DC bias of half the supply voltage. Therefore, the zero-crossing detector of the digital potentiometer achieves its working purpose. The active low ZCEN pin of the DS1801 is limited to a low level to enable the zero-crossing detector circuit.

Finally, another reason for choosing the DS1801 is that it has a control interface, a 3-wire serial interface. Designed for CPU-controlled applications, this interface supports the potentiometer's contact position to be written into the two 8-bit registers described above. The three pins of the microcontroller GPIO are configured as outputs to implement this interface. The DS1801 3-wire interface contains 3 inputs: active low level RST, CLK and D. The active low RST signal is used to enable the 3-wire serial port write operation. CLK is the clock and provides the data transfer synchronization signal. The D signal is data and realizes the communication of the position of the potentiometer contact set in the device. With its 15 GPIO pins, the MAXQ3210 easily supports this 3-wire interface.

MAX4167 operational amplifier MAX4167 is a dual version of the MAX4166 operational amplifier. It is a single-supply (+ 2.7V to + 6.5V) device that provides full-scale input and output. In this application, it is powered by a 5.0V power supply. It has a typical gain-bandwidth product of 5MHz and a typical slew rate of 2V / µs.

The MAX4167 provides signal buffering for audio signals. In the configuration shown, the device provides unity gain and can be used as a simple buffer.

Linear-level audio signals are AC-coupled with the system to input and output to eliminate the DC bias voltage caused by the single power supply of audio signals.

The system software uses the MAXQ® integrated development environment, namely the MAX-IDE and MAXQ3210 evaluation (EV) kit, to develop and test the software for this application. The MAX-IDE contains all the tools needed to develop various microprocessor codes, including the MAXQ3210. It supports the development of assembly language code using the engineering interface. The project can be compiled, downloaded, and executed line by line for the target device. When using the MAXQ3210 evaluation kit, you can check the system status by viewing its memory contents, call stack items, values ​​in all registers, and all variable values ​​accessible in the source code. You can also set breakpoints in the source code to pause execution at a preset position. MAX-IDE is a free development tool that can be downloaded from the Maxim website.

The software is simple and clear. The application code is in a main assembly language program Attenuator.asm, which contains the initialization function, the main program loop, several subroutines, and an interrupt service routine. All source code can be downloaded (ZIP, 8kB). This .ZIP file contains the MAX-IDE project file, all necessary "include files", and source code files. The .HEX file of the application is also provided, which can be loaded into the MAXQ3210 evaluation board or user target board and executed.

Potentiometer control The main function of this software is to control the DS1801 digital potentiometer. At power-up, the potentiometer is set to a non-decay state. After user input (for example, pressing a button), after a corresponding countdown delay, the software starts to step the potentiometer's contacts until it reaches its fully mute position.

The actual position of the potentiometer contact is controlled by two subroutines; Output_Bytes and Clk_Bytes. The Output_Bytes subroutine collects single-byte values ​​and stores them in two potentiometer contact position registers; tests whether they are available; and sends them to the Clk_Bytes subroutine in sequence. The Clk_Bytes subroutine provides the required low-level port pin processing and bit serialization functions, and gates the contact position data of the potentiometer. When writing software, if you choose another potentiometer with a different interface, the only modification to the software is to replace these two subroutines.

System status indication As mentioned earlier, a blinking LED is used to indicate the system status. A flash rate of approximately 0.25s indicates that the device has been powered on, but has not received user input to initiate the countdown. A blink rate of about 1s indicates that the system has started the countdown mode before the decay step. A blink rate of approximately 2s indicates that the system is in step decay mode. A blinking rate of approximately 5s indicates that the system has reached its fully silent position and stays there until the next power-up. Provide 5V power supply for the red LED through the current limiting resistor. The cathode of the LED is directly connected to port 0 of the MAXQ3210, bit 7, it can sink the required current. At the stated time interval, port pin P0.7 XOR with itself to trigger it, which in turn causes the LED to blink.

Time interval occurs Another major role of the microcontroller in this application is to measure the time interval of different functions. From a system-level perspective, this application should have at least two variable time interval delays. The first interval must provide a countdown delay, which starts when the user presses the start button and ends when the attenuation process is started. Intuitively, this time interval should be between 1 hour and 2 hours to allow people enough time to fall asleep. The second delay must establish a time interval between the individual steps of the decay process. This interval effectively determines the time it takes for the audio to fall from its attenuation level until it is finally muted. Therefore, it will determine the smoothness of the attenuation step. Intuitively, the entire attenuation stepping process should be from 1 minute to 60 minutes to achieve an accurate and smooth drop in level. Therefore, the 65 independent steps of the potentiometer are used to indicate the time interval between steps of about 1s to 55s. Finally, the key switch should also have a relatively short rebound delay, which should be on the order of 200ms.

To achieve this wide time interval, this application uses two subroutines. The subroutine called Delay establishes a variable time interval based on the received 8-bit parameters. This parameter determines the number of 10ms software timing cycles. Since the value of this parameter is between 0 and 255, the subroutine generates a maximum time interval of 2.55s. The software timing loop generates a time interval at a processor clock frequency of 3.58MHz. This subroutine also generates a rebound delay in the final implementation of the software.

The second time interval generation subroutine is called LDelay, which is based on the count 1s time interval generated by the second timer in the processor. Initialize the timer to generate an interrupt at 1s interval; the interrupt service routine increments the counter variable TIC. The LDelay subroutine compares the TIC with the preset value (see the next section). When they are equal, the TIC is reset to zero. When TIC is zero, the variable TOC is incremented by one. Then, the variable TOC is compared with another preset value. If the two values ​​are not equal, the loop is repeated. If these values ​​are equal, the interval is complete and the timer stops. Since both TIC and TOC can be 8-bit values, this subroutine can generate a delay of 18.06 hours (255 × 255 × 1s = 65,025s = 18.06hr).

Time interval selection The software written is easy to modify two time intervals for specific applications to suit various requirements. The include file (Attenuator.inc) defines two values ​​that enable users to directly modify these values ​​to change the two main system time intervals. The variables TIMEV1b and TIMEV1a maintain the 16-bit value (MSB and LSB respectively) of the countdown interval (ie, the decay step from the button press); TIMEV2b and TIMEV2a maintain the 16-bit value of the time interval between the decay steps (MSB respectively And LSB). Reassigning these variables directly in the .INC file can select any time interval within the required range for certain applications or environments.

Conclusion The system described in this document can be used to automatically attenuate linear-level audio signals in a synthesized stereo system to implement the sleep mode function. After the user enters (presses a key) a certain time interval, the audio attenuation begins; the attenuation is performed automatically, gradually, and smoothly. The system is controlled by the MAXQ3210 RISC processor, which attenuates the signal through a DS1801 dual audio tap digital potentiometer. A single-supply dual operational amplifier MAX4167 is used to buffer the signal. The signal is input and output in the form of AC coupling to achieve isolation from the internal bias voltage. The software is written in assembly language and tested using the MAX-IDE (MAXQ Integrated Development Environment) and the MAXQ3210 evaluation kit circuit board. All software for assembly and creation of loadable and executable .HEX files can be downloaded from the Maxim website.

The Description of Wifi Screw Mount Antenna


Electrical Specifications 
Frequency Range(MHz) 2300-2500 
Gain(dBi) >5 
V.S.W.R. <1.3 
Polarization Vertical 
Non-Circularity(dB) ±0.5 
Impedance(Ω) 50 
Lightning Protection Direct Ground 
Maximum Input Power(W) 50 
Mechanical Specifications 
Connector Type SMA 
Wight(Kg) 0.09/12


Wifi Screw Mount Antenna



Wifi Screw Mount Antenna Application Condition Indoor 
Operating Temperature(℃) -40~+85 
Reposition Temperature(℃) -55~+100 
Connects internal WiFi to external WiFi Booster Antenna 
Can be used with both indoor and outdoor antennas 
Compatible with 802.11a, 802.11b, 802.11g, and 802.11n 


Wifi Screw Mount Antenna Installation:
1.Mount the antenna on the pole or support, tighten all the screws.
2.Connected to the cable, make sure the contact well and good waterproof.
3.The package does not include the pole or support, you need buy from us or prepare by yourself, if you need it, PLEASE CONTACT with US.



Wifi Screw Mount Antenna

Wifi Screw Mount Antenna,Wifi Combo Screw Mount Antenna,Wifi Screw Combo Antenna,Screw Fiberglass Antenna

Shenzhen Yetnorson Technology Co., Ltd. , http://www.yetnorson.com

This entry was posted in on