Pre-Production
WM8904
MIC DETECTION SEQUENCE USING MICBIAS CURRENT
This section details an example sequence which summarises how the host processor can configure
and detect the events supported by the MICBIAS current detect function (see “Electret Condenser
Microphone Interface”):
Mic insertion/removal
Hook switch press/release
Figure 72 shows an example of how the MICBIAS current flow varies versus time, during mic
insertion and hook switch events. The Y axis is annotated with the Mic detection thresholds, and the
X axis is annotated with the stages of an example sequence as detailed in Table 96, to illustrate how
the host processor can implement mic insertion and hook switch detection.
The sequence assumes that the microphone insertion and hook switch detection functions are
monitored by polling the interrupt flags using the control interface. Note that the maximum mechanical
bounce times for mic insertion and removal must be fully understood by the software programmer.
A GPIO pin could be used as an alternative mechanism to monitor the MICBIAS detection functions.
This enables the host processor to detect mechanical bounce at any time.
Example plot of MICBIAS Current versus time
(1) (2) (3)
(4)
(5)
(6)
(7)
(8)
(9) (10)
Step
Mic inserted
TSHORT
Hook switch
pressed
Mic Hook Switch
Threshold
TDET
Hysteresis
TDET
TSHORT
Mic Detect
Threshold
Time
(1) (2) (3)
(4)
(5)
(6)
(7)
(8)
(9) (10)
Step
Mic Detect Interrupt
MIC_DET_EINT
Mic Detect Interrupt Polarity
MIC_DET_EINT_POL
MIC_SHRT_EINT
Mic Short Interrupt
Mic Short Interrupt Polarity
MIC_SHRT_EINT_POL
Read the Mic detect interrupt flag. If high, can
then clear MIC_DET_EINT_POL to 0, but only
if mechanical bounce phase has finished.
Clear MIC_DET_EINT by writing ‘1’.
Read the Mic detect interrupt Read the Hook switch interrupt flag.
HOST
PROCESSOR
flag. If high, can then set
If high, can immediately set
MIC_DET_EINT_POL to 1,
MIC_SHRT_EINT_POL to 1. Clear
but only if mechanical bounce MIC_SHRT_EINT by writing ‘1’.
phase has finished. Clear
MIC_DET_EINT by writing ‘1’.
Read the Hook switch interrupt flag. If high, can
immediately clear MIC_SHRT_EINT_POL to 0.
Clear MIC_SHRT_EINT by writing ‘1’.
Figure 72 Mic Insert and Hook Switch Detect: Example MICBIAS Current Plot
PP, Rev 3.3, September 2012
183
w