![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
w wm8940 mono codec with speaker driver wolfson microelectronics plc t o receive regular email updates, sign up at http://www.wolfsonmicro.com/enews production data, rev 4.3, november 2011 copyright ? 2011 wolfson microelectronics plc 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 a-law 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. 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 analogue or ?aux? inputs, plus analogue 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
wm8940 production data w pd, rev 4.3, november 2011 2 block diagram production data wm8940 w pd, rev 4.3, november 2011 3 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 ? audio paths overview ................................................................................ 11 ? power consumption .................................................................................... 12 ? signal timing requirements .................................................................... 13 ? system clock timing ............................................................................................. 13 ? audio interface timing ? master mode .......................................................... 13 ? audio interface timing ? slave mode ............................................................. 14 ? control interface timing ? 3-wire mode ...................................................... 15 ? control interface timing ? 2-wire mode ...................................................... 16 ? device description ...................................................................................... 17 ? introduction ........................................................................................................... 17 ? input signal path ................................................................................................... 18 ? analogue to digital converter (adc) ........................................................... 23 ? input limiter / automati c level control (alc) ............................................ 28 ? output signal path ............................................................................................... 42 ? analogue outputs ................................................................................................. 46 ? output switch ......................................................................................................... 50 ? digital audio interfaces ..................................................................................... 53 ? audio sample rates ............................................................................................... 57 ? master clock and phase locked loop (pll) ................................................ 57 ? companding .............................................................................................................. 60 ? general purpose input/output ........................................................................ 62 ? control interface ................................................................................................ 63 ? 3-wire serial control mode .............................................................................. 64 ? readback in 3-wire mode ..................................................................................... 64 ? 2-wire serial control mode .............................................................................. 65 ? resetting the chip ................................................................................................ 66 ? power supplies ....................................................................................................... 66 ? power management .............................................................................................. 68 ? pop minimisation ..................................................................................................... 69 ? register map .................................................................................................. 70 ? register bits by address ................................................................................... 71 ? digital filter characteristics .............................................................. 83 ? terminology ............................................................................................................ 83 ? dac filter responses .......................................................................................... 84 ? adc filter responses .......................................................................................... 84 ? highpass filter ....................................................................................................... 85 ? wm8940 production data w pd, rev 4.3, november 2011 4 notch filters and low pass filter................................................................. 86 ? notch filter worked example .......................................................................... 87 ? applications information ........................................................................ 88 ? recommended external components ........................................................... 88 ? package diagram ......................................................................................... 89 ? important notice ......................................................................................... 90 ? address ..................................................................................................................... 9 0 ? revision history ........................................................................................... 91 ? production data wm8940 w pd, rev 4.3, november 2011 5 pin configuration top view ordering information order code temperature range package moisture sensitivity level package body temperature wm8940cgefl/v -25 ? c to +85 ? c 24-lead qfn (4x4x0.9mm) (pb-free) msl3 260 o c wm8940cgefl/rv -25 ? c to +85 ? c 24-lead qfn (4x4x0.9mm) (pb-free, tape and reel) msl3 260 o c note: reel quantity = 3,500 wm8940 production data w pd, rev 4.3, november 2011 6 pin description pin name type description 1 micbias analogue output microphone bias 2 avdd supply analogue supply 3 agnd supply analogue ground 4 dcvdd supply digital supply (core) 5 dbvdd supply digital supply (input/output) 6 dgnd supply digital ground 7 adcdat digital output adc digital audio data output 8 dacdat digital input dac digital audio data input 9 frame digital input / output dac and adc sample rate clock or frame synch 10 bclk digital input / output digital audio port clock 11 mclk digital input master clock input 12 csb/gpio digital input / output 3-wire control interface chip select or gpio pin. 13 sclk digital input 3-wire control interface clock input / 2-wire control interface clock input 14 sdin digital input / output 3-wire control interfac e data input / 2-wire control interface data input 15 mode / gpio digital input control interface mode selection pin or gpio pin. 16 monoout analogue output mono output 17 spkoutp analogue output speaker output positive 18 spkgnd supply speaker ground 19 spkoutn analogue output speaker output negative 20 spkvdd supply speaker supply 21 aux analogue input auxiliary analogue input 22 vmid reference decoupling for midrail reference voltage 23 micn analogue input microphone negative input (common mode) 24 micp analogue input microphone positive input note: 1. it is recommended that the qfn ground paddle should be connected to analogue ground on the application pcb. 2. refer to the application note wan_0118 on ?guidelines on how to use qfn packages and create associated pcb footprints? production data wm8940 w pd, rev 4.3, november 2011 7 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 oper ating 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 <30 ? c / 85% relative humidity. not normally stored in moisture barrier bag. msl2 = out of bag storage for 1 year at <30 ? c / 60% relative humidity. supplied in moisture barrier bag. msl3 = out of bag storage for 168 hours at <30 ? c / 60% relative humidity. supplied in moisture barrier bag. the moisture sensitivity level for each package type is specified in ordering information. condition min max dbvdd, dcvdd, avdd, spkvdd supply voltages -0.3v +4.2 voltage range digital inputs dgnd -0.3v dvdd +0.3v voltage range analogue inputs agnd -0.3v avdd +0.3v operating temperature range, t a -25 ? c +85 ? c storage temperature prior to soldering 30 ? c max / 85% rh max storage temperature after soldering -65 ? c +150 ? c notes: 1. analogue and digital grounds must always be within 0.3v of each other. 2. all digital and analogue supplies are completely independent from each other. recommended operating conditions parameter symbol test conditions min typ max unit digital supply range (core) dcvdd 1.71 3.6 v digital supply range (buffer) dbvdd 1.71 3.6 v analogue supplies range avdd, spkvdd 1 2.5 3.6 v ground dgnd,agnd, spkgnd 0 v notes: 1. analogue supply voltages must be the digital supply voltages 2. dbvdd must be dcvdd wm8940 production data w pd, rev 4.3, november 2011 8 electrical characteristics test conditions dcvdd = 1.8v, avdd = dbvdd = 3.3v, spkvdd =3.3v, t a = +25 o c, 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 ? single- ended input via lin/rin 1 avdd/3.3 v rms full-scale input signal level ? pseudo-differential input 1,2 avdd*0.7/ 3.3 v rms input pga equivalent input noise inppgavol = +35.25db no input signal 0 to 20khz 76.5 db micn input resistance inppgavol = +35.25db 2 k ? micn input resistance inppgavol = 0db 58.5 k ? micn input resistance inppgavol = -12db 97.5 k ? micp input resistance all gain settings 124.5 k ? input capacitance all analogue input pins 10 pf maximum input pga programmable gain gain adjusted by inppgavol +33.25 +35.25 +37.25 db minimum input pga programmable gain gain adjusted by inppgavol -14 -12 -10 db programmable gain step size guaranteed monotonic 0.75 db input pga mute attenuation inppgamute 92 db input gain boost pgaboost= 0 0 db input gain boost pgaboost = 1 +20 db auxiliary analogue inputs (aux) full-scale input signal level 2 avdd/3.3 v rms input resistance input boost and mixer enabled, at 0db gain 20 k ? input capacitance all analogue inputs 10 pf maximum gain from aux input pga mixers gain adjusted by aux2boostvol +4.0 +6 +7.5 db minimum gain from aux input pga mixers gain adjusted by aux2boostvol -14 -12 -9 db aux2boostvol step size guaranteed monotonic 3 db analogue to digital converter (adc) - input from micn and micp in differential configuration to input pga inppgavo, pgaboost and adcvol = 0db signal to noise ratio 3 snr a-weighted avdd=3.3v 88 91 db total harmonic distortion 4 thd -1dbv input avdd=3.3v -80 -75 db total harmonic distortion + noise 5 thd+n -1dbv input avdd=3.3v -75 -68 db channel separation 6 1khz full scale input signal 100 dbfs production data wm8940 w pd, rev 4.3, november 2011 9 test conditions dcvdd = 1.8v, avdd = dbvdd = 3.3v, spkvdd =3.3v, t a = +25 o c, 1khz signal, fs = 48khz, 24-bit audio data unless otherwise stated. parameter symbol test conditions min typ max unit digital to analogue converter (dac) to mono output with 10k ? / 50pf load and dacvol 0db full-scale output 1 dacvol = 0db avdd/3.3 v rms signal to noise ratio 3 snr a-weighted avdd=spkvdd=3.3v 93 98 db total harmonic distortion 4 thd 0dbfs input avdd=spkvdd=3.3v -80 -75 dbfs total harmonic distortion + noise 5 thd+n 0dbfs input avdd=spkvdd=3.3v -78 -74 dbfs channel separation 6 1khz signal 100 db 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 spkvdd/3.3 v rms signal to noise ratio 3 snr a-weighted avdd=spkvdd=3.3v 94 99 db total harmonic distortion 4 thd full-scale signal avdd=spkvdd=3.3v -90 -85 dbfs total harmonic distortion + noise 5 thd+n full-scale signal avdd=spkvdd=3.3v -87 -82 dbfs channel separation 6 100 db dac to speaker output (spkoutp, spkoutn with 8 ? bridge tied load) bypass mode output power po output power is closely correlated with thd see below total harmonic distortion 4 thd po=350mw, rl = 8 ? spkvdd=3.3v 0.03 -70 -60 % db signal to noise ratio 3 snr a-weighted spkvdd=3.3v 93.5 98 db power supply rejection ratio (50hz-22khz) psrr r l = 8 ? btl 50 db aux in to headphone output (spkoutp, spkoutn with 16r resistive load to gnd) bypass mode signal to noise ratio 3 snr a-weighted spkvdd=3.3v 95 99 db total harmonic distortion 4 thd po=20mw, rl = 16 ? spkvdd=3.3v 0.02 -74 -67 % db microphone bias bias voltage mbvsel=0 0.9*avdd v mbvsel=1 0.65*avdd v bias current source for v micbias within +/-3% 3 ma output noise voltage 1khz to 20khz 15 nv/ ? hz digital input / output input high level v ih 0.7 ? dbvdd v input low level v il 0.3 ? dbvdd v output high level v oh i ol =1ma 0.9 ? dbvdd v output low level v ol i oh -1ma 0.1xdbvdd v input capacitance all digital pins 10 pf wm8940 production data w pd, rev 4.3, november 2011 10 terminology 1. full-scale input and output levels scale in relation to avdd or spkvdd depending upon the input or output used. for example, when avdd = 3.3v, 0dbfs = 1v rms (0dbv). when avdd < 3.3v the absolute level of 0dbfs will decrease with a linear relationship to avdd. 2. input level to rip and lip in differential configurations is limited to a maximum of -3db or performance will be reduced. 3. 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). 4. 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. 5. 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. 6. 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 production data wm8940 w pd, rev 4.3, november 2011 11 audio paths overview digital core dacpol r10[0] dac avdd agnd vref+ vref- dcvdd dgnd dac2spk r50[0] s p k v o l r 5 4 [ 5 : 0 ] spkvdd agnd spkoutn monoout avdd agnd mono mixer + dcvdd dgnd adcpol r14[0] adc avdd agnd vref+ vref- dcvdd dgnd dbvdd dgnd dcvdd dgnd pll avdd agnd hpf limiter + avdd agnd pga mixer a u x 2 b o o s t v o l r 4 7 [ 2 : 0 ] vmid m i c p 2 i n p p g a r 4 4 [ 0 ] a l c / l i m i t e r a u x 2 s p k r 5 0 [ 5 ] b y p 2 s p k r 5 0 [ 1 ] d a c 2 m o n o r 5 6 [ 0 ] a u x 2 m o n o r 5 6 [ 2 ] b y p l 2 m o n o r 5 6 [ 1 ] m o n o m u t e r 5 6 [ 6 ] v m i d 1 6 o h m m i n 8 o h m m i n ( b t l s p e a k e r ) wm8940 audio signal paths n o t c h f i l t e r m i c p m i c n d a c d a t a d c d a t s p k o u t p a v d d a g n d speaker mixer + m i c n 2 i n p p g a r 4 4 [ 1 ] a u x 2 i n p p g a r 4 4 [ 2 ] digital audio interface m o n o a t t n r 5 6 [ 7 ] s p k a t t n r 5 4 [ 8 ] s p k m u t e r 5 4 [ 6 ] v m i d i n p p g a m u t e r 4 5 [ 6 ] - k a u x - + i n p p g a v o l r 4 5 [ 5 : 0 ] a l c s e l [ 1 ] r 3 2 [ 8 ] f r o m a l c p g a b o o s t r 4 7 [ 8 ] a u x m o d e r 4 4 [ 3 ] a u x 2 b o o s t v o l r 4 7 [ 2 : 0 ] = 0 0 0 m i c 2 b o o s t v o l r 4 7 [ 6 : 4 ] m i c 2 b o o s t v o l r 4 7 [ 6 : 4 ] = 0 0 0 ) d i f f e r e n t i a l / s i n g l e - e n d e d m i c pga wm8940 production data w pd, rev 4.3, november 2011 12 power consumption typical current consumption for various scenarios is shown below. mode avdd (3v3) ma spkvdd (3v3) ma dcvdd (1.8v) ma dbvdd (1.8v) ua total power (mw) power off (no clocks) 0.038 0 0 0.2 0.126 sleep (vmid maintained, no clocks) 0.190 0 0 0.2 0.627 mono record (mic input, +20db gain, 8khz, quiescent) slave 4.1 0 0.3 11 14.3 mono record (mic input, +20db gain, 44.1khz, pll, quiescent) master 5.3 0 1.9 115 21.0 mono 16 ? headphone playback (0.1mw, 1khz sine wave, ac coupled) slave 2.8 1.5 1.6 3.7 17.1 mono 8 ? btl speaker playback (44.1khz, 200mw, 1khz sine wave) slave 2.8 62 1.6 3.8 216.8 mono 8 ? btl speaker playback (44.1khz, pll, quiescent) master 3.9 1.5 1.8 81 21.1 table 1 power consumption note: power consumption figures include any power dissipated in the load (e.g. in the headphone or speaker) production data wm8940 w pd, rev 4.3, november 2011 13 signal timing requirements system clock timing mclk t mclkl t mclkh t mclky figure 1 system clock timing requirements test conditions dcvdd=1.8v, dbvdd=avdd=spkvdd= 3.3v, dgnd=agnd=spkgnd=0v, t a = +25 o c parameter symbol conditions min typ max unit system clock timing information mclk cycle time t mclky mclk=sysclk (=256fs) 81.38 ns mclk input to pll note 1 20 ns mclk duty cycle t mclkds 60:40 40:60 note 1: pll pre-scaling and pll n and k values should be set appropriately so that sysclk is no greater than 12.288mhz. audio interface timing ? master mode figure 2 digital audio data timing ? master mode (see control interface) wm8940 production data w pd, rev 4.3, november 2011 14 test conditions dcvdd=1.8v, dbvdd=av dd=spkvdd=3.3v, dgnd= agnd=spkgnd=0v, t a =+25 o c, slave mode, fs=48khz, mclk=256fs, 24-bit data, unless otherwise stated. parameter symbol min typ max unit audio data input timing information frame propagation delay from bclk falling edge t dl 10 ns adcdat propagation delay from bclk falling edge t dda 15 ns dacdat setup time to bclk rising edge t dst 10 ns dacdat hold time from bclk rising edge t dht 10 ns 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, t a =+25 o c, slave mode, fs=48khz, mclk= 256fs, 24-bit data, unless otherwise stated. parameter symbol min typ max unit audio data input timing information bclk cycle time t bcy 81.38 ns bclk pulse width high t bch 32.55 ns bclk pulse width low t bcl 32.55 ns frame set-up time to bclk rising edge t lrsu 10 ns frame hold time from bclk rising edge t lrh 10 ns dacdat hold time from bclk rising edge t dh 10 ns dacdat set-up time to bclk rising edge t ds 10 ns adcdat propagation delay from bclk falling edge t dd 15 ns note: bclk period should always be greater than or equal to mclk period. production data wm8940 w pd, rev 4.3, november 2011 15 control interface timing ? 3-wire mode figure 4 control interface timing ? 3-wire serial control mode test conditions dcvdd = 1.8v, dbvdd = avdd = spkvdd = 3.3v, dgnd = agnd = spkgnd = 0v, t a = +25 o c, slave mode, fs = 48khz, mclk = 256fs, 24-bit data, unless otherwise stated. parameter symbol min typ max unit program register input information sclk rising edge to csb rising edge t scs 80 ns sclk pulse cycle time t scy 200 ns sclk pulse width low t scl 80 ns sclk pulse width high t sch 80 ns sdin to sclk set-up time t dsu 40 ns sclk to sdin hold time t dho 40 ns csb pulse width low t csl 40 ns csb pulse width high t csh 40 ns csb rising to sclk rising t css 40 ns pulse width of spikes that will be suppressed t ps 0 5 ns wm8940 production data w pd, rev 4.3, november 2011 16 control interface timing ? 2-wire mode sdin sclk t 3 t 1 t 6 t 2 t 7 t 5 t 4 t 3 t 8 t 9 figure 5 control interface timing ? 2-wire serial control mode test conditions dcvdd=1.8v, dbvdd=avdd=spkvdd= 3.3v, dgnd=agnd=spkgnd=0v, t a = +25 o c, slave mode, fs = 48khz, mclk = 256fs, 24-bit data, unless otherwise stated. parameter symbol min typ max unit program register input information sclk frequency 0 526 khz sclk low pulse-width t 1 1.3 us sclk high pulse-width t 2 600 ns hold time (start condition) t 3 600 ns setup time (start condition) t 4 600 ns data setup time t 5 100 ns sdin, sclk rise time t 6 300 ns sdin, sclk fall time t 7 300 ns setup time (stop condition) t 8 600 ns data hold time t 9 900 ns pulse width of spikes that will be suppressed t ps 0 5 ns production data wm8940 w pd, rev 4.3, november 2011 17 device description introduction 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 wi th 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 av ailable 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 formats including i 2 s, dsp mode, msb-first, left justified and msb-first, right justified, and can operate in master or slave modes. wm8940 production data w pd, rev 4.3, november 2011 18 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 2- wire 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 confi guration 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 s hould 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. production data wm8940 w pd, rev 4.3, november 2011 19 figure 6 microphone input pga circuit (switch positions shown are for differential mic input) register address bit label default description r44 input control 2 aux2inppga 0 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. 1 micn2inppga 1 connect micn to input pga negative terminal. 0=micn not connected to input pga 1=micn connected to input pga amplifier negative terminal. 0 micp2inppga 0 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 table 2 input control the input pga is enabled by the ippgaen register bit. register address bit label default description r2 power management 2 2 inppgaen 0 input microphone pga enable 0 = disabled 1 = enabled table 3 input pga enable control wm8940 production data w pd, rev 4.3, november 2011 20 input pga volume control 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 bit label default description r45 input pga volume control 7 inppgazc 0 input pga zero cross enable: 0=update gain when gain register changes 1=update gain on 1 st zero cross after gain register write. 6 inppgamute 1 mute control for input pga: 0=input pga not muted, normal operation 1=input pga muted (and disconnected from the following input boost stage). 5:0 inppgavol 010000 input pga volume 000000 = -12db 000001 = -11.25db . 010000 = 0db . 111111 = 35.25db r32 alc control 1 8 alcsel 0 alc function select: 0=alc off (pga gain set by inppgavol register bits) 1=alc on (alc controls pga gain) table 4 input pga volume control auxiliary 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 production data wm8940 w pd, rev 4.3, november 2011 21 the auxmode register bit controls the auxiliary input mode of operation: 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 bit label default description r1 power management 1 6 auxen 0 auxiliary input buffer enable 0 = off 1 = on r44 input control 3 auxmode 0 0 = inverting buffer 1 = mixer (on-chip input resistor bypassed) table 5 auxiliary input buffer control input boost the input boost circuit has 3 selec table 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). wm8940 production data w pd, rev 4.3, november 2011 22 register address bit label defaul t description r45 input pga gain control 6 inppgamute 1 mute control for input pga: 0=input pga not muted, normal operation 1=input pga muted (and disconnected from the following input boost stage). r47 input boost control 8 pgaboost 0 0 = pga output has +0db gain through input boost stage. 1 = pga output has +20db gain through input boost stage. 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 bit label defaul t description r47 input boost control 6:4 micp2boostvol 000 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 2:0 aux2boostvol 000 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 table 7 input boost stage control the boost stage is enabled under control of the boosten register bit. register address bit label default description r2 power management 2 4 boosten 0 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. production data wm8940 w pd, rev 4.3, november 2011 23 register address bit label default description r1 power management 1 4 micben 0 microphone bias enable 0 = off (high impedance output) 1 = on table 9 microphone bias enable register address bit label default description r44 input control 8 mbvsel 0 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. 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.0v rms . any voltage greater than full scale may overload the adc and cause distortion. adc digital filters the adc filters perform true 24 bit signal processi ng 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 . agnd mbvsel=0 micbias = 1.8 x vmid = 0.9 x avdd vmid internal resisto r internal resisto r mb mbvsel=1 micbias = 1.3 x vmid = 0.65 x avdd wm8940 production data w pd, rev 4.3, november 2011 24 figure 10 adc digital filter path the adc is enabled by the adcen register bit. register address bit label default description r2 power management 2 0 adcen 0 0 = adc disabled 1 = adc enabled table 11 adc enable the polarity of the output signal can also be changed under software control using the adcpol register bit. register address bit label default description r14 adc control 0 adcpol 0 0=normal 1=inverted table 12 adc polarity selectable high pass filter a selectable high pass filter is provided. to disabl e 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 bit label default description r14 adc control 8 hpfen 1 high pass filter enable 0=disabled 1=enabled 7 hpfapp 0 select audio mode or application mode 0=audio mode (1 st order, fc = ~3.7hz) 1=application mode (2 nd order, fc = hpfcut) 6:4 hpfcut 000 application mode cut-off frequency see table 14 for details. table 13 adc filter select production data wm8940 w pd, rev 4.3, november 2011 25 hpfcut fs (khz) sr=101/100 sr=011/010 sr=001/000 8 11.025 12 16 22.05 24 32 44.1 48 000 82 113 122 82 113 122 82 113 122 001 102 141 153 102 141 153 102 141 153 010 131 180 196 131 180 196 131 180 196 011 163 225 245 163 225 245 163 225 245 100 204 281 306 204 281 306 204 281 306 101 261 360 392 261 360 392 261 360 392 110 327 450 490 327 450 490 327 450 490 111 408 563 612 408 563 612 408 563 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 1 st order low pass filter. because these coefficient values require two regis ter 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 the notch filter coefficients must be entered using a sign / magnitude notation. register address bit label default description r16 notch filter 0a 15 nf0_up 0 notch filter 0 update. the notch filter 0 values used internally only update when one of the nf0_up bits is set high. 14 nf0_en 0 notch filter 0 enable: 0=disabled 1=enabled 13:0 nf0_a0 0 notch filter 0 a0 coefficient r17 notch filter 0b 15 nf0_up 0 notch filter 0 update. the notch filter 0 values used internally only update when one of the nf0_up bits is set high. 13:0 nf0_a1 0 notch filter 0 a1 coefficient table 15 notch filter 0 function wm8940 production data w pd, rev 4.3, november 2011 26 register address bit label default description r18 notch filter 1a 15 nf1_up 0 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 13:0 nf1_a0 0 notch filter 1 a0 coefficient r19 notch filter 1b 15 nf1_up 0 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 register address bit label default description r20 notch filter 2a 15 nf2_up 0 notch filter 2 update. the notch filter 2 values used internally only update when one of the nfu bits is set high. 14 nf2_en 0 notch filter 2 enable. 0=disabled 1=enabled 13:0 nf2_a0 0 notch filter 2 a0 coefficient r21 notch filter 2b 15 nf2_up 0 notch filter 2 update. the notch filter 2 values used internally only update when one of the nfu bits is set high. 13:0 nf2_a1 0 notch filter 2 a1 coefficient table 17 notch filter 2 function register address bit label default description r22 notch filter 3a 15 nf3_up 0 notch filter 3 update. the notch filter 3 values used internally only update when one of the nfu bits is set high. 14 nf3_en 0 notch filter 3 enable. 0=disabled 1=enabled 13:0 nf3_a0 0 notch filter 3 a0 coefficient r23 notch filter 3b 15 nf3_up 0 notch filter 3 update. the notch filter 3 values used internally only update when one of the nfu bits is set high. 14 nf3_lp 0 notch filter 3 mode select 0 = notch filter mode 1 = low pass filter mode 13:0 nf3_a1 0 notch filter 3 a1 coefficient table 18 notch filter 3 function the notch filter coefficients must be entered using a sign / magnitude notation. the msb of the 14-bit register word (nfx_ax[13]) is reserved for the sign part, leaving the 13 remaining bits for the magnitude part. production data wm8940 w pd, rev 4.3, november 2011 27 the notch filter coefficients are calculated as follows: ) 2 / tan( 1 ) 2 / tan( 1 0 b b w w a ? ? ? ) cos( ) 1 ( 0 0 1 w a a ? ? ? where: s c f f w / 2 0 ? ? s b b f f w / 2 ? ? f c = centre frequency in hz, f b = -3db bandwidth in hz, f s = sample frequency in hz the actual register values can be determined from the coefficients as follows: nfn_a0 = -a0 x 2 13 nfn_a1 = -a1 x 2 12 to configure notch filter 3 as a 1 st order low pass filter, set the nf3_lp bit to 1 and calculate the coefficients as follows: 0 0 ? a 1 ) 2 / tan( 1 ) 2 / tan( 1 ? ? ? c c w w a where: s c c f f w / 2 ? ? f c = cutoff frequency in hz, f s = sample frequency in hz the actual register values can be determined from the coefficients as follows: nf3_a0 = 0 nf3_a1 = -a 1 x2 12 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 bit label default description r15 adc digital volume 7:0 adcvol [7:0] 11111111 ( 0db ) 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 wm8940 production data w pd, rev 4.3, november 2011 28 input limiter / automati c level control (alc) 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. register address bit label default description r32 (20h) alc control 1 2:0 alcmin [2:0] 000 (-12db) set minimum gain of pga 000 = -12db 001 = -6db 010 = 0db 011 = +6db 100 = +12db 101 = +18db 110 = +24db 111 = +30db 5:3 alcmax [2:0] 111 (+35.25db) 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 8 alcsel 0 alc function select (see note) 0 = alc disabled 1 = alc enabled production data wm8940 w pd, rev 4.3, november 2011 29 register address bit label default description r33 (21h) alc control 2 3:0 alclvl [3:0] 1011 (-6db) 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 7:4 alchld [3:0] 0000 (0ms) 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 wm8940 production data w pd, rev 4.3, november 2011 30 register address bit label default description r34 (22h) alc control 3 8 alcmode 0 determines the alc mode of operation: 0 = alc mode (normal operation) 1 = limiter mode. 7:4 alcdcy [3:0] 0011 (26ms/6db) decay (gain ramp-up) time (alcmode ==0) per step per 6db 90% of range 0000 410us 3.38ms 23.6ms 0001 820us 6.56ms 47.2ms 0010 1.64ms 13.1ms 94.5ms ? (time doubles with every step) 1010 or higher 420ms 3.36s 24.2s 0011 (5.8ms/6db) decay (gain ramp-up) time (alcmode ==1) per step per 6db 90% of range 0000 90.8us 726us 5.23ms 0001 182us 1.45ms 10.5ms 0010 363us 2.91ms 20.9ms ? (time doubles with every step) 1010 93ms 744ms 5.36s 3:0 alcatk [3:0] 0010 (3.3ms/6db) alc attack (gain ramp-down) time (alcmode == 0) per step per 6db 90% of range 0000 104us 832us 6ms 0001 208us 1.66ms 12ms 0010 416us 3.33ms 24ms ? (time doubles with every step) 1010 or higher 106ms 852ms 6.13s 0010 (726us/6db) alc attack (gain ramp-down) time (alcmode == 1) per step per 6db 90% of range 0000 22.7us 182.4us 1.31ms 0001 45.4us 363us 2.62ms 0010 90.8us 726us 5.23ms ? (time doubles with every step) 1010 or higher 23.2ms 186ms 1.34s r42 (2ah) alc control 4 1 alczc 0 (zero cross off) alc uses zero cross detection circuit. 0 = disabled (recommended) 1 = enabled table 20 alc control registers note: the input pga volume register r45 must be written with the inppgamute bit r45[6] set to 0 before setting alcsel bit r32[8] to 1. 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. production data wm8940 w pd, rev 4.3, november 2011 31 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 wm8940 production data w pd, rev 4.3, november 2011 32 limiter mode 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). production data wm8940 w pd, rev 4.3, november 2011 33 normal mode alcmode = 0 (normal mode) alcatk t atk t atk6db t atk90% 0000 104s 832s 6ms 0001 208s 1.66ms 12ms 0010 416s 3.33ms 24ms 0011 832s 6.66ms 48ms 0100 1.66ms 13.3ms 96ms 0101 3.33ms 26.6ms 192ms 0110 6.66ms 53.2ms 384ms 0111 13.3ms 106ms 767ms 1000 26.6ms 213.2ms 1.53s 1001 53.2ms 426ms 3.07s 1010 106ms 852ms 6.13s attack time (s) alcmode = 0 (normal mode) alcdcy t dcy t dcy6db t dcy90% 0000 410s 3.28ms 23.6ms 0001 820s 6.56ms 47.2ms 0010 1.64ms 13.1ms 94.5ms 0011 3.28ms 26.2ms 189ms 0100 6.56ms 52.5ms 378ms 0101 13.1ms 105ms 756ms 0110 26.2ms 210ms 1.51s 0111 52.5ms 420ms 3.02s 1000 105ms 840ms 6.05s 1001 210ms 1.68s 12.1s 1010 420ms 3.36s 24.2s decay time (s) table 21 alc normal mode (attack and decay times) wm8940 production data w pd, rev 4.3, november 2011 34 limiter mode alcmode = 1 (limiter mode) alcatk t atklim t atklim6db t atklim90% 0000 22.7s 182s 1.31ms 0001 45.4s 363s 2.62ms 0010 90.8s 726s 5.23ms 0011 182s 1.45ms 10.5ms 0100 363s 2.91ms 20.9ms 0101 726s 5.81ms 41.8ms 0110 1.45ms 11.6ms 83.7ms 0111 2.9ms 23.2ms 167ms 1000 5.81ms 46.5ms 335ms 1001 11.6ms 93ms 669ms 1010 23.2ms 186ms 1.34s attack time (s) alcmode = 1 (limiter mode) alcdcy t dcylim t dcylim6db t dcylim90% 0000 90.8s 726s 5.23ms 0001 182s 1.45ms 10.5ms 0010 363s 2.91ms 20.9ms 0011 726s 5.81ms 41.8ms 0100 1.45ms 11.6ms 83.7ms 0101 2.91ms 23.2ms 167ms 0110 5.81ms 46.5ms 335ms 0111 11.6ms 93ms 669ms 1000 23.2ms 186ms 1.34s 1001 46.5ms 372ms 2.68s 1010 93ms 744ms 5.36s attack time (s) table 22 alc limiter mode (attack and decay times) production data wm8940 w pd, rev 4.3, november 2011 35 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 default description r32 alc control 1 5:3 alcmax 111 set maximum gain of pga 2:0 alcmin 000 set minimum gain of pga 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 maximum gain (db) 111 35.25 110 29.25 101 23.25 100 17.25 011 11.25 010 5.25 001 -0.75 000 -6.75 table 24 alc max gain values wm8940 production data w pd, rev 4.3, november 2011 36 alcmin minimum gain (db) 000 -12 001 -6 010 0 011 6 100 12 101 18 110 24 111 30 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 default description r33 alc control 2 7:4 alchld 0000 alc hold time before gain is increased. 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. production data wm8940 w pd, rev 4.3, november 2011 37 figure 15 alclvl wm8940 production data w pd, rev 4.3, november 2011 38 figure 16 alc hold time alchld t hold (s) 0000 0 0001 2.67ms 0010 5.34ms 0011 10.7ms 0100 21.4ms 0101 42.7ms 0110 85.4ms 0111 171ms 1000 342ms 1001 684ms 1010 1.37s table 27 alc hold time values production data wm8940 w pd, rev 4.3, november 2011 39 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 bit label default description r35 (23h) alc noise gate control 2:0 ngth 000 noise gate threshold: 000 = -39db 001 = -45db 010 = -51db 011 = -57db 100 = -63db 101 = -69db 110 = -75db 111 = -81db 3 ngaten 0 noise gate function enable 1 = enable 0 = disable table 28 alc noise gate control wm8940 production data w pd, rev 4.3, november 2011 40 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 production data wm8940 w pd, rev 4.3, november 2011 41 figure 18 noise gate operation wm8940 production data w pd, rev 4.3, november 2011 42 output signal path 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 dacd at 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 c onverts the digital data into an analogue signal. 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-255) db for 1 ? x ? 255; mute for x = 0 register address bit label default description r11 dac digital volume 7:0 dacvol [7:0] 11111111 ( 0db ) 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 digital audio interface digital gain digital filters interp sdm dac digital peak limiter dac digital filters production data wm8940 w pd, rev 4.3, november 2011 43 hi-fi digital to analogue converter (dac) the dac is enabled by the dacen register bit. register address bit label default description r3 power management 3 0 dacen 0 dac enable 0 = dac disabled 1 = dac enabled 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. register address bit label default description r10 dac control 6 dacmu 0 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 bit label default description r10 dac control 2 amute 0 dac auto mute enable 0 = auto mute disabled 1 = auto mute enabled table 32 dac auto mute control register wm8940 production data w pd, rev 4.3, november 2011 44 dac output limiter 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 r egister 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. production data wm8940 w pd, rev 4.3, november 2011 45 register address bit label default description r24 dac digital limiter control 1 8 limen 0 enable the dac digital limiter: 0=disabled 1=enabled 7:4 limdcy 0011 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 1011 to 1111=1.536s 3:0 limatk 0010 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 r25 dac digital limiter control 2 6:4 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 wm8940 production data w pd, rev 4.3, november 2011 46 register address bit label default description 3:0 limboost 0000 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 gai ns 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 bit label default description r50 speaker mixer control 5 aux2spk 0 output of auxiliary amplifier to speaker mixer input 0 = not selected 1 = selected 1 byp2spk 0 bypass path (output of input boost stage) to speaker mixer input 0 = not selected 1 = selected 0 dac2spk 0 output of dac to speaker mixer input 0 = not selected 1 = selected r54 bypass path attenuation control 8 spkattn 0 attenuation control for bypass path (output of input boost stage) to speaker mixer input 0 = 0db 1 = -10db table 34 speaker mixer control production data wm8940 w pd, rev 4.3, november 2011 47 register address bit label default description r54 speaker volume control 7 spkzc 0 speaker volume control zero cross enable: 1 = change gain on zero cross only 0 = change gain immediately 6 spkmute 1 speaker output mute enable 0=speaker output enabled 1=speaker output muted (vmidop) 5:0 spkvol [5:0] 111001 (0db) speaker volume adjust 111111 = +6db 111110 = +5db ? (1.0 db steps) 111001=0db ? 000000=-57db 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 bit label default description r7 additional control 0 slowclken 0 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. wm8940 production data w pd, rev 4.3, november 2011 48 register address bit label default description r54 speaker volume control 7 spkzc 0 speaker volume control zero cross enable: 1 = change gain on zero cross only 0 = change gain immediately 6 spkmute 1 speaker output mute enable 0=speaker output enabled 1=speaker output muted (vmidop) 5:0 spkvol [5:0] 111001 (0db) speaker volume adjust 111111 = +6db 111110 = +5db ? (1.0 db steps) 111001=0db ? 000000=-57db 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 bit label default description r7 additional control 0 slowclken 0 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. production data wm8940 w pd, rev 4.3, november 2011 49 register address bit label default description r56 mono mixer control 7 monoattn 0 attenuation control for bypass path (output of input boost stage) to mono mixer input 0 = 0db 1 = -10db 6 monomute 0 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. 2 aux2mono 0 output of auxilary amplifier to mono mixer input: 0 = not selected 1 = selected 1 byp2mono 0 bypass path (output of input boost stage) to mono mixer input 0 = non selected 1 = selected 0 dac2mono 0 output of dac to mono mixer input 0 = not selected 1 = selected 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 bit label default description r1 power management 1 3 biasen 0 analogue amplifiers bias enable 2 bufioen 0 vmid buffer enable r3 power management 3 7 monoen 0 monoout enable 6 spknen 0 spkoutn enable 5 spkpen 0 spkoutp enable 3 monomixen 0 mono mixer enable 2 spkmixen 0 speaker mixer enable 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 ? . wm8940 production data w pd, rev 4.3, november 2011 50 register address bit label default description r49 0 vroi 0 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 vroi output configuration 0 0 1k ? tieoff to avdd/2 0 1 30k ? tieoff to avdd/2 1 x 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 interfac e 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 2 21 x mclk, enabled using the slowclken register bit. production data wm8940 w pd, rev 4.3, november 2011 51 gpiopol csb/gpio spknen/ spkpen monoen speaker enabled mono output enabled 0 0 0 x no no 0 0 1 x yes no 0 1 x 0 no no 0 1 x 1 no yes 1 0 x 0 no no 1 0 x 1 no yes 1 1 0 x no no 1 1 1 x yes no 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 125 o c. see general purpose input/output section. register address bit label default description r49 output control 1 tsden 1 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 wm8940 production data w pd, rev 4.3, november 2011 52 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, f c . increasing the capacitance lowers f c , improving the bass response. smaller capacitance values will diminish the bass response. assuming a 16 ? load and c1 = 220 ? f: f c = 1 / 2 ? r l c 1 = 1 / (2 ? x 16 ? x 220 ? f) = 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 cap- less 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, f c . assuming a 10 k ? load and c1 = 1 ? f: f c = 1 / 2 ? (r l +r 1 ) c 1 = 1 / (2 ? x 10.1k ? x 1 ? f) = 16 hz increasing the capacitance lowers f c , 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. production data wm8940 w pd, rev 4.3, november 2011 53 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 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 ? i 2 s ? dsp mode a / b 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 eith er 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 befor e (msb first). depending on word length, bclk frequency and sample rate, there may be unused bclk cycles after each frame transition. wm8940 production data w pd, rev 4.3, november 2011 54 figure 26 right justified audio interface (assuming n-bit word length) in i 2 s mode, the msb is available on the second ri sing 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 i 2 s audio interface (assuming n-bit word length) in dsp/pcm mode, the left channel msb is available on either the 1 st (mode b) the 2 nd (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) production data wm8940 w pd, rev 4.3, november 2011 55 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 bit label default description r4 audio interface control 9 loutr 0 loutr control 0=normal 1=input mono channel data output on both left and right channels 8 bcp 0 bclk polarity 0=normal 1=inverted 7 framep 0 frame clock polarity (for rj, lj and i 2 s 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 6:5 wl 10 word length 00 = 16 bits 01 = 20 bits 10 = 24 bits 11 = 32 bits (see note) 4:3 fmt 10 audio interface data format select: 00=right justified 01=left justified 10=i 2 s format 11= dsp/pcm mode wm8940 production data w pd, rev 4.3, november 2011 56 register address bit label default description 2 dlrswap 0 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 1 alrswap 0 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 r5 companding control 5 wl8 0 8 bit word length enable only recommended for use with companding 0=word length controlled by wl 1=8 bits 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 bit label default description r6 clock generation control 8 clksel 1 controls the source of the clock for all internal operation: 0=mclk 1=pll output 7:5 mclkdiv 010 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 4:2 bclkdiv 000 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 0 ms 0 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) table 44 clock control production data wm8940 w pd, rev 4.3, november 2011 57 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. audio sample rates 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 ti mes 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 bit label default description r7 additional control 3:1 sr 000 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 p ll 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 bit label default description r1 power management 1 5 pllen 0 pll enable 0=pll off 1=pll on table 46 pllen control bit wm8940 production data w pd, rev 4.3, november 2011 58 mclk pll1 r=f 2 /f 1 f/4 sysclk (=256fs) csb/gpio f 2 f 1 gpiosel r8[2:1] ... pllprescale r36[5:4] f/n mclkdiv r6[7:5] opclkdiv r8[5:4] adc dac f/4 master mode frame bclk clksel r6[8] f/4 bclkdiv r6[4:2] ms r6[0] ms r6[0] f pllout f/n f*2 f/4 f/2 figure 30 pll and clock select circuit the pll frequency ratio r = f 2 /f 1 (see figure 30) can be set using the register bits pllk and plln: n = int r k = int (2 24 (r - n)) n controls the ratio of the division, and k the fractional part. 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 bit label default description r36 pll n value 7 pll_powerdown 0 pll power 0=on 1=off 6 fracen 1 fractional divide within the pll 0=disabled (lower power) 1=enabled 5:4 pllprescale 00 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 3:0 plln 1100 integer (n) part of pll input/output frequency ratio. use values greater than 5 and less than 13. r37 pll k value 1 5:0 pllk [23:18] 0ch fractional (k) part of pll1 input/output frequency ratio (treat as one 24-digit binary number). r38 pll k value 2 8:0 pllk [17:9] 093h r39 pll k value 3 8:0 pllk [8:0] 0e9h table 47 pll frequency ratio control production data wm8940 w pd, rev 4.3, november 2011 59 integer n division 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 (f 1 ) desired pll output (f 2 ) division required (r) fractional division (k) integer division (n) sdm 11.2896mhz 90.3168mhz 8 0 8 0 12.2880mhz 98.3040mhz 8 0 8 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/2 24 ). if these are used then frac_en must be set. the relationship between the required division r, the fractional division k[23:0] and the integer division n[3:0] is: k = 2 24 ( r ? n) where 0 < (r ? n) < 1 and k is rounded to the nearest whole number. example: pll input clock (f 1 ) is 12mhz and the required clock (sysclk) is 12.288mhz. r should be chosen to ensure 5 < n < 13. there is a fixed divide by 4 in the pll and a selectable divider (mclkdiv[3:0]) after the pll which should be set to divide by 2 to meet this requirement. enabling the divide by 2 sets the required f 2 = 4 * 2 * 12.288mhz = 98.304mhz. r = 98.304 / 12 = 8.192 n = int r = 8 k = int (2 24 x (8.192 ? 8)) = 3221225 = 3126e9h so n[3:0] will be 8h and k[23:0] will be 3126e9h to produce the desired 98.304mhz clock. wm8940 production data w pd, rev 4.3, november 2011 60 the pll performs best when f 2 is around 90mhz. its stability peaks at n=8. some example settings are shown in table 49. mclk (mhz) desired output (mhz) f2 (mhz) prescale divide postscale divide (mclkdiv) r n (hex) k (hex) 12 11.2896 90.3168 1 2 7.5264 7 86c226 12 12.2880 98.3040 1 2 8.192 8 3126e9 13 11.2896 90.3168 1 2 6.947446 6 f28bd4 13 12.2880 98.3040 1 2 7.561846 7 8fd525 14.4 11.2896 90.3168 1 2 6.272 6 45a1ca 14.4 12.2880 98.3040 1 2 6.826667 6 d3a06e 19.2 11.2896 90.3168 2 2 9.408 9 6872b0 19.2 12.2880 98.3040 2 2 10.24 a 3d70a3 19.68 11.2896 90.3168 2 2 9.178537 9 2db492 19.68 12.2880 98.3040 2 2 9.990243 9 fd809f 19.8 11.2896 90.3168 2 2 9.122909 9 1f76f8 19.8 12.2880 98.3040 2 2 9.929697 9 ee009e 24 11.2896 90.3168 2 2 7.5264 7 86c226 24 12.2880 98.3040 2 2 8.192 8 3126e9 26 11.2896 90.3168 2 2 6.947446 6 f28bd4 26 12.2880 98.3040 2 2 7.561846 7 8fd525 27 11.2896 90.3168 2 2 6.690133 6 boac93 27 12.2880 98.3040 2 2 7.281778 7 482296 table 49 pll frequency examples 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 bit label default description r5 companding control 6 dac_loopback 0 digital loopback function 0=no dac loopback 1=loopback enabled, dac audio interface output is fed directly into adc audio interface input. 4:3 dac_comp 0 dac decompanding 00=off 01=reserved 10=-law 11=a-law 2:1 adc_comp 0 adc companding 00=off 01=reserved 10=-law 11=a-law 0 adc_loopback 0 digital loopback function 0=no adc loopback 1=loopback enabled, adc data output is fed directly into dac data input. table 50 companding control production data wm8940 w pd, rev 4.3, november 2011 61 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 + ? ) -1 x 1 a-law (where a=87.6 for europe): f(x) = a|x| / ( 1 + lna) ? for x 1/a f(x) = ( 1 + lna|x|) / (1 + lna) ? for 1/a 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 8-bit word containing sign (1-bit), exponent (3-bits) and mantissa (4-bits). bit7 bit[6:4] bit[3:0] sign exponent mantissa table 51 8-bit companded word composition u-law companding 0 20 40 60 80 100 120 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 normalised input companded output 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 normalised output figure 31 u-law companding wm8940 production data w pd, rev 4.3, november 2011 62 a-law companding 0 20 40 60 80 100 120 0 0.2 0.4 0.6 0.8 1 normalised input companded output 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 normalised output figure 32 a-law companding general purpose input/output 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 fr om 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 bit label default description r8 gpio control 5:4 opclkdiv 00 pll output clock division ratio 00=divide by 1 01=divide by 2 10=divide by 3 11=divide by 4 3 gpiopol 0 gpio polarity invert 0=non inverted 1=inverted 2:0 gpiosel 000 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 table 52 csb/gpio control production data wm8940 w pd, rev 4.3, november 2011 63 control interface selection of control mode and 2-wire mode address the control interface can operate as either a 3-wi re or 2-wire interface. the mode pin determines the 2 or 3 wire mode as shown in table 53. 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) ar e 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 interface format low 2 wire hi-z 3 wire high 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 wi ll 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 table 52. to use mode as a gpio input, mode must be undriven or driven high at start-up. specifically mode must be high or hi-z during an initial write to the control interface which sets the mode_gpio register bit. after mode_gpio has been set, 3-wire mode selection is overridden internally and the mode pin can be used freely as a gpio input or output. figure 33 example usage of mode pin to generate a clock out in 3-wire mode this example shows how the mode_gpio register bit interfaces to the mode pad in the case there mode is used as a gpio output. when mode_gpio is set, the internal version of mode is overridden to high and the mode pin output driver is enabled. the pull up, which is used to default 3-wire mode at start-up, is disabled as a power saving measure. mode_gpio cannot be set in 2-wire m?de ? this would prevent correct operation of the control interface. internal timing is arranged to ensure that the override is in place before the pull-up is disabled. wm8940 production data w pd, rev 4.3, november 2011 64 register address bit label default description r8 gpio control 7 mode_gpio 0 selects mode as a gpio pin 0 = mode is an input. mode selects 2- wire mode when low and 3-wire mode when high. 1 = mode can be an input or output under the control of the gpio control register. interface operates in 3-wire mode regardless of what happens on the mode pin. table 54 mode is gpio control auto-incremental writes are supported in 2 wire and 3 wire modes. this is enabled by default. register address bit label default description r9 control interface 1 autoinc 1 auto-incremental write enable 0=auto-incremental writes disabled 1=auto-incremental writes enabled table 55 control interface 3-wire serial control mode in 3-wire mode, every rising edge of sclk clocks in one data bit from the sdin pin. a rising edge on csb/gpio latches in a complete control word consisting of the last 16 bits. figure 34 3-wire serial control interface readback in 3-wire mode the following two timing diagrams are also supported. figure 35 alternative 3-wire serial control timing production data wm8940 w pd, rev 4.3, november 2011 65 figure 36 alternative 3-wire serial control timing a limited number of readback addresses are provided to enable alc operation to be monitored and to establish the identity and revision of the device. register address bit label default description r0 software reset 15:0 chip_id readback the chip id r1 power management 1 2:0 device_revis on readback the device_revison table 56 readback registers 2-wire serial control mode the wm8940 supports software control via a 2-wire serial bus. many devices can be controlled by the same bus, and each device has a unique 7-bit device address (this is not the same as the 7-bit address of each register in the wm8940). the wm8940 operates as a slave device only. the controller indicates the start of data transfer with a high to low transition on sdin while sclk remains high. this indicates that a device address and data will follow. all devices on the 2-wire bus respond to the start condition and shift in the next eight bits on sdin (7-bit address + read/write bit, msb first). if the device address received matches the address of the wm8940, then the wm8940 responds by pulling sdin low on the next clock pulse (ack). if the address is not recognised or the r/w bit is ?1? when operating in write only mode, the wm8940 returns to the idle condition and wait for a new start condition and valid address. during a write, once the wm8940 has acknowledged a correct address, the controller sends the first byte of control data (b23 to b16, i.e. the wm8940 8 bit register address). the wm8940 then acknowledges the first data byte by pulling sdin lo w for one clock pulse. the controller then sends the second byte of control data (b15 to b8, i.e. the most significant 8 bits of register data), and the wm8940 acknowledges again by pulling sdin low for one clock pulse. the controller then sends the third byte of control data (b7 to b0, i.e. the remaining 8 bits of register data), and the wm8940 acknowledges again by pulling sdin low for one clock pulse. transfers are complete when there is a low to high tr ansition on sdin while sclk is high. after a complete sequence the wm8940 returns to the idle state and waits for another start condition. if a start or stop condition is detected out of sequence at any point during data transfer (i.e. sdin changes while sclk is high), the device jumps to the idle condition. figure 37 2-wire serial control interface in 2-wire mode the wm8940 has a fixed device address, 0011010. wm8940 production data w pd, rev 4.3, november 2011 66 resetting the chip the wm8940 can be reset by performing a write of any value to the software reset register (address 0 hex). this will cause all register values to be reset to their default values. in addition to this there is a power-on reset (por) circuit which ensur es that the registers are set to default when the device is powered up. power supplies the wm8940 requires four separate power supplies: avdd and agnd: analogue supply, powers all analogue functions except the speaker output and mono output drivers. avdd can range from 2.5v to 3.6v and has the most significant impact on overall power consumption (except for power consumed in the headphone). a larger avdd slightly improves audio quality. spkvdd and spkgnd: headphone and speaker supplies, power the speaker and mono output drivers. spkvdd can range from 2.5v to 3.6v. spkvdd can be tied to avdd, but it requires separate layout and decoupling capacitors to curb harmonic distortion. with a larger spkvdd, louder headphone and speaker outputs can be achieved with lower distortion. if spkvdd is lower than avdd, the output signal may be clipped. dcvdd: digital core supply, powers all digi tal functions except the audio and control interfaces. dcvdd can range from 1.71v to 3.6v, and has no effect on audio quality. the return path for dcvdd is dgnd, which is shared with dbvdd. dbvdd can range from 1.71v to 3.6v. dbvdd return path is through dgnd. it is possible to use the same supply voltage for all four supplies. however, digital and analogue supplies should be routed and decoupled separately on the pcb to keep digital switching noise out of the analogue signal paths. recommended power up/down sequence in order to minimise output pop and click noise, it is recommended that the wm8940/wm8941 device is powered up and down using one of the following sequences: power up: 1. turn on external power supplies. wait for supply voltages to settle. 2. reset internal registers to default state (software reset). 3. enable non-vmid derived bias generator (vmid_op_en = 1) and level shifters (lvlshift_en = 1). 4. enable dac soft mute (dacmu = 1). 5. select clock source to mclk (clksel = 0) and audio mode (master or slave). 6. enable power on bias control (pob_ctrl = 1) and vmid soft start (soft_start = 1). 7. enable speaker outputs (spkpen = 1, spknen = 1) and wait for outputs to settle. 8. set vmidsel[1:0] bits for 50k ? reference string impedance. 9. wait for the vmid supply to settle. *note 2. 10. enable analogue amplifier bias control (biasen = 1) and vmid buffer (bufioen = 1). *notes 1 and 2. 11. disable power on bias control (pob_ctrl = 0) and vmid soft start (soft_start = 0). 12. enable dac (dacen =1) and speaker mixer (spkmixen = 1). 13. enable output of dac to speaker mixer (dac2spk = 1). production data wm8940 w pd, rev 4.3, november 2011 67 14. disable speaker mute (spkmute = 0) and set spkvol = -57db. 15. ramp up the spkvol using the following values: 16. -27 db, -21 db, -15 db, -13 db, -11 db, -9 db, -8 db, -7 db, -6 db, -5 db, -4 db, -3 db, -2 db, -1 db, 0 db. 17. disable dac soft mute (dacmu = 0). power down: 1. enable dac soft mute (dacmu = 1). 2. enable non-vmid derived bias generator (vmid_op_en = 1). 3. enable on bias control (pob_ctrl = 1). 4. disable analogue amplifier bias control (biasen = 0) and vmid (vmidsel[1:0] bits set to off). 5. enable fast vmid discharge (toggle = 1) to discharge vmid capacitor. 6. wait for vmid capacitor to fully discharge. 7. enable speaker output mute (spkmute = 1). 8. disable dac (dacen = 0), speaker mixer (spkmix = 0), and speaker outputs (spkpen = 0 and spknen = 0). 9. reset all registers to their default state (software reset). 10. turn off external power supply voltages. notes: 1. this step enables the internal device bias buffer and the vmid buffer for unassigned inputs/outputs. this will provide a startup reference for all inputs and outputs. this will cause the inputs and outputs to ramp towards vmid in a way that is controlled and predictable. 2. choose the value of vmidsel bits based on the startup time (vmidsel = 10 for the slowest startup, vmidsel = 11 for the fastest startup). startup time is defined by the value of the vmidsel bits (the reference impedance) and the external decoupling capacitor on vmid. in addition to the power on sequence, it is recommended that the zero cross functions are used when changing the volume in the pgas to avoid any audible pops and clicks. wm8940 production data w pd, rev 4.3, november 2011 68 power management vmid the analogue circuitry will not work when vmid is disabled (vmidsel[1:0] = 00b). the impedance of the vmid resistor string, together with the decoupling capacitor on the vmid pin will determine the start-up time of the vmid circuit. register address bit label default description r1 power management 1 1:0 vmidsel 00 reference string impedance to vmid pin (determines startup time): 00=off (open circuit) 01=50k ? 10=250k ? 11=5k ? (for fastest startup) table 57 vmid impedance control biasen register address bit label default description r1 power management 1 3 biasen 0 analogue amplifier bias control 0=disabled 1=enabled table 58 biasen control estimated supply currents when either the dac or adc are enabled it is es timated that approximately 4ma will be drawn from dcvdd when fs=48khz (this will be lower at lo wer sample rates). when the pll is enabled an additional 700 microamps will be drawn from dcvdd. table 59 shows the estimated 3.3v avdd current drawn by various circuits, by register bit. register bit avdd current (milliamps) monoen 0.2ma pllen 1.4ma (with clocks applied) micben 0.5ma biasen 0.3ma bufioen 0.1ma vmidsel 10k=>0.3ma, less than 0.1ma for 100k/500k boosten 0.2ma inppgaen 0.2ma adcen 2.6ma monoen 0.2ma spkpen 1ma from spkvdd spknen 1ma from spkvdd monomixen 0.2ma spkmixen 0.2ma dacen 1.8ma table 59 avdd supply current production data wm8940 w pd, rev 4.3, november 2011 69 pop minimisation power-on-bias control (pob_ctrl) selects the bias current source for the output stages of the wm8940. 0 selects the vmid derived bias source (normal operation), 1 selects a non-vmid derived source which allows the output amplifiers to be enabled before vmid at start-up. this feature can be used to minimise pops. once vmid is enabled and has stabilised, pobctrl should be set to 0. register soft_start is the enable bit for the vmid soft-start function. setting the bit to 1 causes charging of the vmid decoupling cap to follow a soft- start profile which minimises pops. this soft- start profile has minimal impact on vmid charge time. fast vmid discharge is enabled using toggle. setting to 1 opens a low impedance discharge path from vmid to gnd. this function can be used during power down to reduce the discharge time of the vmid decoupling cap. must be set to 0 for normal operation. register address bit label default description r7 additional control 6 pob_ctrl 0 power on bias control 0=normal (current bias based on vmid) 1=startup (current bias not based on vmid) 5 soft_start 0 vmid soft start 0=disabled 1=enabled 4 toggle 0 fast vmid discharge 0=normal 1=enable (used during power-down) table 60 pop minimisation control wm8940 production data w pd, rev 4.3, november 2011 70 register map dec hex 000 software reset 1000_1001_0100_0000 bufioen 0000_0000_0000_0000 202 power management 2 0 0 0 00000000boosten0inppgaen0adcen 0000_0000_0000_0000 303 power management 3 0 0 0 00000 monoen spknen spkpen vbufen monomixen spkmixen 0 dacen 0000_0000_0000_0000 404 audio interface 0 0 0 0 0 0 loutr bcp framep dlrswap alrswap 0 0000_0000_0101_0000 505 companding control 0 0 0 000000 dac_loopback wl8 adc_loopback 0000_0000_0000_0000 606 clock gen control0000000clksel 0ms 0000_0001_0100_0000 707 additional control 0 0 0 000000pob_ctrlsoft_startt oggle slowclken 0000_0000_0000_0000 808 gpio stuff 00000000mode_gpio0 gpiopol 0000_0000_0000_0000 909 control interface 00000000000000autoinc0 0000_0000_0000_0010 10 0a dac control 000000000softmute00 0 amute 0 dacpol 0000_0000_0000_0000 11 0b dac digital vol 00000000 0000_0000_1111_1111 12 0c reserved 13 0d reserved 14 0e adc control 0000000hpfenhpfapp 0 0 0 adcpol 0000_0001_0000_0000 15 0f adc digital vol 00000000 0000_0000_1111_1111 16 10 notch filter 1 nf0_up nf0_en 0000_0000_0000_0000 17 11 notch filter 2 nf0_up 0 0000_0000_0000_0000 18 12 notch filter 3 nf1_up nf1_en 0000_0000_0000_0000 19 13 notch filter 4 nf1_up 0 0000_0000_0000_0000 20 14 notch filter 5 nf2_up nf2_en 0000_0000_0000_0000 21 15 notch filter 6 nf2_up 0 0000_0000_0000_0000 22 16 notch filter 7 nf3_up nf3_en 0000_0000_0000_0000 23 17 notch filter 8 nf3_up nf3_lp 0000_0000_0000_0000 24 18 dac limiter 1 0000000limen 0000_0000_0011_0010 25 19 dac limiter 2 000000000 0000_0000_0000_0000 26 1a reserved 27 1b reserved 28 1c reserved 29 1d reserved 30 1e reserved 31 1f reserved 32 20 alc control 1 0alcsel0 0 0000_0000_0011_1000 33 21 alc control 2 00000000 0000_0000_0000_1011 34 22 alc control 3 0000000alcmode 0000_0000_0011_0010 35 23 noise gate 000000000000ngen 0000_0000_0000_0000 36 24 pll n 00000000 pll_powerdo wn fracen 0000_0000_0100_1000 37 25 pll k 1 0000000000 0000_0000_0000_1100 38 26 pll k 2 0000000 0000_0000_1001_0011 39 27 pll k 3 0000000 0000_0000_1110_1001 40 28 reserved 0000000000000000 0000_0000_0000_0000 41 29 reserved 42 2a alc control 4 00000000000000alczc0 0000_0000_0011_0000 43 2b reserved 44 2c input ctrl 0 0 0 0000micbvsel0000auxmode aux2inppga micn2inppga micp2inppga 0000_0000_0000_0010 45 2d inp pga gain ctrl00000000inppgazc inppgamute 0000_0000_0101_0000 46 2e reserved 47 2f adc boost ctrl0000000 pgaboost 00 0000_0000_0000_0000 48 30 reserved 49 31 output ctrl 00000000000000tsdenvroi 0000_0000_0000_0010 50 32 spk mixer control 0 0 0 0000000 aux2spk 000 byp2spk dac2spk 0000_0000_0000_0000 51 33 reserved 52 34 reserved 53 35 reserved 54 36 spk volume ctrl 0 0 0 0000 spkattn spkzc spkmute 0000_0000_0111_1001 55 37 reserved 56 38 mono mixer control00000000monoattn monomute 000 aux2mono byp2mono dac2mono 0000_0000_0000_0000 sotware reset on write / chip id on read 101 power management 1 0 0 0 0000vmid_op_enlvlshift_enauxenpllenmicbenbi asen vmidsel[1:0] device_revision[2:0] wl[1:0] fmt[1:0] dac_comp[1:0] adc_comp[1:0] mclkdiv[2:0] bclkdiv[2:0] sr[2:0] opclkdiv[1:0] gpiosel[2:0] dacvol[7:0] hpfcut[2:0] adcvol[7:0] nf0_a0[13:0] nf0_a1[13:0] nf1_a0[13:0] nf1_a1[13:0] nf2_a0[13:0] nf2_a1[13:0] nf3_a0[13:0] nf3_a1[13:0] limdcy[3:0] limatk[3:0] limlvl[2:0] limboost[3:0] alcgain[5:0] alcmax[2:0] alcmin[2:0] alchld[3:0] alclvl[3:0] pllk[23:18] pllk[17:9] pllk[8:0] alcdcy[3:0] alcatk[3:0] ngth[2:0] pll_prescale[1:0] plln[3:0] inppgavol[5:0] micp2boostvol[2:0] aux2boostvol[2:0] spkvol[5:0] addr register name b15 b14 b13 b12 b11 b10 b9 b8 b7 b6 b1 b0 default value (bin) b5 b4 b3 b2 production data wm8940 w pd, rev 4.3, november 2011 71 register bits by address notes: 1. default values of n/a indicate non-latched data bits (e.g. software reset or volume update bits). 2. register bits marked as ?reserved? should not be changed from the default. register address bit label default description refer to 0 (00h) [15:0] reset / chip_id n/a writing to this register will apply a software reset. reading from this register will return the device id resetting the chip / control interface 1 (01h) 15:9 00 reserved 8 vmid_op_en 0 enables the non-vmid derived bias current generator without enabling the vmid buffer. this bit must be set to 1 if output amplifiers are to be enabled before vmid is active. once vmid and vmid buffer are enabled this bit can be left set to 0 or left set to 1. power management 7 lvlshift_en 0 enable bit for the level shifters. 1 for normal operation, 0 for standby. power management 6 auxen 0 auxiliary input buffer enable 0 = off 1 = on auxiliary inputs 5 pllen 0 pll enable 0=pll off 1=pll on master clock and phase locked loop (pll) 4 micben 0 microphone bias enable 0 = off (high impedance output) 1 = on microphone biasing circuit 3 biasen 0 analogue amplifier bias control 0=disabled 1=enabled power management 2:0 device_revis ion 000 readback from this register will return the device revision in this position control interface 2 bufioen 0 enable bit for the vmid buffer. the vmid buffer is used to maintain a buffered vmid voltage on all analogue input and output pins. 1. for normal operation 0. for standby (where inputs and outputs settle to gnd). enabling the outputs 1:0 vmidsel 00 reference string impedance to vmid pin: 00=off (open circuit) 01=50k ? 10=250k ? 11=5k ? power management 2 (02h) 15:5 000h reserved 4 boosten 0 input boost enable 0 = boost stage off 1 = boost stage on input boost 3 0 reserved 2 inppgaen 0 input microphone pga enable 0 = disabled 1 = enabled input signal path 1 0 reserved 0 adcen 0 adc enable control 0 = adc disabled 1 = adc enabled analogue to digital converter (adc) 3 (03h) 15:8 00h reserved wm8940 production data w pd, rev 4.3, november 2011 72 register address bit label default description refer to 7 monoen 0 monoout enable 0 = disabled 1 = enabled analogue outputs 6 spknen 0 spkoutn enable 0 = disabled 1 = enabled analogue outputs 5 spkpen 0 spkoutp enable 0 = disabled 1 = enabled analogue outputs 4 reserved 0 3 monomixen 0 mono mixer enable 0 = disabled 1 = enabled analogue outputs 2 spkmixen 0 speaker mixer enable 0 = disabled 1 = enabled analogue outputs 1 0 reserved 0 dacen 0 dac enable 0 = dac disabled 1 = dac enabled analogue outputs 4 (04h) 15:10 00h reserved 9 loutr 0 loutr control 0=normal 1=input mono channel data output on left and right channels digital audio interfaces 8 bcp 0 bclk polarity 0=normal 1=inverted digital audio interfaces 7 framep 0 frame clock polarity 0=normal 1=inverted digital audio interfaces dsp mode control 1 = configures the interface so that msb is available on 1 st bclk rising edge after frame rising edge 0 = configures the interface so that msb is available on 2 nd bclk rising edge after frame rising edge 6:5 wl 10 word length 00=16 bits 01=20 bits 10=24 bits 11=32 bits digital audio interfaces 4:3 fmt 10 audio interface data format select: 00=right justified 01=left justified 10=i 2 s format 11= dsp/pcm mode digital audio interfaces 2 dlrswap 0 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 digital audio interfaces production data wm8940 w pd, rev 4.3, november 2011 73 register address bit label default description refer to 1 alrswap 0 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 digital audio interfaces 0 0 reserved 5 (05h) 15:7 0000 reserved 6 dac_loopba ck 0 digital loopback function 0=no dac loopback 1=loopback enabled, dac data input is fed directly into adc data output. digital audio interfaces 5 wl8 0 8 bit word length for companding 0=word length controlled by wl 1=8 bits digital audio interfaces 4:3 dac_comp 00 dac companding 00=off 01=reserved 10=-law 11=a-law digital audio interfaces 2:1 adc_comp 00 adc companding 00=off 01=reserved 10=-law 11=a-law digital audio interfaces 0 adc_loopba ck 0 digital loopback function 0=no adc loopback 1=loopback enabled, adc data output is fed directly into dac data input. digital audio interfaces 6 (06h) 15:9 00h reserved 8 clksel 1 controls the source of the clock for all internal operation: 0=mclk 1=pll output digital audio interfaces 7:5 mclkdiv 010 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 digital audio interfaces 4:2 bclkdiv 000 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 digital audio interfaces 1 0 reserved wm8940 production data w pd, rev 4.3, november 2011 74 register address bit label default description refer to 0 ms 0 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) digital audio interfaces 7 (07h) 15:7 00000 reserved 6 pob_ctrl 0 power on bias control 0=normal (current bias based on vmid) 1=startup (current bias not based on vmid) pop minimisation 5 soft_start 0 vmid soft start 0=disabled 1=enabled pop minimisation 4 toggle 0 fast vmid discharge 0=normal 1=enable (used during powerdown) pop minimisation 3:1 sr 000 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 audio sample rates 0 slowclken 0 enables the timeout clock for zero cross detection. zero cross timeout 8 (08h) 15:8 00h reserved 7 mode_gpio 0 selects mode as a gpio pin 0 = mode is an input. mode selects 2-wire mode when low and 3-wire mode when high. 1 = mode can be an input or output under the control of the gpio control register. interface operates in 3- wire mode regardless of what happens on the mode pin. control interface 6 0 reserved 5:4 opclkdiv 00 pll output clock division ratio 00=divide by 1 01=divide by 2 10=divide by 3 11=divide by 4 general purpose input output 3 gpiopol 0 gpio polarity invert 0=non inverted 1=inverted general purpose input output 2:0 gpiosel 000 csb/gpio pin function select: 000=csb input 001= jack insert detect 010=temp ok 011=amute active 100=pll clk o/p 101=pll lock 110=reserved 111=reserved general purpose input output 9 (09h) 15:2 reserved production data wm8940 w pd, rev 4.3, november 2011 75 register address bit label default description refer to 1 autoinc 1 auto-incremental write enable 0=auto-incremental writes disabled 1=auto-incremental writes enabled control interface 0 0 reserved 10 (0ah) 15:7 00 reserved 6 dacmu 0 dac soft mute enable 0 = dacmu disabled 1 = dacmu enabled output signal path 5:3 00 reserved 2 amute 0 dac auto mute enable 0 = auto mute disabled 1 = auto mute enabled output signal path 1 0 reserved 0 dacpol 0 dac polarity invert 0 = no inversion 1 = dac output inverted output signal path 11 (0bh) 15:8 00h reserved 7:0 dacvol 11111111 dac digital volume control 0000 0000 = digital mute 0000 0001 = -127db 0000 0010 = -126.5db ? 0.5db steps up to 1111 1111 = 0db output signal path 12 (0ch) 15:0 reserved 13 (0dh) 15:0 reserved 14 (0eh) 15:9 00h reserved 8 hpfen 1 high pass filter enable 0=disabled 1=enabled analogue to digital converter (adc) 7 hpfapp 0 select audio mode or application mode 0=audio mode (1 st order, fc = ~3.7hz) 1=application mode (2 nd order, fc = hpfcut) analogue to digital converter (adc) 6:4 hpfcut 000 application mode cut-off frequency see table 14 for details. analogue to digital converter (adc) 3:1 00 reserved 0 adcpol 0 adc polarity 0=normal 1=inverted analogue to digital converter (adc) 15 (0fh) 15:8 00h reserved 7:0 adcvol 11111111 adc digital volume control 0000 0000 = digital mute 0000 0001 = -127db 0000 0010 = -126.5db ... 0.5db steps up to 1111 1111 = 0db analogue to digital converter (adc) 16 (10h) 15 nf0_up 0 notch filter 0 update. the notch filter 0 values used internally only update when one of the nf0_up bits is set high. analogue to digital converter (adc) 14 nf0_en 0 notch filter 0 enable: 0=disabled 1=enabled analogue to digital converter (adc) wm8940 production data w pd, rev 4.3, november 2011 76 register address bit label default description refer to 13:0 nf0_a0 0000h notch filter 0 a0 coefficient analogue to digital converter (adc) 17 (11h) 15 nf0_up 0 notch filter 0 update. the notch filter 0 values used internally only update when one of the nf0_up bits is set high. analogue to digital converter (adc) 14 0 reserved 13:0 nf0_a1 0000h notch filter 0 a1 coefficient analogue to digital converter (adc) 18 (12h) 15 nf1_up 0 notch filter 1 update. the notch filter 1 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 nf1_en 0 notch filter 1 enable. 0=disabled 1=enabled analogue to digital converter (adc) 13:0 nf1_a0 0000h notch filter 1 a0 coefficient analogue to digital converter (adc) 19 (13h) 15 nf1_up 0 notch filter 1 update. the notch filter 1 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 0 reserved 13:0 nf1_a1 0000h notch filter 1 a1 coefficient analogue to digital converter (adc) 20 (14h) 15 nf2_up 0 notch filter 2 update. the notch filter 2 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 nf2_en 0 notch filter 2 enable. 0=disabled 1=enabled analogue to digital converter (adc) 13:0 nf2_a0 0000h notch filter 2 a0 coefficient analogue to digital converter (adc) 21 (15h) 15 nf2_up 0 notch filter 2 update. the notch filter 2 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 0 reserved 13:0 nf2_a1 0000h notch filter 2 a1 coefficient analogue to digital converter (adc) 22 (16h) 15 nf3_up 0 notch filter 3 update. the notch filter 3 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 nf3_en 0 notch filter 3 enable. 0=disabled 1=enabled analogue to digital converter (adc) 13:0 nf3_a0 0000h notch filter 3 a0 coefficient analogue to digital converter (adc) 23 (17h) 15 nf3_up 0 notch filter 3 update. the notch filter 3 values used internally only update when one of the nfu bits is set high. analogue to digital converter (adc) 14 nf3_lp 0 notch filter 3 mode select 0 = notch filter mode 1 = low pass filter mode analogue to digital converter (adc) production data wm8940 w pd, rev 4.3, november 2011 77 register address bit label default description refer to 13:0 nf3_a1 0000h notch filter 3 a1 coefficient analogue to digital converter (adc) 24 (18h) 15:9 00h reserved 8 limen 0 enable the dac digital limiter: 0=disabled 1=enabled output signal path 24 (18h) 7:4 limdcy 0011 dac 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 1011 to 1111=1.536s output signal path 3:0 limatk 0010 dac 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 output signal path 25 (19h) 15:7 000h reserved 6:4 limlvl 000 dac limiter 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 output signal path wm8940 production data w pd, rev 4.3, november 2011 78 register address bit label default description refer to 3:0 limboost 0000 dac limiter volume boost (can be used as a stand alone volume boost when limen=0): 0000=0db 0001=+1db 0010=+2db ? (1db steps) 1011=+11db 1100=+12db 1101 to 1111=reserved output signal path 26 (1ah) 15:0 0000h reserved 27 (1bh) 15:0 0000h reserved 28 (1ch) 15:0 0000h reserved 29 (1dh) 15:0 0000h reserved 30 (1eh) 15:0 0000h reserved 31(1fh) 15:0 0000h reserved 32 (20h) 15:10 alcgain [5:0] 000000 readback from this register will return the alc gain in this position input limiter / automatic level control (alc) 9 0 reserved 8 alcsel 0 alc function select 0=alc disabled 1=alc enabled input limiter / automatic level control (alc) 7:6 00 reserved 5:3 alcmax 111 set maximum gain of pga input limiter / automatic level control (alc) 2:0 alcmin 000 set minimum gain of pga input limiter / automatic level control (alc) 33 (21h) 15:8 000h reserved 7:4 alchld 000 alc hold time before gain is increased. input limiter / automatic level control (alc) 3:0 alclvl 1011 alc threshold level. sets the desired signal level. input limiter / automatic level control (alc) 34 (22h) 15:9 00h reserved 8 alcmode 0 determines the alc mode of operation: 0=normal mode 1=limiter mode. input limiter / automatic level control (alc) 7:4 alcdcy 0011 decay (gain ramp-up) time input limiter / automatic level control (alc) 3:0 alcatk 0010 alc attack (gain ramp-down) time input limiter / automatic level control (alc) 35 (23h) 15:4 000h reserved 3 ngen 0 noise gate function enable 1 = enable 0 = disable input limiter / automatic level control (alc) 2:0 ngth 000 noise gate threshold input limiter / automatic level control (alc) 36 (24h) 15:8 00h reserved production data wm8940 w pd, rev 4.3, november 2011 79 register address bit label default description refer to 7 pll_powerd own 0 pll power 0=on 1=off master clock and phase locked loop (pll) 6 fracen 1 fractional divide within the pll 0=disabled (lower power) 1=enabled master clock and phase locked loop (pll) 5:4 pllprescale 00 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 master clock and phase locked loop (pll) 3:0 plln[3:0] 1100 integer (n) part of pll input/output frequency ratio. use values greater than 5 and less than 13. master clock and phase locked loop (pll) 37 (25h) 15:6 000h reserved 5:0 pllk[23:18] 001100 fractional (k) part of pll1 input/output frequency ratio (treat as one 24-digit binary number). master clock and phase locked loop (pll) 38 (26h) 15:9 00h reserved 8:0 pllk[17:9] 010010011 fractional (k) part of pll1 input/output frequency ratio (treat as one 24-digit binary number). master clock and phase locked loop (pll) 39 (27h) 15:9 00h reserved 8:0 pllk[8:0] 011101001 fractional (k) part of pll1 input/output frequency ratio (treat as one 24-digit binary number). master clock and phase locked loop (pll) 40 (28h) 15:0 0000h reserved 41 (29h) 15:0 0000h reserved 42 (2ah) 15:2 0 reserved 1 alczc 0 (zero cross off) alc uses zero cross detection circuit. 0 = disabled (recommended) 1 = enabled alc control 4 0 0 reserved 43 (2bh) 15:0 0000h reserved 44 (2ch) 15:9 00h reserved 8 mbvsel 0 microphone bias voltage control 0 = 0.9 * avdd 1 = 0.75 * avdd input signal path 7:4 0h reserved 3 auxmode 0 auxiliary input mode 0 = inverting buffer 1 = mixer (on-chip input resistor bypassed) input signal path 2 aux2inppga 0 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. input signal path 1 micn2inppga 1 connect micn to input pga negative terminal. 0=micn not connected to input pga 1=micn connected to input pga amplifier negative terminal. input signal path wm8940 production data w pd, rev 4.3, november 2011 80 register address bit label default description refer to 0 micp2inppga 0 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 input signal path 45 (2dh) 15:8 00h reserved 7 inppgazc 0 input pga zero cross enable: 0=update gain when gain register changes 1=update gain on 1 st zero cross after gain register write. input signal path 6 inppgamute 1 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 signal path 5:0 inppgavol 010000 input pga volume 000000 = -12db 000001 = -11.25db . 010000 = 0db . 111111 = 35.25db input signal path 46 (2eh) 15:0 0000h reserved 47 (2fh) 15:9 00h reserved 8 pgaboost 0 input boost 0 = pga output has +0db gain through input boost stage. 1 = pga output has +20db gain through input boost stage. input signal path 7 0 reserved 6:4 micp2boostvo l 000 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 input signal path 3 0 reserved 2:0 aux2boostvol 000 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 input signal path 48 (30h) 15:0 0000h reserved 49 (31h) 15:2 0000h reserved 1 tsden 1 thermal shutdown enable 0 : thermal shutdown disabled 1 : thermal shutdown enabled output switch 0 vroi 0 vref (avdd/2 or 1.5xavdd/2) to analogue output resistance 0: approx 1k ? 1: approx 30 k ? [ analogue outputs production data wm8940 w pd, rev 4.3, november 2011 81 register address bit label default description refer to 50 (32h) 15:6 000h reserved 5 aux2spk 0 output of auxiliary amplifier to speaker mixer input 0 = not selected 1 = selected analogue outputs 4:2 000 reserved 1 byp2spk 0 bypass path (output of input boost stage) to speaker mixer input 0 = not selected 1 = selected analogue outputs 0 dac2spk 0 output of dac to speaker mixer input 0 = not selected 1 = selected analogue outputs 51 (33h) 15:0 0000h reserved 52 (34h) 15:0 0000h reserved 53 (35h) 15:0 0000h reserved 54 (36h) 15:9 00h reserved 8 spkattn 0 attenuation control for bypass path (output of input boost stage) to speaker mixer input 0 = 0db 1 = -10db analogue outputs 7 spkzc 0 speaker volume control zero cross enable: 1 = change gain on zero cross only 0 = change gain immediately analogue outputs 6 spkmute 1 speaker output mute enable 0=speaker output enabled 1=speaker output muted (vmidop) analogue outputs 5:0 spkvol 111001 speaker volume adjust 111111 = +6db 111110 = +5db ? (1.0 db steps) 111001=0db ? 000000=-57db analogue outputs 55 (37h) 15:0 0000h reserved 56 (38h) 15:8 00h reserved 7 monoattn 0 attenuation control for bypass path (output of input boost stage) to mono mixer input 0 = 0db 1 = -10db analogue outputs 6 monomute 0 monoout mute control 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. analogue outputs 5:3 0 reserved 2 aux2mono 0 output of auxiliary amplifier to mono mixer input: 0 = not selected 1 = selected analogue outputs 1 byp2mono 0 bypass path (output of input boost stage) to mono mixer input 0 = non selected 1 = selected analogue outputs wm8940 production data w pd, rev 4.3, november 2011 82 register address bit label default description refer to 0 dac2mono 0 output of dac to mono mixer input 0 = not selected 1 = selected analogue outputs production data wm8940 w pd, rev 4.3, november 2011 83 digital filter characteristics parameter test conditions min typ max unit adc filter passband +/- 0.025db 0 0.454fs -6db 0.5fs passband ripple +/- 0.025 db stopband 0.546fs stopband attenuation f > 0.546fs -60 db group delay 21/fs adc high pass filter high pass filter corner frequency -3db 3.7 hz -0.5db 10.4 -0.1db 21.6 dac filter passband +/- 0.035db 0 0.454fs -6db 0.5fs passband ripple +/-0.035 db stopband 0.546fs stopband attenuation f > 0.546fs -55 db group delay 29/fs table 61 digital filter characteristics terminology 1. stop band attenuation (db) ? the degree to which the frequency spectrum is attenuated (outside audio band) 2. pass-band ripple ? any variation of the frequency response in the pass-band region 3. note that this delay applies only to the filters and does not include additional delays through other digital circuits. see table 62 for the total delay. parameter min typ max unit total delay (adc analogue input to digital audio interface output) 28/fs 30/fs 32/fs fs total delay (audio interface input to dac analogue output) 33/fs 35/fs 37/fs fs table 62 total group delay note: 1. wind noise filter is disabled. wm8940 production data w pd, rev 4.3, november 2011 84 dac filter responses -120 -100 -80 -60 -40 -20 0 00.511.522.53 frequency (fs) response (db) -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0 0.1 0.2 0.3 0.4 0.5 frequency (fs) response (db) figure 38 dac digital filter frequency response figure 39 dac digital filter ripple adc filter responses -120 -100 -80 -60 -40 -20 0 0 0.5 1 1.5 2 2.5 3 frequency (fs) response (db) -0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15 0.2 0 0.1 0.2 0.3 0.4 0.5 frequency (fs) response (db) figure 40 adc digital filter frequency response figure 41 adc digital filter ripple production data wm8940 w pd, rev 4.3, november 2011 85 highpass filter the wm8940 has a selectable digital high pass filter in the adc filter path. this filter has two modes, audio and applications. in audio mode the filter is a 1 st order iir with a cut-off of around 3.7hz. in applications mode the filter is a 2 nd order high pass filter with a selectable cut-off frequency. -40 -35 -30 -25 -20 -15 -10 -5 0 5 0 5 10 15 20 25 30 35 40 45 frequency (hz) response (db) -60 -50 -40 -30 -20 -10 0 10 0 200 400 600 800 1000 1200 frequency (hz) response (db) figure 42 adc high pass filter response, hpfapp=0 figure 43 adc high pass filter responses (48khz), hpfapp=1, all cut-off settings shown. -80 -70 -60 -50 -40 -30 -20 -10 0 10 0 200 400 600 800 1000 1200 frequency (hz) response (db) -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 0 200 400 600 800 1000 1200 frequency (hz) response (db) figure 44 adc high pass filter responses (24khz), hpfapp=1, all cut-off settings shown. figure 45 a dc highpass filter responses (12khz), hpfapp=1, all cutoff settings shown. wm8940 production data w pd, rev 4.3, november 2011 86 notch filters and low pass filter the wm8940 supports four programmable notch filters. the fourth notch filter can be configured as a low pass filter. the following illustrates three digital notch filters, followed by a single low pass filter in the adc filter path. both the centre frequency and -3db bandwidth are programmable for the notch filters. the cut off frequency is programmable for the low pass filter. the following graphs show the responses of 1) a single notch filter at three chosen centre frequencies, with three bandwidths for each, 2) the low pass filter at three chosen cut off frequencies and 3) the cascade of three notch filters followed by the low pass filter, each with a different centre / cut off frequency with three bandwidths for each. figure 46 adc notch filter responses (48khz); fc=100hz, 1khz, 10khz; fb = 100hz, 600hz, 2khz figure 47 adc low pass filter responses (48khz); fc= 1khz, 5khz, 10khz -60 +0 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 r e s p o n s e (db) 20 20k 50 100 200 500 1k 2k 5k 10k frequency (hz) -60 +0 -55 -50 -45 -40 -35 -30 -25 -20 -15 -10 -5 r e s p o n s e (db) 20 20k 50 100 200 500 1k 2k 5k 10k frequency (hz) t t production data wm8940 w pd, rev 4.3, november 2011 87 figure 48 cumulative notch + low pass filters responses (48khz); nf0 fc = 1khz; nf1 fc = 5khz; nf2 fc = 10kh z; lpf fc = 11khz; fb = 100hz, 600hz, 2khz notch filter worked example the following example illustrates how to calculate the a0 and a1 coefficients for a desired centre frequency and -3db bandwidth. f c = 1000 hz f b = 100 hz f s = 48000 hz s c 0 f / f 2 w ? ? = ? 2 x (1000 / 48000) = 0.1308996939 rads s b b f / f 2 w ? ? = ? 2 x (100 / 48000) = 0.01308996939 rads ) 2 / w tan( 1 ) 2 / w tan( 1 a b b 0 ? ? ? = ) 2 / 9 0130899693 . 0 tan( 1 ) 2 / 9 0130899693 . 0 tan( 1 ? ? = 0.9869949627 ) w cos( ) a 1 ( a 0 0 1 ? ? ? = ) 1308996939 . 0 cos( ) 9869949627 . 0 1 ( ? ? = -1.969995945 nfn_a0 = -a0 x 2 13 = -8085 (rounded to nearest whole number) nfn_a1 = -a1 x 2 12 = 8069 (rounded to nearest whole number) these values are then converted to a 14-bit sign / magnitude notation: nfn_a0[13] = 1; nfn_a0[12:0] = 13?h1f95; nfn_a0 = 14?h3f95 = 14?b11111110010101 nfn_a1[13] = 0; nfn_a1[12:0] = 13?h1f85; nfn_a1 = 14?h1f85 = 14?b01111110000101 -40 +0 -35 -30 -25 -20 -15 -10 -5 r e s p o n s e (db) 20 20k 50 100 200 500 1k 2k 5k 10k frequency (hz) t t t wm8940 production data w pd, rev 4.3, november 2011 88 applications information recommended external components figure 49 recommended external components production data wm8940 w pd, rev 4.3, november 2011 89 package diagram dm102.c fl: 24 pin qfn plastic package 4 x 4 x 0.9 mm body, 0.50 mm lead pitch index area (d/2 x e/2) top view d e 4 notes: 1. dimension b applies to metallized terminal and is measured between 0.15 mm and 0.30 mm from terminal tip. 2. falls within jedec, mo-220, variation vggd-8. 3. all dimensions are in millimetres. 4. the terminal #1 identifier and terminal numbering convention shall conform to jedec 95-1 spp-002. 5. coplanarity applies to the exposed heat sink slug as well as the terminals. 6. refer to applications note wan_0118 for further information regarding pcb footprints and qfn package soldering. 7. this drawing is subject to change without notice. a3 g t h w b exposed lead half etch tie bar dimensions (mm) symbols min nom max note a a1 a3 0.80 0.85 0.90 0.05 0.035 0 0.203 ref b d d2 e e2 e l 0.30 0.20 4.00 bsc 2.60 2.50 2.40 0.50 bsc 0.35 0.40 0.45 2 2 4.00 bsc 2.60 2.50 2.40 0.10 aaa bbb ccc ref: 0.10 0.10 jedec, mo-220, variation vggd-8. tolerances of form and position 0.25 h 0.10 0.20 g t 0.103 w 0.15 detail 1 detail 3 6 1 13 18 24 19 12 e d2 b 7 1 b c bbb m a bottom view c aaa 2 x c aaa 2 x 1 c a3 seating plane a1 c 0.08 c ccc a 5 side view exposed ground paddle 6 detail 1 0.30mm 45 exposed ground paddle e2 see detail 2 l e datum detail 2 terminal tip e/2 1 m m detail 3 wm8940 production data w pd, rev 4.3, november 2011 90 important notice wolfson microelectronics plc (?wolfson?) products and services ar e sold subject to wolfson?s terms and conditions of sale, delivery and payment supplied at the time of order acknowledgement. wolfson warrants performance of its products to the specifications in effect at the date of shipment. wolfson reserves the right to make changes to its products and specifications or to discontinue any product or service without notice. customers should therefore obtain the latest version of relevant information from wolfson to verify that the information is current. testing and other quality control techniques are utilised to the extent wolfson deems necessary to support its warranty. specific testing of all parameters of each device is not necessarily performed unless required by law or regulation. in order to minimise risks associated with customer applications, the customer must use adequate design and operating safeguards to minimise inherent or procedural hazards. wolfso n is not liable for applications assistance or customer product design. the customer is solely responsible for its selection and use of wolfson products. wolfson is not liable for such selection or use nor for use of any circuitry other than circuitry entirely embodied in a wolfson product. wolfson?s products are not intended for use in life support systems, appliances, nuclear systems or systems where malfunction can reasonably be expected to result in personal injury, death or severe property or environmental damage. any use of products by the customer for such purposes is at the customer?s own risk. wolfson does not grant any licence (express or implied) under any patent right, copyright, mask work right or other intellectua l property right of wolfson covering or relating to any combination, machine, or process in which its products or services might be or are used. any provision or publication of any third party?s products or services does not constitute wolfson?s approval, licence, warranty or endorsement thereof. any third party trade marks contained in this document belong to the respective third party owner. reproduction of information from wolfson datasheets is permissible only if reproduction is without alteration and is accompanied by all associated copyright, proprietary and other not ices (including this notice) and conditions. wolfson is not liable for any unauthorised alteration of such information or for any reliance placed thereon. any representations made, warranties given, and/or liabilities accepted by any person which differ from those contained in this datasheet or in wolfson?s standard terms and conditions of sale, delivery and payment are made, given and/or accepted at that person?s own risk. wolfson is not liable for any such representations, warranties or liabilities or for any reliance pl aced thereon by any person. address wolfson microelectronics plc westfield house 26 westfield road edinburgh eh11 2qb united kingdom tel :: +44 (0)131 272 7000 fax :: +44 (0)131 272 7001 email :: sales@wolfsonmicro.com production data wm8940 w pd, rev 4.3, november 2011 91 revision history date rev originator changes 10/05/10 4.3 bc audio paths diagram updated to correct monoout and spkout paths 26/09/11 4.3 jmacd order codes changed from wm8940gefl/v and wm8940gefl/rv to wm8940cgefl/v and wm8940cgefl/rv to reflect change to copper wire bonding. 26/09/11 4.3 jmacd package drawing changed to dm102.c |
Price & Availability of WM894011
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |