![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
w Mono CODEC with Speaker Driver DESCRIPTION The WM8940 is a low power, high quality mono CODEC designed for portable applications such as digital still cameras or camcorders. The device integrates support for a differential or single ended mic, and includes drivers for speakers or headphone, and mono line output. External component requirements are reduced as no separate microphone or headphone amplifiers are required. Advanced Sigma Delta Converters are used along with digital decimation and interpolation filters to give high quality audio at sample rates from 8 to 48ks/s. A selectable high pass filter and four fully-programmable notch filters are available in the ADC path. An advanced mixed signal ALC function with noise gate is provided, while readback of PGA gain during ALC operation is supported. The digital audio interface supports Alaw and -law companding. An on-chip PLL is provided to generate the required Master Clock from an external reference clock. The PLL clock can also be output if required elsewhere in the system. The WM8940 operates at supply voltages from 2.5 to 3.6V, although the digital supplies can operate at voltages down to 1.71V to save power. Different sections of the chip can also be powered down under software control using the selectable two or three wire control interface. WM8940 is supplied in a very small 4x4mm QFN package, offering high levels of functionality in minimum board area, with high thermal performance. WM8940 FEATURES * * * * * * * * * Mono CODEC: Audio sample rates:8, 11.025, 16, 22.05, 24, 32, 44.1, 48kHz DAC SNR 98dB, THD -84dB (`A'-weighted @ 8 - 48ks/s) ADC SNR 94dB, THD -80dB (`A'-weighted @ 8 - 48ks/s) On-chip Headphone/Speaker Driver - 40mW output power into 16 - BTL speaker drive 0.4W into 8 Additional MONO Line output Multiple analog or `Aux' inputs, plus analog bypass path Mic Preamps: Differential or single end Microphone Interface - Programmable preamp gain - Pseudo differential inputs with common mode rejection - Programmable ALC / Noise Gate in ADC path Low-noise bias supplied for electret microphones * OTHER FEATURES * Digital Playback Limiter * Programmable high pass filter (wind noise reduction) * 4 notch filters (narrowband noise suppression) * On-chip PLL * Low power, low voltage - 2.5V to 3.6V (digital: 1.71V to 3.6V) * 4x4x0.9mm 24 lead QFN package APPLICATIONS * * Digital still cameras and camcorders General purpose mono audio CODEC WOLFSON MICROELECTRONICS plc To receive regular email updates, sign up at http://www.wolfsonmicro.com/enews/ Pre-Production, Rev 3.0, February 2007, Copyright (c)2007 Wolfson Microelectronics plc WM8940 BLOCK DIAGRAM Pre-Production w Pre-Production, Rev 3.0, February 2007 2 Pre-Production WM8940 TABLE OF CONTENTS DESCRIPTION .......................................................................................................1 FEATURES.............................................................................................................1 APPLICATIONS .....................................................................................................1 BLOCK DIAGRAM .................................................................................................2 TABLE OF CONTENTS .........................................................................................3 PIN CONFIGURATION...........................................................................................5 ORDERING INFORMATION ..................................................................................5 PIN DESCRIPTION ................................................................................................6 ABSOLUTE MAXIMUM RATINGS.........................................................................7 RECOMMENDED OPERATING CONDITIONS .....................................................7 ELECTRICAL CHARACTERISTICS ......................................................................8 TERMINOLOGY .......................................................................................................... 10 POWER CONSUMPTION ....................................................................................11 SIGNAL TIMING REQUIREMENTS .....................................................................12 SYSTEM CLOCK TIMING ........................................................................................... 12 AUDIO INTERFACE TIMING - MASTER MODE ........................................................ 12 AUDIO INTERFACE TIMING - SLAVE MODE............................................................ 13 CONTROL INTERFACE TIMING - 3-WIRE MODE .................................................... 14 CONTROL INTERFACE TIMING - 2-WIRE MODE .................................................... 15 DEVICE DESCRIPTION.......................................................................................16 INTRODUCTION ......................................................................................................... 16 INPUT SIGNAL PATH ................................................................................................. 17 ANALOGUE TO DIGITAL CONVERTER (ADC).......................................................... 22 INPUT LIMITER / AUTOMATIC LEVEL CONTROL (ALC) .......................................... 27 OUTPUT SIGNAL PATH ............................................................................................. 40 ANALOGUE OUTPUTS............................................................................................... 44 OUTPUT SWITCH ...................................................................................................... 47 DIGITAL AUDIO INTERFACES................................................................................... 50 AUDIO SAMPLE RATES ............................................................................................. 54 MASTER CLOCK AND PHASE LOCKED LOOP (PLL) ............................................... 54 COMPANDING............................................................................................................ 57 GENERAL PURPOSE INPUT/OUTPUT...................................................................... 59 CONTROL INTERFACE.............................................................................................. 59 3-WIRE SERIAL CONTROL MODE ............................................................................ 61 READBACK IN 3-WIRE MODE ................................................................................... 61 2-WIRE SERIAL CONTROL MODE ............................................................................ 62 RESETTING THE CHIP .............................................................................................. 62 POWER SUPPLIES .................................................................................................... 62 POWER MANAGEMENT ............................................................................................ 64 POP MINIMISATION ................................................................................................... 65 REGISTER MAP...................................................................................................66 REGISTER BITS BY ADDRESS ................................................................................. 67 DIGITAL FILTER CHARACTERISTICS ...............................................................78 TERMINOLOGY .......................................................................................................... 78 DAC FILTER RESPONSES......................................................................................... 79 ADC FILTER RESPONSES......................................................................................... 79 HIGHPASS FILTER..................................................................................................... 80 NOTCH FILTERS AND LOW PASS FILTER............................................................... 81 w Pre-Production, Rev 3.0, February 2007 3 WM8940 Pre-Production NOTCH FILTER WORKED EXAMPLE........................................................................ 82 APPLICATIONS INFORMATION .........................................................................83 RECOMMENDED EXTERNAL COMPONENTS .......................................................... 83 PACKAGE DIAGRAM ..........................................................................................84 IMPORTANT NOTICE ..........................................................................................85 ADDRESS ................................................................................................................... 85 w Pre-Production, Rev 3.0, February 2007 4 Pre-Production WM8940 PIN CONFIGURATION TOP VIEW ORDERING INFORMATION ORDER CODE WM8940GEFL/V WM8940GEFL/RV Note: Reel Quantity = 3,500 TEMPERATURE RANGE -25C to +85C -25C to +85C PACKAGE 24-lead QFN (4x4x0.9mm) (Pb-free) 24-lead QFN (4x4x0.9mm) (Pb-free, tape and reel) MOISTURE SENSITIVITY LEVEL MSL3 MSL3 PACKAGE BODY TEMPERATURE 260oC 260oC w Pre-Production, Rev 3.0, February 2007 5 WM8940 PIN DESCRIPTION PIN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 NAME MICBIAS AVDD AGND DCVDD DBVDD DGND ADCDAT DACDAT FRAME BCLK MCLK CSB/GPIO SCLK SDIN MODE / GPIO MONOOUT SPKOUTP SPKGND SPKOUTN SPKVDD AUX VMID MICN MICP Supply Supply Supply Supply Supply Digital Output Digital Input Digital Input / Output Digital Input / Output Digital Input Digital Input / Output Digital Input Digital Input / Output Digital Input Analogue Output Analogue Output Supply Analogue Output Supply Analogue Input Reference Analogue Input Analogue Input TYPE Analogue Output Microphone bias Analogue supply Analogue ground Digital Supply (Core) Digital supply (Input/Output) Digital ground ADC digital audio data output DAC digital audio data input DAC and ADC sample rate clock or frame synch Digital audio port clock Master clock input 3-Wire control interface chip select or GPIO pin. DESCRIPTION Pre-Production 3-Wire control interface clock Input / 2-Wire control interface clock input 3-Wire control interface data Input / 2-Wire control interface data input Control interface mode selection pin or GPIO pin. Mono output Speaker output positive Speaker ground Speaker output negative Speaker supply Auxiliary analogue input Decoupling for midrail reference voltage Microphone negative input (common mode) Microphone positive input Note: 1. 2. It is recommended that the QFN ground paddle should be connected to analogue ground on the application PCB. Refer to the application note WAN_0118 on "Guidelines on How to Use QFN Packages and Create Associated PCB Footprints" w Pre-Production, Rev 3.0, February 2007 6 Pre-Production WM8940 ABSOLUTE MAXIMUM RATINGS Absolute Maximum Ratings are stress ratings only. Permanent damage to the device may be caused by continuously operating at or beyond these limits. Device functional operating limits and guaranteed performance specifications are given under Electrical Characteristics at the test conditions specified. ESD Sensitive Device. This device is manufactured on a CMOS process. It is therefore generically susceptible to damage from excessive static voltages. Proper ESD precautions must be taken during handling and storage of this device. Wolfson tests its package types according to IPC/JEDEC J-STD-020B for Moisture Sensitivity to determine acceptable storage conditions prior to surface mount assembly. These levels are: MSL1 = unlimited floor life at <30C / 85% Relative Humidity. Not normally stored in moisture barrier bag. MSL2 = out of bag storage for 1 year at <30C / 60% Relative Humidity. Supplied in moisture barrier bag. MSL3 = out of bag storage for 168 hours at <30C / 60% Relative Humidity. Supplied in moisture barrier bag. The Moisture Sensitivity Level for each package type is specified in Ordering Information. CONDITION DBVDD, DCVDD, AVDD, SPKVDD supply voltages Voltage range digital inputs Voltage range analogue inputs Operating temperature range, TA Storage temperature prior to soldering Storage temperature after soldering Notes 1. 2. Analogue and digital grounds must always be within 0.3V of each other. All digital and analogue supplies are completely independent from each other. MIN -0.3V DGND -0.3V AGND -0.3V -25C -65C MAX +4.2 DVDD +0.3V AVDD +0.3V +85C +150C 30C max / 85% RH max RECOMMENDED OPERATING CONDITIONS PARAMETER Digital supply range (Core) Digital supply range (Buffer) Analogue supplies range Ground Notes 1. 2. Analogue supply voltages must not be less than the digital supply voltages DBVDD should not be < DCVDD SYMBOL DCVDD DBVDD AVDD, SPKVDD1 DGND,AGND, SPKGND TEST CONDITIONS MIN 1.71 1.71 2.5 0 TYP MAX 3.6 3.6 3.6 UNIT V V V V w Pre-Production, Rev 3.0, February 2007 7 WM8940 ELECTRICAL CHARACTERISTICS Pre-Production Test Conditions DCVDD = 1.8V, AVDD = DBVDD = 3.3V, SPKVDD =3.3V, TA = +25oC, 1kHz signal, fs = 48kHz, 24-bit audio data unless otherwise stated. PARAMETER SYMBOL TEST CONDITIONS MIN TYP MAX UNIT Microphone Input PGA Inputs (MICN, MICP) INPPGAVOL and PGABOOST = 0dB Full-scale Input Signal Level - Singleended input via LIN/RIN 1 Full-scale Input Signal Level - Pseudo-differential input 1,2 Input PGA equivalent input noise INPPGAVOL = +35.25dB No input signal 0 to 20kHz INPPGAVOL = +35.25dB INPPGAVOL = 0dB INPPGAVOL = -12dB All gain settings All analogue input pins Gain adjusted by INPPGAVOL Guaranteed monotonic INPPGAMUTE PGABOOST= 0 PGABOOST = 1 -12 0.75 108 0 +20 AVDD/3.3 Input boost and mixer enabled, at 0dB gain All analogue Inputs Gain adjusted by AUX2BOOSTVOL -12 3 20 10 +6 AVDD/3.3 AVDD*0.7/ 3.3 76.5 Vrms Vrms dB MICN input resistance MICN input resistance MICN input resistance MICP input resistance Input Capacitance Input PGA Programmable Gain Programmable Gain Step Size Input PGA Mute Attenuation Input Gain Boost Input Gain Boost Auxiliary Analogue Inputs (AUX) Full-scale Input Signal Level 2 Input Resistance Input Capacitance Gain range from AUX input PGA mixers AUXLBOOSTVOL and AUXRBOOSTVOL step size 1.6 47 71 94 10 +35.25 k k k k pF dB dB dB dB dB Vrms k pF dB dB Analogue to Digital Converter (ADC) - Input from MICN and MICN in differential configuration to input PGA INPPGAVO, PGABOOST and ADCVOL = 0dB Signal to Noise Ratio 3 Total Harmonic Distortion 4 Total Harmonic Distortion + Noise 5 Channel Separation 6 SNR THD THD+N A-weighted AVDD=3.3V -1dBV Input AVDD=3.3V -1dBV Input AVDD=3.3V 1kHz full scale input signal 91 -83 -77 100 dB dB dB dBFS w Pre-Production, Rev 3.0, February 2007 8 Pre-Production WM8940 Digital to Analogue Converter (DAC) to MONO Output with 10k / 50pF load and DACVOL 0dB Full-scale output 1 Signal to Noise Ratio 3 DACVOL = 0dB SNR 4 AVDD1/3.3 98 -80 -78 100 Vrms dB dBFS dBFS dB A-weighted AVDD1=AVDD2=3.3V 0dBFS input AVDD1=AVDD2=3.3V 0dBFS input AVDD1=AVDD2=3.3V 1kHz signal Total Harmonic Distortion THD THD+N Total Harmonic Distortion + Noise 5 Channel Separation 6 MICP and MICN input PGA to input boost stage into 10k / 50pF load on SPKOUTP and SPKOUTP INPPGAVOL, PGABOOST = 0dB Full-scale output voltage, 0dB gain Signal to Noise Ratio 3 AVDD2/3.3 SNR A-weighted AVDD1=AVDD2=3.3V full-scale signal AVDD1=AVDD2=3.3V full-scale signal AVDD1=AVDD2=3.3V 98 -80 -78 100 Vrms dB dBFS dBFS dB Total Harmonic Distortion 4 THD THD+N Total Harmonic Distortion + Noise 5 Channel Separation 6 Speaker Output (SPKOUTP, SPKOUTN with 8 bridge tied load) Output Power Total Harmonic Distortion 4 Po THD Output power is closely correlated with THD see below Po=150mW, RL = 8 SPKVDD=3.3V Po=350mW, RL = 8 SPKVDD=3.3V Signal to Noise Ratio 3 Power Supply Rejection Ratio (50Hz-22kHz) Signal to Noise Ratio 3 Total Harmonic Distortion Microphone Bias Bias Voltage Bias Current Source Output Noise Voltage Digital Input / Output Input HIGH Level Input LOW Level Output HIGH Level Output LOW Level Input Capacitance VIH VIL VOH VOL IOL=1mA IOH-1mA All digital pins 10 0.9x DBVDD 0.1xDBVDD 0.7x DBVDD 0.3xDBVDD V V V V pF MBVSEL=0 MBVSEL=1 for VMICBIAS within +/-3% 1kHz to 20kHz 15 0.9*AVDD1 0.65*AVDD1 3 V V Ma nV/Hz 4 0.03 -68 2.944 -30.6 98 50 % dB % dB dB dB SNR PSRR A-weighted SPKVDD=3.3V RL = 8 BTL Headphone Output (SPKOUTP, SPKOUTN with resistive load to GND) SNR THD A-weighted SPKVDD=3.3V Po=20mW, RL = 16 SPKVDD=3.3V 98 0.02 -72 dB % dB w Pre-Production, Rev 3.0, February 2007 9 WM8940 TERMINOLOGY 1. Pre-Production Full-scale input and output levels scale in relation to AVDD or AVDD2 depending upon the input or output used. For example, when AVDD = 3.3V, 0dBFS = 1Vrms (0dBV). When AVDD < 3.3V the absolute level of 0dBFS will decrease with a linear relationship to AVDD. Input level to RIP and LIP in differential configurations is limited to a maximum of -3dB or performance will be reduced. Signal-to-noise ratio (dB) - SNR is the difference in level between a reference full scale output signal and the device output with no signal applied. This ratio is also called idle channel noise. (No Auto-zero or Automute function is employed in achieving these results). Total Harmonic Distortion (dB) - THD is the difference in level between a reference output signal and the first seven harmonics of that signal. The reference output signal need not be at full scale amplitude; THD is typically measured using an output power of 20mW into a 16ohm load, corresponding to a reference signal level of -5dB. However the stated test conditions include input signal level, signal gain settings, output load characteristics and power supply voltages To calculate the ratio, the fundamental frequency of the output signal is notched out and an RMS value of the next seven harmonics is calculated. THD is the difference in level between a reference output signal and the first seven harmonics of the output signal. To calculate the ratio, the fundamental frequency of the output signal is notched out and an RMS value of the next seven harmonics is calculated. Total Harmonic Distortion plus Noise (dB) - THD+N is the difference in level between a reference output signal and the sum of the harmonics, wide-band noise and interference on the output signal. To calculate the ratio, the fundamental frequency of the output signal is notched out and an RMS value of the total harmonics, wide-band noise and interference is calculated. Channel Separation (dB) - Also known as Cross-Talk. This is a measure of the amount one channel is isolated from the other. Normally measured by sending a full scale signal down 2. 3. 4. 5. 6. 7. w Pre-Production, Rev 3.0, February 2007 10 Pre-Production WM8940 POWER CONSUMPTION Typical current consumption for various scenarios is shown below. DCVDD (1.8V) MA 0 0 0.3 1.9 1.6 1.6 1.8 DBVDD (1.8V) UA 0.2 0.2 11 115 3.7 3.8 81 TOTAL POWER (MW) 0.126 0.627 14.3 21.0 17.1 216.8 21.1 MODE Power OFF (No Clocks) Sleep (VMID maintained, No Clocks) Mono Record (MIC input, +20dB gain, 8kHz, quiescent) SLAVE Mono Record (MIC input, +20dB gain, 44.1kHz, PLL, quiescent) MASTER Mono 16 Headphone Playback (0.1mW, 1kHz sine wave, ac coupled) SLAVE Mono 8 BTL speaker Playback (44.1kHz, 200mW, 1kHz sine wave) SLAVE Mono 8 BTL speaker Playback (44.1kHz, PLL, quiescent) MASTER Table 1 Power Consumption AVDD (3V3) MA 0.038 0.190 4.1 5.3 2.8 2.8 3.9 SPKVDD (3V3) MA 0 0 0 0 1.5 62 1.5 Note: Power consumption figures include any power dissipated in the load (e.g. in the headphone or speaker) w Pre-Production, Rev 3.0, February 2007 11 WM8940 SIGNAL TIMING REQUIREMENTS SYSTEM CLOCK TIMING tMCLKL MCLK tMCLKH tMCLKY Pre-Production Figure 1 System Clock Timing Requirements Test Conditions DCVDD=1.8V, DBVDD=AVDD=SPKVDD=3.3V, DGND=AGND=SPKGND=0V, TA = +25oC PARAMETER System Clock Timing Information MCLK cycle time MCLK duty cycle Note 1: PLL pre-scaling and PLL N and K values should be set appropriately so that SYSCLK is no greater than 12.288MHz. TMCLKY TMCLKDS MCLK=SYSCLK (=256fs) MCLK input to PLL Note 1 81.38 20 60:40 40:60 ns ns SYMBOL CONDITIONS MIN TYP MAX UNIT AUDIO INTERFACE TIMING - MASTER MODE Figure 2 Digital Audio Data Timing - Master Mode (see Control Interface) w Pre-Production, Rev 3.0, February 2007 12 Pre-Production WM8940 Test Conditions DCVDD=1.8V, DBVDD=AVDD=SPKVDD=3.3V, DGND=AGND=SPKGND=0V, TA=+25oC, Slave Mode, fs=48kHz, MCLK=256fs, 24-bit data, unless otherwise stated. PARAMETER Audio Data Input Timing Information FRAME propagation delay from BCLK falling edge ADCDAT propagation delay from BCLK falling edge DACDAT setup time to BCLK rising edge DACDAT hold time from BCLK rising edge tDL tDDA tDST tDHT 10 10 10 15 ns ns ns ns SYMBOL MIN TYP MAX UNIT AUDIO INTERFACE TIMING - SLAVE MODE Figure 3 Digital Audio Data Timing - Slave Mode Test Conditions DCVDD=1.8V, DBVDD=AVDD=SPKVDD=3.3V, DGND=AGND=SPKGND=0V, TA=+25oC, Slave Mode, fs=48kHz, MCLK= 256fs, 24-bit data, unless otherwise stated. PARAMETER Audio Data Input Timing Information BCLK cycle time BCLK pulse width high BCLK pulse width low FRAME set-up time to BCLK rising edge FRAME hold time from BCLK rising edge DACDAT hold time from BCLK rising edge DACDAT set-up time to BCLK rising edge ADCDAT propagation delay from BCLK falling edge Note: BCLK period should always be greater than or equal to MCLK period. tBCY tBCH tBCL tLRSU tLRH tDH tDS tDD 81.38 32.55 32.55 10 10 10 10 15 ns ns ns ns ns ns ns ns SYMBOL MIN TYP MAX UNIT w Pre-Production, Rev 3.0, February 2007 13 WM8940 CONTROL INTERFACE TIMING - 3-WIRE MODE Pre-Production Figure 4 Control Interface Timing - 3-Wire Serial Control Mode Test Conditions DCVDD = 1.8V, DBVDD = AVDD = SPKVDD = 3.3V, DGND = AGND = SPKGND = 0V, TA = +25oC, Slave Mode, fs = 48kHz, MCLK = 256fs, 24-bit data, unless otherwise stated. PARAMETER Program Register Input Information SCLK rising edge to CSB rising edge SCLK pulse cycle time SCLK pulse width low SCLK pulse width high SDIN to SCLK set-up time SCLK to SDIN hold time CSB pulse width low CSB pulse width high CSB rising to SCLK rising Pulse width of spikes that will be suppressed tSCS tSCY tSCL tSCH tDSU tDHO tCSL tCSH tCSS tps 80 200 80 80 40 40 40 40 40 0 5 ns ns ns ns ns ns ns ns ns ns SYMBOL MIN TYP MAX UNIT w Pre-Production, Rev 3.0, February 2007 14 Pre-Production WM8940 CONTROL INTERFACE TIMING - 2-WIRE MODE t3 SDIN t4 t6 SCLK t1 t9 t7 t2 t8 t5 t3 Figure 5 Control Interface Timing - 2-Wire Serial Control Mode Test Conditions DCVDD=1.8V, DBVDD=AVDD=SPKVDD=3.3V, DGND=AGND=SPKGND=0V, TA = +25oC, Slave Mode, fs = 48kHz, MCLK = 256fs, 24-bit data, unless otherwise stated. PARAMETER Program Register Input Information SCLK Frequency SCLK Low Pulse-Width SCLK High Pulse-Width Hold Time (Start Condition) Setup Time (Start Condition) Data Setup Time SDIN, SCLK Rise Time SDIN, SCLK Fall Time Setup Time (Stop Condition) Data Hold Time Pulse width of spikes that will be suppressed t1 t2 t3 t4 t5 t6 t7 t8 t9 tps 0 600 900 5 0 1.3 600 600 600 100 300 300 526 kHz us ns ns ns ns ns ns ns ns ns SYMBOL MIN TYP MAX UNIT w Pre-Production, Rev 3.0, February 2007 15 WM8940 DEVICE DESCRIPTION INTRODUCTION Pre-Production The WM8940 is a low power audio codec combining a high quality mono audio DAC and ADC, with flexible line and microphone input and output processing. Applications for this device include digital still cameras or camcorders with mono audio, record and playback capability. FEATURES The chip offers great flexibility in use, and so can support many different modes of operation as follows: MICROPHONE INPUTS Two microphone inputs are provided, allowing for either a differential microphone input or a single ended microphone to be connected. These inputs have a user programmable gain range of -12dB to +35.25dB using internal resistors. After the input PGA stage comes a boost stage which can add a further 20dB of gain. A microphone bias is output from the chip which can be used to bias the microphones. The signal routing can be configured to allow manual adjustment of mic levels, or to allow the ALC loop to control the level of mic signal that is transmitted. Total gain through the microphone paths of up to +55.25dB can be selected. PGA AND ALC OPERATION A programmable gain amplifier is provided in the input path to the ADC. This may be used manually or in conjunction with a mixed analogue/digital automatic level control (ALC) which keeps the recording volume constant. AUX INPUT The device includes a mono input, AUX, that can be used as an input for warning tones (beep) etc. The output from this circuit can be summed into the mono output and/or the speaker output paths, so allowing for mixing of audio with `backing music' etc as required. This path can also be summed into the input in a flexible fashion, either to the input PGA as a second microphone input or as a line input. The configuration of this circuit, with integrated on-chip resistors allows several analogue signals to be summed into the single AUX input if required. ADC The mono ADC uses a multi-bit high-order over sampling architecture to deliver optimum performance with low power consumption. Various sample rates are supported, from the 8ks/s rate typically used in voice dictation, up to the 48ks/s rate used in high quality audio applications. HI-FI DAC The hi-fi DAC provides high quality audio playback suitable for all portable mono audio type applications. DIGITAL FILTERING Advanced Sigma Delta Converters are used along with digital decimation and interpolation filters to give high quality audio at sample rates from 8ks/s to 48ks/s. Application specific digital filters are also available which help to reduce the effect of specific noise sources such as wind noise or narrowband noise from other parts of the system. The filters include a programmable ADC high pass filter and four fully programmable ADC notch filters. OUTPUT MIXING AND VOLUME ADJUST Flexible mixing is provided on the outputs of the device; a mixer is provided for the speaker outputs, and an additional mono summer for the mono output. These mixers allow the output of the DAC, the output of the ADC volume control and the Auxiliary input to be combined. The output volume can be adjusted using the integrated digital volume control and there is additional analogue gain adjustment capability on the speaker output. AUDIO INTERFACES The WM8940 has a standard audio interface, to support the transmission of audio data to and from the chip. This interface is a 4 wire standard audio interface which supports a number of audio data 2 formats including I S, DSP Mode, MSB-First, left justified and MSB-First, right justified, and can operate in master or slave modes. w Pre-Production, Rev 3.0, February 2007 16 Pre-Production WM8940 CONTROL INTERFACES To allow full software control over all its features, the WM8940 supports 2 or 3 wire control interface. It is fully compatible and an ideal partner for a wide range of industry standard microprocessors, controllers and DSPs. The selection between 2-wire mode and 3-wire mode is determined by the state of the MODE pin. If MODE is high then 3-wire control mode is selected, if MODE is low then 2wire control mode is selected. In 2 wire mode, only slave operation is supported, and the address of the device is fixed as 0011010. CLOCKING SCHEMES WM8940 offers the normal audio DAC clocking scheme operation, where 256fs MCLK is provided to the DAC/ADC. However, a PLL is also included which may be used to generate the internal master clock frequency in the event that this is not available from the system controller. This PLL uses an input clock, typically the 12MHz USB or ilink clock, to generate high quality audio clocks. If this PLL is not required for generation of these clocks, it can be reconfigured to generate alternative clocks which may then be output on the CLKOUT pin and used elsewhere in the system. POWER CONTROL The design of the WM8940 has given much attention to power consumption without compromising performance. It operates at low supply voltages, and includes the facility to power off any unused parts of the circuitry under software control. As a power saving measure, ADC or DAC logic in the DSP core is held in its last enabled state when the ADC or DAC is disabled. In order to prevent pops and clicks on restart due to residual data in the filters, the master clock must remain for at least 64 input samples after the ADC or DAC has been disabled. INPUT SIGNAL PATH The WM8940 has 3 flexible analogue inputs: two microphone inputs, and an auxiliary input. These inputs can be used in a variety of ways. The input signal path before the ADC has a flexible PGA block which then feeds into a gain boost/mixer stage. MICROPHONE INPUTS The WM8940 can accommodate a variety of microphone configurations including single ended and differential inputs. The inputs through the MICN, MICP and optionally AUX pins are amplified through the input PGA as shown in Figure 6 . A pseudo differential input is the preferential configuration where the positive terminal of the input PGA is connected to the MICP input pin by setting MICP2INPPGA=1. The microphone ground should then be connected to MICN (when MICN2INPPGA=1) or optionally to AUX (when AUX2INPPGA=1) input pins. Alternatively a single ended microphone can be connected to the MICN input with MICN2INPPGA set to 1. The non-inverting terminal of the input PGA should be connected internally to VMID by setting MICP2INPPGA to 0. In pseudo-differential mode the larger signal should be input to MICP and the smaller (e.g. noisy ground connections) should be input to MICN. w Pre-Production, Rev 3.0, February 2007 17 WM8940 Pre-Production Figure 6 Microphone Input PGA Circuit (switch positions shown are for differential mic input) REGISTER ADDRESS R44 Input Control BIT 2 LABEL AUX2INPPGA 0 DEFAULT DESCRIPTION Select AUX amplifier output as input PGA signal source. 0=AUX not connected to input PGA 1=AUX connected to input PGA amplifier negative terminal. Connect MICN to input PGA negative terminal. 0=MICN not connected to input PGA 1=MICN connected to input PGA amplifier negative terminal. Connect input PGA amplifier positive terminal to MICP or VMID. 0 = input PGA amplifier positive terminal connected to VMID 1 = input PGA amplifier positive terminal connected to MICP through variable resistor string 1 MICN2INPPGA 1 0 MICP2INPPGA 0 Table 2 Input Control The input PGA is enabled by the IPPGAEN register bit. REGISTER ADDRESS R2 Power Management 2 2 BIT LABEL INPPGAEN DEFAULT 0 DESCRIPTION Input microphone PGA enable 0 = disabled 1 = enabled Table 3 Input PGA Enable Control w Pre-Production, Rev 3.0, February 2007 18 Pre-Production INPUT PGA VOLUME CONTROL WM8940 The input microphone PGA has a gain range from -12dB to +35.25dB in 0.75dB steps. The gain from the MICN input to the PGA output and from the AUX amplifier to the PGA output are always common and controlled by the register bits INPPGAVOL[5:0]. These register bits also affect the MICP pin when MICP2INPPGA=1. When the Automatic Level Control (ALC) is enabled the input PGA gain is then controlled automatically and the INPPGAVOL bits should not be used. REGISTER ADDRESS R45 Input PGA volume control 7 BIT LABEL INPPGAZC DEFAULT 0 DESCRIPTION Input PGA zero cross enable: 0=Update gain when gain register changes 1=Update gain on 1st zero cross after gain register write. Mute control for input PGA: 0=Input PGA not muted, normal operation 1=Input PGA muted (and disconnected from the following input BOOST stage). Input PGA volume 000000 = -12dB 000001 = -11.25db . 010000 = 0dB . 111111 = 35.25dB ALC function select: 0=ALC off (PGA gain set by INPPGAVOL register bits) 1=ALC on (ALC controls PGA gain) 6 INPPGAMUTE 1 5:0 INPPGAVOL 010000 R32 8 ALC control 1 ALCSEL 0 Table 4 Input PGA Volume Control AUXILLIARY INPUT An auxiliary input circuit (Figure 7) is provided which consists of an amplifier which can be configured either as an inverting buffer for a single input signal or as a mixer/summer for multiple inputs with the use of external resistors. The circuit is enabled by the register bit AUXEN. Figure 7 Auxiliary Input Circuit w Pre-Production, Rev 3.0, February 2007 19 WM8940 The AUXMODE register bit controls the auxiliary input mode of operation: Pre-Production In buffer mode (AUXMODE=0) the switch labelled AUXSW in Figure 7 is open and the signal at the AUX pin will be buffered and inverted through the aux circuit using only the internal components. In mixer mode (AUXMODE=1) the on-chip input resistor is bypassed, this allows the user to sum in multiple inputs with the use of external resistors. When used in this mode there will be gain variations through this path from part to part due to the variation of the internal 20k resistors relative to the higher tolerance external resistors. REGISTER ADDRESS R1 Power management 1 R44 Input control 6 BIT LABEL AUXEN DEFAULT 0 DESCRIPTION Auxiliary input buffer enable 0 = OFF 1 = ON 0 = inverting buffer 1 = mixer (on-chip input resistor bypassed) 3 AUXMODE 0 Table 5 Auxiliary Input Buffer Control INPUT BOOST The input BOOST circuit has 3 selectable inputs: the input microphone PGA output, the AUX amplifier output and the MICP input pin (when not using a differential microphone configuration). These three inputs can be mixed together and have individual gain boost/adjust as shown in Figure 8. Figure 8 Input Boost Stage The input PGA path can have a +20dB boost (PGABOOST=1) a 0dB pass through (PGABOOST=0) or be completely isolated from the input boost circuit (INPPGAMUTE=1). w Pre-Production, Rev 3.0, February 2007 20 Pre-Production WM8940 REGISTER ADDRESS R45 6 Input PGA gain control R47 Input BOOST control 8 BIT LABEL INPPGAMUTE DEFAULT 1 DESCRIPTION Mute control for input PGA: 0=Input PGA not muted, normal operation 1=Input PGA muted (and disconnected from the following input BOOST stage). 0 = PGA output has +0dB gain through input BOOST stage. 1 = PGA output has +20dB gain through input BOOST stage. PGABOOST 0 Table 6 Input BOOST Stage Control The Auxiliary amplifier path to the BOOST stage is controlled by the AUX2BOOSTVOL[2:0] register bits. When AUX2BOOSTVOL=000 this path is completely disconnected from the BOOST stage. Settings 001 through to 111 control the gain in 3dB steps from -12dB to +6dB. The MICP path to the BOOST stage is controlled by the MICP2BOOSTVOL[2:0] register bits. When MICP2BOOSTVOL=000 this input pin is completely disconnected from the BOOST stage. Settings 001 through to 111 control the gain in 3dB steps from -12dB to +6dB. REGISTER ADDRESS R47 Input BOOST control BIT 6:4 LABEL MICP2BOOSTVOL DEFAULT 000 DESCRIPTION Controls the MICP pin to the input boost stage (NB, when using this path set MICP2INPPGA=0): 000=Path disabled (disconnected) 001=-12dB gain through boost stage 010=-9dB gain through boost stage ... 111=+6dB gain through boost stage Controls the auxiliary amplifier to the input boost stage: 000=Path disabled (disconnected) 001=-12dB gain through boost stage 010=-9dB gain through boost stage ... 111=+6dB gain through boost stage 2:0 AUX2BOOSTVOL 000 Table 7 Input BOOST Stage Control The BOOST stage is enabled under control of the BOOSTEN register bit. REGISTER ADDRESS R2 Power management 2 BIT 4 LABEL BOOSTEN DEFAULT 0 DESCRIPTION Input BOOST enable 0 = Boost stage OFF 1 = Boost stage ON Table 8 Input BOOST Enable Control MICROPHONE BIASING CIRCUIT The MICBIAS output provides a low noise reference voltage suitable for biasing electret type microphones and the associated external resistor biasing network. Refer to the Applications Information section for recommended external components. The MICBIAS voltage can be altered via the MBVSEL register bit. When MBVSEL=0, MICBIAS=0.9*AVDD and when MBVSEL=1, MICBIAS=0.65*AVDD. The output can be enabled or disabled using the MICBEN control bit. w Pre-Production, Rev 3.0, February 2007 21 WM8940 REGISTER ADDRESS R1 Power management 1 4 BIT LABEL MICBEN DEFAULT 0 Pre-Production DESCRIPTION Microphone Bias Enable 0 = OFF (high impedance output) 1 = ON Table 9 Microphone Bias Enable REGISTER ADDRESS R44 Input Control 8 BIT LABEL MBVSEL DEFAULT 0 DESCRIPTION Microphone Bias Voltage Control 0 = 0.9 * AVDD 1 = 0.65 * AVDD Table 10 Microphone Bias Voltage Control The internal MICBIAS circuitry is shown in Figure 9. Note that the maximum source current capability for MICBIAS is 3mA. The external biasing resistors therefore must be large enough to limit the MICBIAS current to 3mA. VMID internal resistor internal resistor MB MBVSEL=0 MICBIAS = 1.8 x VMID = 0.9 X AVDD MBVSEL=1 MICBIAS = 1.3 x VMID = 0.65 X AVDD AGND Figure 9 Microphone Bias Schematic ANALOGUE TO DIGITAL CONVERTER (ADC) The WM8940 uses a multi-bit, over sampled sigma-delta ADC channel. The use of multi-bit feedback and high over sampling rates reduces the effects of jitter and high frequency noise. The ADC Full Scale input level is proportional to AVDD. With a 3.3V supply voltage, the full scale level is 1.0Vrms. Any voltage greater than full scale may overload the ADC and cause distortion. ADC DIGITAL FILTERS The ADC filters perform true 24 bit signal processing to convert the raw multi-bit over sampled data from the ADC to the correct sampling frequency to be output on the digital audio interface. The digital filter path is illustrated in . w Pre-Production, Rev 3.0, February 2007 22 Pre-Production WM8940 Figure 10 ADC Digital Filter Path The ADC is enabled by the ADCEN register bit. REGISTER ADDRESS R2 Power management 2 Table 11 ADC Enable The polarity of the output signal can also be changed under software control using the ADCPOL register bit. REGISTER ADDRESS R14 ADC Control 0 BIT LABEL ADCPOL DEFAULT 0 DESCRIPTION 0=normal 1=inverted 0 BIT LABEL ADCEN DEFAULT 0 DESCRIPTION 0 = ADC disabled 1 = ADC enabled Table 12 ADC Polarity SELECTABLE HIGH PASS FILTER A selectable high pass filter is provided. To disable this filter set HPFEN=0. The filter has two modes controlled by HPFAPP. In Audio Mode (HPFAPP=0) the filter is first order, with a cut-off frequency of 3.7Hz. In Application Mode (HPFAPP=1) the filter is second order, with a cut-off frequency selectable via the HPFCUT register. The cut-off frequencies when HPFAPP=1 are shown in Table 14. REGISTER ADDRESS R14 ADC Control 8 BIT LABEL HPFEN DEFAULT 1 DESCRIPTION High Pass Filter Enable 0=disabled 1=enabled Select audio mode or application mode 0=Audio mode (1st order, fc = ~3.7Hz) 1=Application mode (2nd order, fc = HPFCUT) Application mode cut-off frequency See Table 14 for details. 7 HPFAPP 0 6:4 Table 13 ADC Filter Select HPFCUT 000 w Pre-Production, Rev 3.0, February 2007 23 WM8940 HPFCUT SR=101/100 8 000 001 010 011 100 101 110 111 82 102 131 163 204 261 327 408 11.025 113 141 180 225 281 360 450 563 12 122 153 156 245 306 392 490 612 16 82 102 131 163 204 261 327 408 FS (KHZ) SR=011/010 22.05 113 141 180 225 281 360 450 563 24 122 153 156 245 306 392 490 612 32 82 102 131 163 204 261 327 408 Pre-Production SR=001/000 44.1 113 141 180 225 281 360 450 563 48 122 153 156 245 306 392 490 612 Table 14 High Pass Filter Cut-off Frequencies (HPFAPP=1) Note that the High Pass filter values (when HPFAPP=1) work on the basis that the SR register bits are set correctly for the actual sample rate as shown in Table 14. PROGRAMMABLE NOTCH FILTERS Four programmable notch filters are provided. These filters have a programmable centre frequency and bandwidth, programmable via two coefficients, a0 and a1. a0 and a1 are represented by the register bits NFx_A0[13:0] and NFx_A1[13:0]. Notch Filter 3 can also be programmed as a 1st order low pass filter. Because these coefficient values require two register writes to set up there is an NFx_UP (Notch Filter Update) flag for each filter which should be set only when both A0 and A1 for the filter have been set. The notch filters can be individually enabled, using the corresponding NFx_EN register bit, as can be seen in Figure 11. Figure 11 Labelling of Notch Filters and Arrangement of Notch Filter Enables REGISTER ADDRESS R16 Notch Filter 0A BIT 15 LABEL NF0_UP DEFAULT 0 DESCRIPTION Notch filter 0 update. The notch filter 0 values used internally only update when one of the NF0_UP bits is set high. Notch filter 0 enable: 0=Disabled 1=Enabled 14 NF0_EN 0 13:0 R17 Notch Filter 0B 15 NF0_A0 NF0_UP 0 0 Notch Filter 0 a0 coefficient Notch filter 0 update. The notch filter 0 values used internally only update when one of the NF0_UP bits is set high. Notch Filter 0 a1 coefficient 13:0 NF0_A1 0 Table 15 Notch Filter 0 Function w Pre-Production, Rev 3.0, February 2007 24 Pre-Production REGISTER ADDRESS R18 Notch Filter 1A BIT 15 LABEL NF1_UP DEFAULT 0 WM8940 DESCRIPTION Notch filter 1 update. The notch filter 1 values used internally only update when one of the NFU bits is set high. 14 NF1_EN 0 Notch Filter 1 enable. 0=Disabled 1=Enabled Notch Filter 1 a0 coefficient Notch filter 1 update. The notch filter 1 values used internally only update when one of the NFU bits is set high. 13:0 NF1_A1 0 Notch Filter 1 a1 coefficient Table 16 Notch Filter 1 Function 13:0 R19 Notch Filter 1B 15 NF1_A0 NF1_UP 0 0 REGISTER ADDRESS R20 Notch Filter 2A BIT 15 LABEL NF2_UP DEFAULT 0 DESCRIPTION Notch filter 2 update. The notch filter 2 values used internally only update when one of the NFU bits is set high. Notch Filter 2 enable. 0=Disabled 1=Enabled Notch Filter 2 a0 coefficient Notch filter 2 update. The notch filter 2 values used internally only update when one of the NFU bits is set high. Notch Filter 2 a1 coefficient 14 NF2_EN 0 13:0 R21 Notch Filter 2B 15 NF2_A0 NF2_UP 0 0 13:0 NF2_A1 0 Table 17 Notch Filter 2 Function REGISTER ADDRESS R22 Notch Filter 3A BIT 15 LABEL NF3_UP DEFAULT 0 DESCRIPTION Notch filter 3 update. The notch filter 3 values used internally only update when one of the NFU bits is set high. Notch Filter 3 enable. 0=Disabled 1=Enabled Notch Filter 3 a0 coefficient Notch filter 3 update. The notch filter 3 values used internally only update when one of the NFU bits is set high. Notch Filter 3 mode select 0 = Notch Filter mode 1 = Low Pass Filter mode Notch Filter 3 a1 coefficient 14 NF3_EN 0 13:0 R23 Notch Filter 3B 15 NF3_A0 NF3_UP 0 0 14 NF3_LP 0 13:0 NF3_A1 0 Table 18 Notch Filter 3 Function The notch filter coefficients must be entered using a sign / magnitude notation. The MSB of the 14bit register word (NFx_Ax[13]) is reserved for the sign part, leaving the 13 remaining bits for the magnitude part. The notch filter coefficients are calculated as follows: w Pre-Production, Rev 3.0, February 2007 25 WM8940 a0 = 1 - tan( wb / 2) 1 + tan( wb / 2) Pre-Production a1 = -(1 + a0 ) cos(w0 ) Where: w0 = 2f c / f s wb = 2f b / f s fc = centre frequency in Hz, fb = -3dB bandwidth in Hz, fs = sample frequency in Hz The actual register values can be determined from the coefficients as follows: NFn_A0 = -a0 x 213 NFn_A1 = -a1 x 212 To configure Notch Filter 3 as a 1st order low pass filter, set the NF3_LP bit to 1 and calculate the coefficients as follows: a0 = 0 a1 = Where: tan( wc / 2) - 1 tan( wc / 2) + 1 wc = 2f c / f s fc = cutoff frequency in Hz, fs = sample frequency in Hz The actual register values can be determined from the coefficients as follows: NF3_A0 = 0 NF3_A1 = -a1 x212 DIGITAL ADC VOLUME CONTROL The output of the ADCs can be digitally attenuated over a range from -127dB to 0dB in 0.5dB steps. The gain for a given eight-bit code X is given by: Gain = 0.5 x (x-255) dB for 1 x 255, MUTE for x = 0 REGISTER ADDRESS R15 ADC Digital Volume BIT 7:0 LABEL ADCVOL [7:0] DEFAULT 11111111 ( 0dB ) DESCRIPTION ADC Digital Volume Control 0000 0000 = Digital Mute 0000 0001 = -127dB 0000 0010 = -126.5dB ... 0.5dB steps up to 1111 1111 = 0dB Table 19 ADC Volume w Pre-Production, Rev 3.0, February 2007 26 Pre-Production WM8940 The WM8940 has an automatic PGA gain control circuit, which can function as an input peak limiter or as an automatic level control (ALC). The Automatic Level Control (ALC) provides continuous adjustment of the input PGA in response to the amplitude of the input signal. A digital peak detector monitors the input signal amplitude and compares it to a register defined threshold level (ALCLVL). If the signal is below the threshold, the ALC will increase the gain of the PGA at a rate set by ALCDCY. If the signal is above the threshold, the ALC will reduce the gain of the PGA at a rate set by ALCATK. The ALC has two modes selected by the ALCMODE register: normal mode and peak limiter mode. The ALC/limiter function is enabled by setting the register bit R32[8] ALCSEL. INPUT LIMITER / AUTOMATIC LEVEL CONTROL (ALC) REGISTER ADDRESS BIT LABEL ALCMIN [2:0] DEFAULT 000 (-12dB) DESCRIPTION Set minimum gain of PGA 000 = -12dB 001 = -6dB 010 = 0dB 011 = +6dB 100 = +12dB 101 = +18dB 110 = +24dB 111 = +30dB Set Maximum Gain of PGA 111 = +35.25dB 110 = +29.25dB 101 = +23.25dB 100 = +17.25dB 011 = +11.25dB 010 = +5.25dB 001 = -0.75dB 000 = -6.75dB ALC function select 0 = ALC disabled 1 = ALC Enabled ALC target - sets signal level at ADC input 1111 = -1.5dBFS 1110 = -1.5dBFS 1101 = -3dBFS 1100 = -4.5dBFS 1011 = -6dBFS 1010 = -7.5dBFS 1001 = -9dBFS 1000 = -10.5dBFS 0111 = -12dBFS 0110 = -13.5dBFS 0101 = -15dBFS 0100 = -16.5dBFS 0011 = -18dBFS 0010 = -19.5dBFS 0001 = -21dBFS 0000 = -22.5dBFS R32 (20h) 2:0 ALC Control 1 5:3 ALCMAX [2:0] 111 (+35.25dB) 8 ALCSEL 00 3:0 R33 (21h) ALC Control 2 ALCLVL [3:0] 1011 (-6dB) w Pre-Production, Rev 3.0, February 2007 27 WM8940 REGISTER ADDRESS BIT 7:4 LABEL ALCHLD [3:0] DEFAULT 0000 (0ms) Pre-Production DESCRIPTION ALC hold time before gain is increased. 0000 = 0ms 0001 = 2.67ms 0010 = 5.33ms 0011 = 10.66ms 0100 = 21.32ms 0101 = 42.64ms 0110 = 85.28ms 0111 = 0.17s 1000 = 0.34s 1001 = 0.68s 1010 or higher = 1.36s Determines the ALC mode of operation: 0 = ALC mode (Normal Operation) 1 = Limiter mode. Decay (gain ramp-up) time (ALCMODE ==0) Per step 0000 0001 0010 1010 or higher 0011 (5.8ms/6dB) 410us 820us 1.64ms 420ms Per 6dB 3.38ms 6.56ms 13.1ms 3.36s 90% of range 23.6ms 47.2ms 94.5ms 24.2s R34 (22h) 8 ALC Control 3 7:4 ALCMODE 0 ALCDCY [3:0] 0011 (26ms/6dB) ... (time doubles with every step) Decay (gain ramp-up) time (ALCMODE ==1) Per step 0000 0001 0010 1010 90.8us 182us 363us 93ms Per 6dB 726us 1.45ms 2.91ms 744ms 90% of range 5.23ms 10.5ms 20.9ms 5.36s ... (time doubles with every step) 3:0 ALCATK [3:0] 0010 (3.3ms/6dB) ALC attack (gain ramp-down) time (ALCMODE == 0) Per step 0000 0001 0010 104us 208us 416us Per 6dB 832us 1.66ms 3.33ms 852ms 90% of range 6ms 12ms 24ms 6.13s ... (time doubles with every step) 1010 or 106ms higher 0010 (726us/6dB) ALC attack (gain ramp-down) time (ALCMODE == 1) Per step 0000 0001 0010 22.7us 45.4us 90.8us Per 6dB 182.4us 363us 726us 90% of range 1.31ms 2.62ms 5.23ms ... (time doubles with every step) w Pre-Production, Rev 3.0, February 2007 28 Pre-Production REGISTER ADDRESS BIT LABEL DEFAULT 1010 or higher R42 (2Ah) 1 ALC Control 4 ALCZC 0 (zero cross off) DESCRIPTION 23.2ms 186ms WM8940 1.34s ALC uses zero cross detection circuit. 0 = Disabled (recommended) 1 = Enabled Table 20 ALC Control Registers When the ALC is disabled, the input PGA remains at the last controlled value of the ALC. An input gain update must be made by writing to the INPPGAVOLL/R register bits. NORMAL MODE In normal mode, the ALC will attempt to maintain a constant signal level by increasing or decreasing the gain of the PGA. The following diagram shows an example of this. Figure 12 ALC Normal Mode Operation w Pre-Production, Rev 3.0, February 2007 29 WM8940 LIMITER MODE Pre-Production In limiter mode, the ALC will reduce peaks that go above the threshold level, but will not increase the PGA gain beyond the starting level. The starting level is the PGA gain setting when the ALC is enabled in limiter mode. If the ALC is started in limiter mode, this is the gain setting of the PGA at start-up. If the ALC is switched into limiter mode after running in ALC mode, the starting gain will be the gain at switchover. The diagram below shows an example of limiter mode. Figure 13 ALC Limiter Mode Operation ATTACK AND DECAY TIMES The attack and decay times set the update times for the PGA gain. The attack time is the time constant used when the gain is reducing. The decay time is the time constant used when the gain is increasing. In limiter mode, the time constants are faster than in ALC mode. The time constants are shown below in terms of a single gain step, a change of 6dB and a change of 90% of the PGAs gain range. Note that, these times will vary slightly depending on the sample rate used (specified by the SR register). w Pre-Production, Rev 3.0, February 2007 30 Pre-Production WM8940 NORMAL MODE ALCMODE = 0 (Normal Mode) ALCATK 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 tATK 104s 208s 416s 832s 1.66ms 3.33ms 6.66ms 13.3ms 26.6ms 53.2ms 106ms Attack Time (s) tATK6dB tATK90% 832s 6ms 1.66ms 12ms 3.33ms 24ms 6.66ms 48ms 13.3ms 96ms 26.6ms 192ms 53.2ms 384ms 106ms 767ms 213.2ms 1.53s 426ms 3.07s 852ms 6.13s ALCMODE = 0 (Normal Mode) ALCDCY 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 tDCY 410s 820s 1.64ms 3.28ms 6.56ms 13.1ms 26.2ms 52.5ms 105ms 210ms 420ms Decay Time (s) tDCY6dB tDCY90% 3.28ms 23.6ms 6.56ms 47.2ms 13.1ms 94.5ms 26.2ms 189ms 52.5ms 378ms 105ms 756ms 210ms 1.51s 420ms 3.02s 840ms 6.05s 1.68s 12.1s 3.36s 24.2s Table 21 ALC Normal Mode (Attack and Decay times) w Pre-Production, Rev 3.0, February 2007 31 WM8940 LIMITER MODE Pre-Production ALCMODE = 1 (Limiter Mode) ALCATK 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 tATKLIM 22.7s 45.4S 90.8S 182S 363S 726S 1.45ms 2.9ms 5.81ms 11.6ms 23.2ms Attack Time (s) tATKLIM6dB tATKLIM90% 182s 1.31ms 363s 2.62ms 726s 5.23ms 1.45ms 10.5ms 2.91ms 20.9ms 5.81ms 41.8ms 11.6ms 83.7ms 23.2ms 167ms 46.5ms 335ms 93ms 669ms 186ms 1.34s ALCMODE = 1 (Limiter Mode) ALCDCY 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 tDCYLIM 90.8s 182S 363S 726S 1.45ms 2.91ms 5.81ms 11.6ms 23.2ms 46.5ms 93ms Attack Time (s) tDCYLIM6dB tDCYLIM90% 726s 5.23ms 1.45ms 10.5ms 2.91ms 20.9ms 5.81ms 41.8ms 11.6ms 83.7ms 23.2ms 167ms 46.5ms 335ms 93ms 669ms 186ms 1.34s 372ms 2.68s 744ms 5.36s Table 22 ALC Limiter Mode (Attack and Decay times) w Pre-Production, Rev 3.0, February 2007 32 Pre-Production WM8940 MINIMUM AND MAXIMUM GAIN The ALCMIN and ALCMAX register bits set the minimum/maximum gain value that the PGA can be set to whilst under the control of the ALC. This has no effect on the PGA when ALC is not enabled. REGISTER ADDRESS BIT LABEL ALCMAX ALCMIN DEFAULT 111 000 DESCRIPTION Set Maximum Gain of PGA Set minimum gain of PGA R32 5:3 ALC Control 1 2:0 Table 23 ALC Max/Min Gain In normal mode, ALCMAX sets the maximum boost which can be applied to the signal. In limiter mode, ALCMAX will normally have no effect (assuming the starting gain value is less than the maximum gain specified by ALCMAX) because the maximum gain is set at the starting gain level. ALCMIN sets the minimum gain value which can be applied to the signal. Figure 14 ALC Min/Max Gain ALCMAX 111 110 101 100 011 010 001 000 Maximum Gain (dB) 35.25 29.25 23.25 17.25 11.25 5.25 -0.75 -6.75 Table 24 ALC Max Gain Values w Pre-Production, Rev 3.0, February 2007 33 WM8940 ALCMIN 000 001 010 011 100 101 110 111 Minimum Gain (dB) -12 -6 0 6 12 18 24 30 Pre-Production Table 25 ALC Min Gain Values Note that if the ALC gain setting strays outside the ALC operating range, either by starting the ALC outside of the range or changing the ALCMAX or ALCMIN settings during operation, the ALC will immediately adjust the gain to return to the ALC operating range. It is recommended that the ALC starting gain is set between the ALCMAX and ALCMIN limits. ALC HOLD TIME (NORMAL MODE ONLY) In Normal mode, the ALC has an adjustable hold time which sets a time delay before the ALC begins its decay phase (gain increasing). The hold time is set by the ALCHLD register. REGISTER ADDRESS BIT LABEL ALCHLD DEFAULT 0000 DESCRIPTION ALC hold time before gain is increased. R33 7:4 ALC Control 2 Table 26 ALC Hold Time If the hold time is exceeded this indicates that the signal has reached a new average level and the ALC will increase the gain to adjust for that new average level. If the signal goes above the threshold during the hold period, the hold phase is abandoned and the ALC returns to normal operation. w Pre-Production, Rev 3.0, February 2007 34 Pre-Production WM8940 Figure 15 ALCLVL w Pre-Production, Rev 3.0, February 2007 35 WM8940 Pre-Production Figure 16 ALC Hold Time ALCHLD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 tHOLD (s) 0 2.67ms 5.34ms 10.7ms 21.4ms 42.7ms 85.4ms 171ms 342ms 684ms 1.37s Table 27 ALC Hold Time Values w Pre-Production, Rev 3.0, February 2007 36 Pre-Production WM8940 PEAK LIMITER To prevent clipping when a large signal occurs just after a period of quiet, the ALC circuit includes a limiter function. If the ADC input signal exceeds 87.5% of full scale (-1.16dB), the PGA gain is ramped down at the maximum attack rate (as when ALCATK = 0000), until the signal level falls below 87.5% of full scale. This function is automatically enabled whenever the ALC is enabled. Note: If ALCATK = 0000, then the limiter makes no difference to the operation of the ALC. It is designed to prevent clipping when long attack times are used. NOISE GATE (NORMAL MODE ONLY) When the signal is very quiet and consists mainly of noise, the ALC function may cause "noise pumping", i.e. loud hissing noise during silence periods. The WM8940 has a noise gate function that prevents noise pumping by comparing the signal level at the input pins against a noise gate threshold, NGTH. The noise gate cuts in when: Signal level at ADC [dBFS] < NGTH [dBFS] + PGA gain [dB] + Mic Boost gain [dB] This is equivalent to: Signal level at input pin [dBFS] < NGTH [dBFS] The PGA gain is then held constant (preventing it from ramping up as it normally would when the signal is quiet). The table below summarises the noise gate control register. The NGTH control bits set the noise gate threshold with respect to the ADC full-scale range. The threshold is adjusted in 6dB steps. Levels at the extremes of the range may cause inappropriate operation, so care should be taken with set-up of the function. The noise gate only operates in conjunction with the ALC and cannot be used in limiter mode. REGISTER ADDRESS R35 (23h) ALC Noise Gate Control BIT 2:0 LABEL NGTH DEFAULT 000 DESCRIPTION Noise gate threshold: 000 = -39dB 001 = -45dB 010 = -51db 011 = -57dB 100 = -63dB 101 = -69dB 110 = -75dB 111 = -81dB Noise gate function enable 1 = enable 0 = disable 3 NGATEN 0 Table 28 ALC Noise Gate Control w Pre-Production, Rev 3.0, February 2007 37 WM8940 Pre-Production The diagrams below show the response of the system to the same signal with and without noise gate. Figure 17 ALC Operation Above Noise Gate Threshold w Pre-Production, Rev 3.0, February 2007 38 Pre-Production WM8940 Figure 18 Noise Gate Operation w Pre-Production, Rev 3.0, February 2007 39 WM8940 OUTPUT SIGNAL PATH Pre-Production The WM8940 output signal paths consist of digital application filters, up-sampling filters, a Hi-Fi DAC, analogue mixers, speaker and mono output drivers. The digital filters and DAC are enabled by bit DACEN. The mixers and output drivers can be separately enabled by individual control bits (see Analogue Outputs). Thus it is possible to utilise the analogue mixing and amplification provided by the WM8940, irrespective of whether the DACs are running or not. The WM8940 DAC receives digital input data on the DACDAT pin. The digital filter block processes the data to provide the following functions: Digital volume control A digital peak limiter. Sigma-Delta Modulation The high performance sigma-delta audio DAC converts the digital data into an analogue signal. DAC DIGITAL FILTERS DIGITAL AUDIO INTERFACE DIGITAL GAIN DIGITAL PEAK LIMITER DIGITAL FILTERS INTERP SDM DAC Figure 19 DAC Digital Filter Path The analogue output from the DAC can then be mixed with the AUX analogue input and the ADC analogue input. The mix is fed to the output drivers, SPKOUTP/N, and MONOOUT. MONOOUT: can drive a 16 or 32 headphone or line output or can be a buffered version of VMID (When MONOMUTE=1). SPKOUTP/N: can drive a 16 or 32 stereo headphone or stereo line output, or an 8 BTL mono speaker. DIGITAL HI-FI DAC VOLUME CONTROL The signal volume from each Hi-Fi DAC can be controlled digitally. The gain and attenuation range is -127dB to 0dB in 0.5dB steps. The level of attenuation for an eight-bit code X is given by: 0.5 x (X-255) dB for 1 X 255; REGISTER ADDRESS R11 DAC Digital Volume BIT 7:0 LABEL DACVOL [7:0] MUTE for X = 0 DEFAULT 11111111 ( 0dB ) DESCRIPTION DAC Digital Volume Control 0000 0000 = Digital Mute 0000 0001 = -127dB 0000 0010 = -126.5dB ... 0.5dB steps up to 1111 1111 = 0dB Table 29 DAC Volume w Pre-Production, Rev 3.0, February 2007 40 Pre-Production WM8940 HI-FI DIGITAL TO ANALOGUE CONVERTER (DAC) The DAC is enabled by the DACEN register bit. REGISTER ADDRESS R3 Power Management 3 Table 30 DAC Enable The WM8940 also has a Soft Mute function, which gradually attenuates the volume of the digital signal to zero. When removed, the gain will step back up to the digital gain setting. This function is disabled by default. To play back an audio signal, it must first be disabled by setting the DACMU bit to zero. 0 BIT LABEL DACEN DEFAULT 0 DESCRIPTION DAC enable 0 = DAC disabled 1 = DAC enabled REGISTER ADDRESS R10 DAC Control BIT 6 LABEL DACMU 0 DEFAULT DESCRIPTION DAC soft mute enable 0 = DACMU disabled 1 = DACMU enabled Table 31 DAC Control Register The digital audio data is converted to over sampled bit streams in the on-chip, true 24-bit digital interpolation filters. The bit stream data enters a multi-bit, sigma-delta DAC, which converts it to a high quality analogue audio signal. The multi-bit DAC architecture reduces high frequency noise and sensitivity to clock jitter. The DAC output defaults to non-inverted. Setting DACPOL will invert the DAC output phase. AUTOMUTE The DAC has an automute function which applies an analogue mute when 1024 consecutive zeros are detected. The mute is released as soon as a non-zero sample is detected. Automute can be enabled using the AMUTE control bit. REGISTER ADDRESS R10 DAC Control BIT 2 LABEL AMUTE 0 DEFAULT DESCRIPTION DAC auto mute enable 0 = auto mute disabled 1 = auto mute enabled Table 32 DAC Auto Mute Control Register w Pre-Production, Rev 3.0, February 2007 41 WM8940 DAC OUTPUT LIMITER Pre-Production The WM8940 has a digital output limiter function. The operation of this is shown in Figure 20. In this diagram the upper graph shows the envelope of the input/output signals and the lower graph shows the gain characteristic. Figure 20 DAC Digital Limiter Operation The limiter has a programmable upper threshold which is close to 0dB. Referring to Table 33, in normal operation (LIMBOOST=000 => limit only) signals below this threshold are unaffected by the limiter. Signals above the upper threshold are attenuated at a specific attack rate (set by the LIMATK register bits) until the signal falls below the threshold. The limiter also has a lower threshold 1dB below the upper threshold. When the signal falls below the lower threshold the signal is amplified at a specific decay rate (controlled by LIMDCY register bits) until a gain of 0dB is reached. Both threshold levels are controlled by the LIMLVL register bits. The upper threshold is 0.5dB above the value programmed by LIMLVL and the lower threshold is 0.5dB below the LIMLVL value. VOLUME BOOST The limiter has programmable upper gain which boosts signals below the threshold to compress the dynamic range of the signal and increase its perceived loudness. This operates as an ALC function with limited boost capability. The volume boost is from 0dB to +12dB in 1dB steps, controlled by the LIMBOOST register bits. The output limiter volume boost can also be used as a stand alone digital gain boost when the limiter is disabled. w Pre-Production, Rev 3.0, February 2007 42 Pre-Production WM8940 REGISTER ADDRESS R24 8 DAC digital limiter control 1 7:4 BIT LABEL LIMEN 0 DEFAULT DESCRIPTION Enable the DAC digital limiter: 0=disabled 1=enabled Limiter Decay time (per 6dB gain change) for 44.1kHz sampling. Note that these will scale with sample rate: 0000=750us 0001=1.5ms 0010=3ms 0011=6ms 0100=12ms 0101=24ms 0110=48ms 0111=96ms 1000=192ms 1001=384ms 1010=768ms 3:0 LIMATK 0010 1011 to 1111=1.536s Limiter Attack time (per 6dB gain change) for 44.1kHz sampling. Note that these will scale with sample rate. 0000=94us 0001=188s 0010=375us 0011=750us 0100=1.5ms 0101=3ms 0110=6ms 0111=12ms 1000=24ms 1001=48ms 1010=96ms 1011 to 1111=192ms 6:4 R25 DAC digital limiter control 2 LIMLVL 000 Programmable signal threshold level (determines level at which the limiter starts to operate) 000=-1dB 001=-2dB 010=-3dB 011=-4dB 100=-5dB 101 to 111=-6dB LIMDCY 0011 w Pre-Production, Rev 3.0, February 2007 43 WM8940 REGISTER ADDRESS BIT 3:0 LABEL LIMBOOST DEFAULT 0000 Pre-Production DESCRIPTION Limiter volume boost (can be used as a stand alone volume boost when LIMEN=0): 0000 = 0dB 0001 = +1dB 0010 = +2dB 0011 = +3dB 0100 = +4dB 0101 = +5dB 0110 = +6dB 0111 = +7dB 1000 = +8dB 1001 = +9dB 1010 = +10dB 1011 = +11dB 1100 = +12dB 1101 to 1111 = reserved Table 33 DAC Digital Limiter Control ANALOGUE OUTPUTS The WM8940 has a single MONO output and two outputs SPKOUTP and SPOUTN for driving a mono BTL speaker. These analogue output stages are supplied from SPKVDD and are capable of driving up to 1V rms signals. SPKOUTP/SPKOUTN OUTPUTS The SPKOUT pins can drive a single bridge tied 8 speaker or two headphone loads of 16 or 32 or a line output (see Headphone Output and Line Output sections, respectively). The signal to be output on SKPKOUT comes from the Speaker Mixer circuit and can be any combination of the DAC output, the Bypass path (output of the boost stage) and the AUX input. The SPKOUTP/N volume is controlled by the SPKVOL register bits. Note that gains over 0dB may cause clipping if the signal is large. The SPKMUTE register bit causes the speaker outputs to be muted (the output DC level is driven out). The output pins remains at the same DC level (VMIDOP), so that no click noise is produced when muting or un-muting. The SPKOUTN pin always drives out an inverted version of the SPKOUTP signal. REGISTER ADDRESS R50 Speaker mixer control 5 BIT LABEL AUX2SPK DEFAULT 0 DESCRIPTION Output of auxiliary amplifier to speaker mixer input 0 = not selected 1 = selected Bypass path (output of input boost stage) to speaker mixer input 0 = not selected 1 = selected Output of DAC to speaker mixer input 0 = not selected 1 = selected Attenuation control for bypass path (output of input boost stage) to speaker mixer input 0 = 0dB 1 = -10dB 1 BYP2SPK 0 0 DAC2SPK 0 R54 Bypass path attenuation control 8 SPKATTN 0 Table 34 Speaker Mixer Control w Pre-Production, Rev 3.0, February 2007 44 Pre-Production WM8940 REGISTER ADDRESS R54 Speaker volume control 7 BIT LABEL SPKZC DEFAULT 0 DESCRIPTION Speaker Volume control zero cross enable: 1 = Change gain on zero cross only 0 = Change gain immediately Speaker output mute enable 0=Speaker output enabled 1=Speaker output muted (VMIDOP) Speaker Volume Adjust 111111 = +6dB 111110 = +5dB ... (1.0 dB steps) 111001=0dB ... 000000=-57dB 6 SPKMUTE 1 5:0 SPKVOL [5:0] 111001 (0dB) Table 35 SPKOUT Volume Control ZERO CROSS TIMEOUT A zero-cross timeout function is also provided so that if zero cross is enabled on the input or output PGAs the gain will automatically update after a timeout period if a zero cross has not occurred. This is enabled by setting SLOWCLKEN. The timeout period is either 31Hz or 47Hz. REGISTER ADDRESS R7 Additional control 0 BIT LABEL SLOWCLKEN DEFAULT 0 DESCRIPTION Slow clock enable. Used for both the jack insert detect de-bounce circuit and the zero cross timeout. 0 = slow clock disabled 1 = slow clock enabled Table 36 Timeout Clock Enable Control MONO MIXER AND OUTPUT The MONOOUT pin can drive a 16 or 32 headphone or a line output or be used as a DC reference for a headphone output (see Headphone Output section). It can be selected to drive out any combination of DAC, Bypass (output of input BOOST stage) and AUX. This output is enabled by setting bit MONOEN. w Pre-Production, Rev 3.0, February 2007 45 WM8940 REGISTER ADDRESS R56 Mono mixer control BIT 7 LABEL MONOATTN DEFAULT 0 Pre-Production DESCRIPTION Attenuation control for bypass path (output of input boost stage) to mono mixer input 0 = 0dB 1 = -10dB 0=No mute 1=Output muted. During mute the mono output will output VMID which can be used as a DC reference for a headphone out. Output of Auxilary amplifier to mono mixer input: 0 = not selected 1 = selected Bypass path (output of input boost stage) to mono mixer input 0 = non selected 1 = selected Output of DAC to mono mixer input 0 = not selected 1 = selected 6 MONOMUTE 0 2 AUX2MONO 0 1 BYP2MONO 0 0 DAC2MONO 0 Table 37 Mono Mixer Control ENABLING THE OUTPUTS Each analogue output of the WM8940 can be separately enabled or disabled. The analogue mixer associated with each output has a separate enable. All outputs are disabled by default. To save power, unused parts of the WM8940 should remain disabled. Outputs can be enabled at any time, but it is not recommended to do so when BUFIO is disabled (BUFIOEN=0), as this may cause pop noise (see "POP Minimisation" section). REGISTER ADDRESS R1 Power management 1 R3 Power management 3 3 2 7 6 5 3 2 BIT LABEL BIASEN BUFIOEN MONOEN SPKNEN SPKPEN SPKMIXEN 0 0 0 0 0 0 DEFAULT DESCRIPTION Analogue amplifiers bias enable VMID buffer enable MONOOUT enable SPKOUTN enable SPKOUTP enable Mono mixer enable Speaker Mixer enable MONOMIXEN 0 Note: All "Enable" bits are 1 = ON, 0 = OFF Table 38 Output Stages Power Management Control UNUSED ANALOGUE INPUTS/OUTPUTS Whenever an analogue input/output is disabled, it remains connected to AVDD/2 through a resistor. This helps to prevent pop noise when the output is re-enabled. The resistance between the voltage buffer and the output pins can be controlled using the VROI control bit. The default impedance is low, so that any capacitors on the outputs can charge up quickly at start-up. If a high impedance is desired for disabled outputs, VROI can then be set to 1, increasing the resistance to about 30k. w Pre-Production, Rev 3.0, February 2007 46 Pre-Production WM8940 REGISTER ADDRESS R49 0 BIT LABEL VROI 0 DEFAULT DESCRIPTION VREF (AVDD/2) to analogue output resistance 0: approx 1k 1: approx 30 k Table 39 Disabled Outputs to VREF Resistance A dedicated buffer is available for tying off unused analogue I/O pins as shown in Figure 21. This buffer can be enabled using the BUFIOEN register bit. Table 40 summarises the tie-off options for the speaker and mono output pins. Figure 21 Unused Input/Output Pin Tie-off Buffers MONOEN/ SPKN/PEN 0 0 1 VROI 0 1 X OUTPUT CONFIGURATION 1k tieoff to AVDD/2 30k tieoff to AVDD/2 Output enabled (DC level=AVDD/2) Table 40 Unused Output Pin Tie-off Options OUTPUT SWITCH When the device is configured with a 2-wire interface the CSB/GPIO pin can be used as a switch control input to automatically disable the speaker outputs and enable the mono output. As an example when a line is plugged into a jack socket. In this mode, enabled by setting GPIOSEL=001, pin CSB/GPIO switches between mono and speaker outputs (e.g. when pin 12 is connected to a mechanical switch in the headphone socket to detect plug-in). The GPIOPOL bit reverses the polarity of the CSB/GPIO input pin. Note that the speaker outputs and the mono output must be enabled for this function to work (see Table 41). The CSB/GPIO pin has an internal de-bounce circuit when in this mode in order to prevent the output enables from toggling multiple times due to input glitches. This de-bounce circuit is clocked from a slow clock with period 221 x MCLK, enabled using the SLOWCLKEN register bit. w Pre-Production, Rev 3.0, February 2007 47 WM8940 GPIOPOL CSB/GPIO SPKNEN/ SPKPEN 0 1 X X X X 0 1 X X 0 1 0 1 X X MONOEN SPEAKER ENABLED No Yes No No No No No Yes Pre-Production MONO OUTPUT ENABLED No No No Yes No Yes No No 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 Table 41 Output Switch Operation (GPIOSEL=001) THERMAL SHUTDOWN The speaker outputs can drive very large currents. To protect the WM8940 from overheating a thermal shutdown circuit is included. The thermal shutdown can be configured to produce an interrupt when the device reaches approximately 125oC. See General Purpose Input/Output section. REGISTER ADDRESS R49 Output control 1 BIT LABEL TSDEN 1 DEFAULT DESCRIPTION Thermal Shutdown Enable 0 : thermal shutdown disabled 1 : thermal shutdown enabled Table 42 Thermal Shutdown SPEAKER OUTPUT SPKOUTP/N can differentially drive a mono 8 Bridge Tied Load (BTL) speaker as shown below. Figure 22 Speaker Output Connection w Pre-Production, Rev 3.0, February 2007 48 Pre-Production WM8940 HEADPHONE OUTPUT The speaker outputs can drive a 16 or 32 headphone load, either through DC blocking capacitors, or DC coupled without any capacitor. Headphone Output using DC Blocking Capacitors: DC Coupled Headphone Output: Figure 23 Recommended Headphone Output Configurations When DC blocking capacitors are used, then their capacitance and the load resistance together determine the lower cut-off frequency, fc. Increasing the capacitance lowers fc, improving the bass response. Smaller capacitance values will diminish the bass response. Assuming a 16 load and C1 = 220F: fc = 1 / 2 RLC1 = 1 / (2 x 16 x 220F) = 45 Hz In the DC coupled configuration, the headphone "ground" is connected to the MONOOUT pin. The MONOOUT pin can be configured as a DC output driver by setting the MONOMUTE register bit. The DC voltage on MONOOUT in this configuration is equal to the DC offset on the SPROUTP and SPKOUTN pins therefore no DC blocking capacitors are required. This saves space and material cost in portable applications. It is recommended to connect the DC coupled outputs only to headphones, and not to the line input of another device. Although the built-in short circuit protection will prevent any damage to the headphone outputs, such a connection may be noisy, and may not function properly if the other device is grounded. MONO OUTPUT The mono output, can be used as a line output, a headphone output or as a pseudo ground for capless driving of loads by SPKOUT. Recommended external components are shown below. Figure 24 Recommended Circuit for Line Output The DC blocking capacitors and the load resistance together determine the lower cut-off frequency, fc. Assuming a 10 k load and C1 = 1F: fc = 1 / 2 (RL+R1) C1 = 1 / (2 x 10.1k x 1F) = 16 Hz Increasing the capacitance lowers fc, improving the bass response. Smaller values of C1 will diminish the bass response. The function of R1 is to protect the line outputs from damage when used improperly. w Pre-Production, Rev 3.0, February 2007 49 WM8940 DIGITAL AUDIO INTERFACES The audio interface has four pins: * * * * ADCDAT: ADC data output DACDAT: DAC data input FRAME: Data alignment clock BCLK: Bit clock, for synchronisation Pre-Production The clock signals BCLK, and FRAME can be outputs when the WM8940 operates as a master, or inputs when it is a slave (see Master and Slave Mode Operation, below). Four different audio data formats are supported: * * * * Left justified Right justified IS DSP mode A / B 2 All of these modes are MSB first. They are described in Audio Data Formats, below. Refer to the Electrical Characteristic section for timing information. MASTER AND SLAVE MODE OPERATION The WM8940 audio interface may be configured as either master or slave. As a master interface device the WM8940 generates BCLK and FRAME and thus controls sequencing of the data transfer on ADCDAT and DACDAT. To set the device to master mode register bit MS should be set high. In slave mode (MS=0), the WM8940 responds with data to clocks it receives over the digital audio interfaces. AUDIO DATA FORMATS In Left Justified mode, the MSB is available on the first rising edge of BCLK following an FRAME transition. The other bits up to the LSB are then transmitted in order. Depending on word length, BCLK frequency and sample rate, there may be unused BCLK cycles before each FRAME transition. Figure 25 Left Justified Audio Interface (assuming n-bit word length) In Right Justified mode, the LSB is available on the last rising edge of BCLK before a FRAME transition. All other bits are transmitted before (MSB first). Depending on word length, BCLK frequency and sample rate, there may be unused BCLK cycles after each FRAME transition. w Pre-Production, Rev 3.0, February 2007 50 Pre-Production WM8940 Figure 26 Right Justified Audio Interface (assuming n-bit word length) In I2S mode, the MSB is available on the second rising edge of BCLK following a FRAME transition. The other bits up to the LSB are then transmitted in order. Depending on word length, BCLK frequency and sample rate, there may be unused BCLK cycles between the LSB of one sample and the MSB of the next. Figure 27 I2S Audio Interface (assuming n-bit word length) In DSP/PCM mode, the left channel MSB is available on either the 1st (Mode B) the 2nd (Mode A) rising edge of BCLK (selectable by FRAMEP) following a rising edge of FRAME. Right channel data immediately follows left channel data. Depending on word length, BCLK frequency and sample rate, there may be unused BCLK cycles between the LSB of the right channel data and the next sample. FRAMEP should be set to 0 in this mode. Figure 28 DSP/PCM Mode Audio Interface (Mode A, FRAMEP=0) w Pre-Production, Rev 3.0, February 2007 51 WM8940 1/fs 1 BCLK 1 BCLK falling edge can occur anywhere in this area Pre-Production LRC BCLK LEFT CHANNEL DACDAT / ADCDAT 1 2 3 n-2 n-1 n 1 2 RIGHT CHANNEL 3 n-2 n-1 n MSB Input Word Length (WL) LSB Figure 29 DSP/PCM Mode Audio Interface (Mode B, FRAMEP=1) AUDIO INTERFACE CONTROL The register bits controlling audio format, word length and master / slave mode are summarised below. Register bit MS selects audio interface operation in master or slave mode. In Master mode BCLK, and FRAME are outputs. The frequency of BCLK and FRAME in master mode are controlled with BCLKDIV. These are divided down versions of master clock. This may result in short BCLK pulses at the end of a frame if there is a non-integer ratio of BCLKs to FRAME clocks. REGISTER ADDRESS R4 Audio interface control 9 BIT LABEL LOUTR DEFAULT 0 DESCRIPTION LOUTR control 0=normal 1=Input mono channel data output on both left and right channels BCLK polarity 0=normal 1=inverted Frame clock polarity (for RJ, LJ and I2S formats) 0=normal 1=inverted DSP Mode control 1 = Configures interface so that MSB is available on 1st BCLK rising edge after FRAME rising edge 0 = Configures interface so that MSB is available on 2nd BCLK rising edge after FRAME rising edge Word length 00 = 16 bits 01 = 20 bits 10 = 24 bits 11 = 32 bits (see note) Audio interface Data Format Select: 00=Right Justified 01=Left Justified 2 10=I S format 11= DSP/PCM mode 8 BCP 0 7 FRAMEP 0 6:5 WL 10 4:3 FMT 10 w Pre-Production, Rev 3.0, February 2007 52 Pre-Production REGISTER ADDRESS 2 BIT LABEL DLRSWAP DEFAULT 0 WM8940 DESCRIPTION Controls whether DAC data appears in `right' or `left' phases of FRAME clock: 0=DAC data appear in `left' phase of FRAME 1=DAC data appears in `right' phase of FRAME Controls whether ADC data appears in `right' or `left' phases of FRAME clock: 0=ADC data appear in `left' phase of FRAME 1=ADC data appears in `right' phase of FRAME 8 Bit Word Length Enable Only recommended for use with companding 0=Word Length controlled by WL 1=8 bits 1 ALRSWAP 0 R5 Companding Control 5 WL8 0 Table 43 Audio Interface Control Note: Right Justified Mode will only operate with a maximum of 24 bits. If 32-bit mode is selected the device will operate in 24-bit mode. REGISTER ADDRESS R6 Clock generation control 8 BIT LABEL CLKSEL DEFAULT 1 DESCRIPTION Controls the source of the clock for all internal operation: 0=MCLK 1=PLL output Sets the scaling for either the MCLK or PLL clock output (under control of CLKSEL) 000=divide by 1 001=divide by 1.5 010=divide by 2 011=divide by 3 100=divide by 4 101=divide by 6 110=divide by 8 111=divide by 12 Configures the BCLK and FRAME output frequency, for use when the chip is master over BCLK. 000=divide by 1 (BCLK=MCLK) 001=divide by 2 (BCLK=MCLK/2) 010=divide by 4 011=divide by 8 100=divide by 16 101=divide by 32 110=reserved 111=reserved Sets the chip to be master over FRAME and BCLK 0=BCLK and FRAME clock are inputs 1=BCLK and FRAME clock are outputs generated by the WM8940 (MASTER) 7:5 MCLKDIV 010 4:2 BCLKDIV 000 0 MS 0 Table 44 Clock Control w Pre-Production, Rev 3.0, February 2007 53 WM8940 AUDIO SAMPLE RATES Pre-Production The WM8940 sample rates for the ADC and the DAC are set using the SR register bits. The cutoffs for the digital filters and the ALC attack/decay times stated are determined using these values and assume a 256fs master clock rate. If a sample rate that is not explicitly supported by the SR register settings is required then the closest SR value to that sample rate should be chosen, the filter characteristics and the ALC attack, decay and hold times will scale appropriately. REGISTER ADDRESS R7 Additional control BIT 3:1 SR LABEL DEFAULT 000 DESCRIPTION Approximate sample rate (configures the coefficients for the internal digital filters): 000=48kHz 001=32kHz 010=24kHz 011=16kHz 100=12kHz 101=8kHz 110-111=reserved Table 45 Sample Rate Control MASTER CLOCK AND PHASE LOCKED LOOP (PLL) The WM8940 has an on-chip phase-locked loop (PLL) circuit that can be used to: * * Generate master clocks for the WM8940 audio functions from another external clock, e.g. in telecoms applications. Generate an output clock, on pin CSB/GPIO, for another part of the system (derived from an existing audio master clock). Figure 30 shows the PLL and internal clocking arrangement on the WM8940. The PLL is enabled or disabled by the PLLEN register bit. Note: In order to minimise current consumption, the PLL is disabled when the VMIDSEL[1:0] bits are set to 00b. VMIDSEL[1:0] must be set to a value other than 00b to enable the PLL. REGISTER ADDRESS R1 Power management 1 5 BIT LABEL PLLEN DEFAULT 0 PLL enable 0=PLL off 1=PLL on DESCRIPTION Table 46 PLLEN Control Bit w Pre-Production, Rev 3.0, February 2007 54 Pre-Production WM8940 Figure 30 PLL and Clock Select Circuit The PLL frequency ratio R = f2/f1 (see Figure 30) can be set using the register bits PLLK and PLLN. N controls the ratio of the division, and K the fractional part. The nominal output frequency of the PLL (PLL_OUT) is 98.304MHz. The PLL output then passes through a fixed divide by 4, and can also be further divided by MCLKDIV[3:0] (see figure 34). The divided clock (SYSCLK) can be used to clock the WM8940 DSP. REGISTER ADDRESS R36 PLL N value BIT 7 LABEL PLL_POWERDOWN DEFAULT 0 DESCRIPTION PLL POWER 0=ON 1=OFF Fractional Divide within the PLL 0=Disabled (Lower Power) 1=Enabled 00 = MCLK input multiplied by 2 (default) 01 = MCLK input not divided (default) 10 = Divide MCLK by 2 before input to PLL 11 = Divide MCLK by 4 before input to PLL Integer (N) part of PLL input/output frequency ratio. Use values greater than 5 and less than 13. Fractional (K) part of PLL1 input/output frequency ratio (treat as one 24-digit binary number). 6 FRACEN 1 5:4 PLLPRESCALE 00 3:0 PLLN 1100 R37 PLL K value 1 R38 PLL K Value 2 R39 PLL K Value 3 5:0 8:0 8:0 PLLK [23:18] PLLK [17:9] PLLK [8:0] 0Ch 093h 0E9h Table 47 PLL Frequency Ratio Control w Pre-Production, Rev 3.0, February 2007 55 WM8940 INTEGER N DIVISION Pre-Production The integer division ratio (N) is determined by N[3:0] and must be in the range 5 to 12. If the PLL frequency is an exact integer (5,6,7,8,9,10,11,12) then FRAC_EN can be set to 0 for low power operation. INPUT CLOCK (PLL_IN) 11.2896MHz 12.288MHz DESIRED PLL OUTPUT (PLL_OUT) 90.3168MHz 98.304MHz DIVISION REQUIRED (X) 8 8 FRACTIONAL DIVISION (K) 0 0 INTEGER DIVISION (N) 8 8 SDM 0 0 Table 48 PLL Modes of Operation (Integer N mode) FRACTIONAL K MODE The Fractional K bits provides K[23:0] provide finer divide resolution for the PLL frequency ratio (up to 1/224). If these are used then FRAC_EN must be set. The relationship between the required division X, the fractional division K[23:0] and the integer division N[3:0] is: K=2 23 ( X - N) where 0 < (X - N) < 1 and K is rounded to the nearest whole number. For example, if the PLL input clock (PLL_IN) is 13MHz and the desired PLL output clock (PLLCLK) is 98.304MHz then the desired division, X, is 7.561800. So N[3:0] will be 7h and K[23:0] will be 23F400h to produce the desired 98.304MHz clock. The PLL performs best when f2 is around 90MHz. Its stability peaks at N=8. Some example settings are shown in Table 49. MCLK (MHz) (F1) 12 12 13 13 14.4 14.4 19.2 19.2 19.68 19.68 19.8 19.8 24 24 26 26 27 27 DESIRED OUTPUT (MHz) 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 11.29 12.288 F2 (MHz) 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 90.3168 98.304 PRESCALE DIVIDE MCLK/2 MCLK/2 MCLK/2 MCLK/2 MCLK/2 MCLK/2 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 MCLK/4 POSTSCALE DIVIDE (FIXED) 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 R N (Hex) 7 8 6 7 6 6 9 A 9 9 9 9 7 8 6 7 6 7 K (Hex) 86C220 3126E8 F28BD4 8FD525 45A1CA D3A06E 6872AF 3D70A3 2DB492 FD809F 1F76F7 EE009E 86C226 3126E8 F28BD4 8FD525 BOAC93 482296 7.5264 8.192 6.947446 7.561846 6.272 6.826667 9.408 10.24 9.178537 9.990243 9.122909 9.929697 7.5264 8.192 6.947446 7.561846 6.690133 7.281778 Table 49 PLL Frequency Examples w Pre-Production, Rev 3.0, February 2007 56 Pre-Production WM8940 LOOPBACK Setting the ADC_LOOPBACK or DAC_LOOPBACK register bit enables digital loopback. When the ADC_LOOPBACK bit is set the output data from the ADC audio interface is fed directly into the DAC data input. When the DAC_LOOPBACK bit is set the output data from the DAC audio interface is fed directly to the input of the ADC audio interface. COMPANDING The WM8940 supports A-law and -law companding on both transmit (ADC) and receive (DAC) sides. Companding can be enabled on the DAC or ADC audio interfaces by writing the appropriate value to the DAC_COMP or ADC_COMP register bits respectively. If packed mode companding is desired the WL8 register bit is available. It will override the normal audio interface WL bits to give an 8-bit word length. Refer to Table 43 Audio Interface Control for setting the output word length. REGISTER ADDRESS R5 Companding control BIT 6 LABEL DAC_LOOPBACK DEFAULT 0 DESCRIPTION Digital loopback function 0=No DAC loopback 1=Loopback enabled, DAC audio interface output is fed directly into ADC audio interface input. DAC decompanding 00=off 01=reserved 10=-law 11=A-law ADC companding 00=off 01=reserved 10=-law 11=A-law Digital loopback function 0=No ADC loopback 1=Loopback enabled, ADC data output is fed directly into DAC data input. 4:3 DAC_COMP 0 2:1 ADC_COMP 0 0 ADC_LOOPBACK 0 Table 50 Companding Control Companding involves using a piecewise linear approximation of the following equations (as set out by ITU-T G.711 standard) for data compression: -law (where =255 for the U.S. and Japan): F(x) = ln( 1 + |x|) / ln( 1 + ) A-law (where A=87.6 for Europe): F(x) = A|x| / ( 1 + lnA) F(x) = ( 1 + lnA|x|) / (1 + lnA) } for x 1/A } for 1/A x 1 -1 x 1 The companded data is also inverted as recommended by the G.711 standard (all 8 bits are inverted for -law, all even data bits are inverted for A-law). The data will be transmitted as the first 8 MSB's of data. Companding converts 13 bits (-law) or 12 bits (A-law) to 8 bits using non-linear quantization. The input data range is separated into 8 levels, allowing low amplitude signals better precision than that of high amplitude signals. This is to exploit the operation of the human auditory system, where louder sounds do not require as much resolution as quieter sounds. The companded signal is an 8bit word containing sign (1-bit), exponent (3-bits) and mantissa (4-bits). w Pre-Production, Rev 3.0, February 2007 57 WM8940 BIT7 SIGN EXPONENT BIT[6:4] MANTISSA BIT[3:0] Pre-Production Table 51 8-bit Companded Word Composition u-law Companding 1 120 100 Companded Output 80 60 40 20 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Normalised Input 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 Normalised Output Figure 31 u-Law Companding A-law Companding 1 120 100 Companded Output 80 60 40 20 0 0 0.2 0.4 0.6 0.8 1 Normalised Input 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 Normalised Output Figure 32 A-Law Companding w Pre-Production, Rev 3.0, February 2007 58 Pre-Production WM8940 In 2-wire mode, the CSB pin is not required and it can be used as a GPIO pin. In 3 wire mode, the MODE / GPIO can be configured as a GPIO by setting the MODE_GPIO register bit Whichever pin is used for GPIO, it is controlled from the GPIO control register R8. The GPIOSEL bits allow the chosen pin to be configured to perform a variety of useful tasks as shown in Table 57. Note that SLOWCLKEN must be enabled when using the jack detect function. REGISTER ADDRESS R8 GPIO control BIT 5:4 LABEL OPCLKDIV DEFAULT 00 DESCRIPTION PLL Output clock division ratio 00=divide by 1 01=divide by 2 10=divide by 3 11=divide by 4 GPIO Polarity invert 0=Non inverted 1=Inverted CSB/GPIO pin function select: 000=CSB input 001= Jack insert detect 010=Temp ok 011=Amute active 100=SYSCLK clock o/p 101=PLL lock 110=Reserved 111=Reserved GENERAL PURPOSE INPUT/OUTPUT 3 GPIOPOL 0 2:0 GPIOSEL 000 Table 52 CSB/GPIO Control CONTROL INTERFACE SELECTION OF CONTROL MODE AND 2-WIRE MODE ADDRESS The control interface can operate as either a 3-wire or 2-wire interface. The MODE pin determines the 2 or 3 wire mode as shown in Table 57. The WM8940 is controlled by writing to registers through a serial control interface. A control word consists of 24 bits. The first 7 bits (B23 to B16) are address bits that select which control register is accessed. The remaining 16 bits (B15 to B0) are register bits, corresponding to the 16 bits in each control register. MODE Low Hi-Z High INTERFACE FORMAT 2 wire 3 wire 3 wire Table 53 Control Interface Mode Selection USE OF MODE AS A GPIO PIN IN 3-WIRE MODE In 3-wire mode, MODE can be used as a GPIO pin. If MODE is being used as a GPIO output, the partner device doesn't have to drive MDE - the pin will be pulled-up internally causing 3-wire mode will be selected. The GPIO function is enabled by setting the MODE_GPIO register bit. The MODE pin can then be controlled using the GPIO register bits as described in
|