The present invention generally relates to a stereo (two-channel) microphone, and, more particularly, to a test circuit, test method and audio codec for the stereo microphone.
Unfortunately, it is possible that the microphone 112 and the microphone 114 are not firmly soldered on the PCB. More specifically, the clock pin cp1, the data output pin dp1, the clock pin cp2 and the data output pin dp2 may be floating, resulting in an error in the stereo microphone 110 due to the failure in the physical connection required for information or communication path between the audio codec 120 and the microphone 112 and/or the microphone 114. However, spotting the pin that is floating due to soldering with human eyes can be a difficult task, and thus debugging the circuit becomes an issue.
In view of the issues of the prior art, an object of the present invention is to provide a test circuit, test methods and an audio codec for a stereo microphone, so as to make an improvement to the prior art.
A circuit for testing a microphone module (e.g., a stereo microphone) is provided. The microphone module operates according to a clock and includes a first microphone and a second microphone. The first microphone outputs a first data through a first data output pin when the clock is at a first level, and the second microphone outputs a second data through a second data output pin when the clock is at a second level. The first level is different from the second level. The first data output pin and the second data output pin are coupled to a capacitor. The circuit includes a comparison circuit, a counter and a decision circuit. The comparison circuit is configured to compare the first data and the second data and to generate a comparison result. The counter is coupled to the comparison circuit and configured to generate a count value based on the comparison result. The decision circuit is coupled to the counter and configured to determine whether there is an error in the microphone module based on the count value and a threshold value.
A method of testing a microphone module (e.g., a stereo microphone) is provided. The microphone module operates according to a clock and includes a first microphone and a second microphone. The first microphone outputs a first data through a first data output pin when the clock is at a first level, and the second microphone outputs a second data through a second data output pin when the clock is at a second level. The first level is different from the second level. The first data output pin and the second data output pin are coupled to a capacitor. The method includes the following steps: (a) comparing the first data with the second data and generating a comparison result; (b) generating a count value based on the comparison result; and (c) determining whether there is an error in the microphone module based on the count value and a threshold value.
A method of testing a microphone module (e.g., a stereo microphone) is provided. The microphone module operates according to a clock and includes a first microphone and a second microphone. The first microphone outputs a plurality of first data through a first data output pin when the clock is at a first level, and the second microphone outputs a plurality of second data through a second data output pin when the clock is at a second level. The first level is different from the second level. The first data output pin and the second data output pin are coupled to a capacitor. The method includes the following steps: (a) decoding or filtering the first data and the second data to generate a first pulse-code modulation (PCM) data and a second PCM data; (b) comparing the first PCM data with the second PCM data and generating a comparison result; (c) generating a count value based on the comparison result; and (d) determining whether there is an error in the microphone module based on the count value and a threshold value.
An audio codec for testing a microphone module (e.g., a stereo microphone) is provided. The microphone module operates according to a clock and includes a first microphone and a second microphone. The first microphone outputs a plurality of first data through a first data output pin when the clock is at a first level, and the second microphone outputs a plurality of second data through a second data output pin when the clock is at a second level. The first level is different from the second level. The first data output pin and the second data output pin are coupled to a capacitor. The audio codec includes a memory and a processor. The memory is configured to store a plurality of program instructions or program codes. The processor is coupled to the memory and configured to execute the program instructions or program codes to perform the following steps: (a) decoding or filtering the first data and the second data to generate a first pulse-code modulation (PCM) data and a second PCM data; (b) comparing the first PCM data with the second PCM data and generating a comparison result; (c) generating a count value based on the comparison result; and (d) determining whether there is an error in the microphone module based on the count value and a threshold value.
According to the present invention, the test circuit, test methods and audio codec for the stereo microphone can quickly find out whether there is an error in the stereo microphone. In comparison with the conventional technology, the present invention makes circuit debugging faster and thus saves time.
These and other objectives of the present invention no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiments with reference to the various figures and drawings.
The following description is written by referring to terms of this technical field. If any term is defined in this specification, such term should be interpreted accordingly. In addition, the connection between objects or events in the below-described embodiments can be direct or indirect provided that these embodiments are practicable under such connection. Said “indirect” means that an intermediate object or a physical space exists between the objects, or an intermediate event or a time interval exists between the events.
The disclosure herein includes test circuits, test methods and an audio codec for stereo microphones. On account of that some or all elements of the test circuits and the audio codec could be known, the detail of such elements is omitted provided that such detail has little to do with the features of this disclosure, and that this omission nowhere dissatisfies the specification and enablement requirements. Some or all of the processes of the test methods may be implemented by software and/or firmware and can be performed by the test circuits, the audio codec or their equivalents. A person having ordinary skill in the art can choose components or steps equivalent to those described in this specification to carry out the present invention, which means that the scope of this invention is not limited to the embodiments in the specification.
In this document, the term “coupled” and the term “connected” may mean “directly coupled” and “directly connected” respectively, or “indirectly coupled” and “indirectly connected” respectively. “Coupled” and “connected” may also be used to indicate that two or more elements cooperate or interact with each other.
Although the terms “first,” “second,” etc., may be used herein to describe various elements, these elements should not be limited by these terms. Rather, these terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the embodiments.
When the microphone 112 and/or the microphone 114 are not firmly soldered on the PCB, the data D has specific contents. For example, when the clock pin cp1 or the data output pin dp1 is floating, the data d1 is in the high impedance state; therefore, the terminal voltage of the capacitor 225 does not change (i.e., the previous state of the terminal voltage is maintained) at the high levels of the clock CLK. As a result, the content of the data D includes only the data d2, and therefore, a same sampled result (i.e., the data d2) is obtained by the audio codec 220 during both the high levels and the low levels of the clock CLK. In other words, when the stereo microphone 110 is not firmly soldered on the PCB, two identical data are sampled by the audio codec 220 within one cycle of the clock CLK.
In one embodiment, the audio codec 220 uses a built-in test circuit 230 to test the stereo microphone 110.
The comparison circuit 410 and step S510 can be implemented with a logic gate. As shown in
Step S520 includes sub-steps S522, S524 and S526. In embodiment (A), the counter 420 increases the count value CV (step S524) when the comparison result CR is logic 1 (YES branch of step S522), and the counter 420 resets the count value CV (i.e., zeroing the count value CV) (step S526) when the comparison result CR is logic 0 (NO branch of step S522). In embodiment (B), the counter 420 resets the count value CV (step S526) when the comparison result CR is logic 1 (NO branch of step S522), and the counter 420 increases the count value CV (step S524) when the comparison result CR is logic 0 (YES branch of step S522).
Step S530 includes sub-steps S532, S534 and S536. In sub-step S532, the decision circuit 430 compares the count value CV with the threshold value Th. In both embodiment (A) and embodiment (B), when the count value CV is greater than the threshold value Th (YES branch of step S532), the decision circuit 430 sets the flag FG to the first logical value (e.g., logic 1) to indicate that there is an error in the stereo microphone (step S534). When the count value CV is not greater than the threshold value Th (NO branch of step S532), the decision circuit 430 sets the flag FG to a second logical value (e.g., logic 0) to indicate that there is no error in the stereo microphone (step S536). The first logical value is different from the second logical value. In some embodiments, the decision circuit 430 may be implemented with a comparator. The threshold value Th can be set based on experiences, for example, hundreds or thousands.
In summary, the test circuit 230 and the corresponding test method can find out whether the stereo microphone 110 is abnormal, which helps the circuit designers be aware of the errors in an early stage. The abnormality of the stereo microphone 110 may include, but not limited to, the data output pins and/or clock pins of the microphone 112 and/or the microphone 114 being floating.
Reference is made to
The processor 740 may be a circuit or an electronic component with program execution capability, such as a central processing unit (CPU), a microprocessor, a micro-processing unit or an application-specific integrated circuit (ASIC). The processor 740 executes multiple program codes or program instructions stored in the memory 750 to process the data d1 and the data d2. In some embodiments, the ASIC can be a digital signal processor (DSP). In the embodiment of
Initially, the processor 740 decodes or filters multiple data d1 and multiple data d2 to generate the PCM data D_PCM1 and the PCM data D_PCM2 (step S810). The audio codec 720 outputs the PCM data D_PCM1 and the PCM data D_PCM2 simultaneously or alternately. In other words, the PCM data D_PCM contains the PCM data D_PCM1 and the PCM data D_PCM2. The PCM data D_PCM1 corresponds to one channel of the stereo microphone 110, and the PCM data D_PCM2 corresponds to the other channel of the stereo microphone 110. When the data output pin(s) and/or the clock pin(s) of the microphone 112 and/or the microphone 114 are/is floating, the PCM data D_PCM1 is the same as the PCM data D_PCM2. Step S810 is well-known to people having ordinary skill in the art, and the details are thus omitted for brevity.
Next, the processor 740 compares the PCM data D_PCM1 with the PCM data D_PCM2 and accordingly generates a comparison result CR (step S820), generates a count value CV based on the comparison result CR (step S830), and then determines whether an error has occurred to the stereo microphone 110 based on the count value CV and the threshold value Th (step S840). Steps S820, S830 and S840 are similar to steps S510, S520 and S530, respectively, and the details are thus omitted for brevity.
Since a person having ordinary skill in the art can appreciate the implementation detail and the modification thereto of the present method invention through the disclosure of the device invention, repeated and redundant description is thus omitted. Please note that there is no step sequence limitation for the method inventions as long as the execution of each step is applicable. Furthermore, the shape, size, and ratio of any element and the step sequence of any flow chart in the disclosed figures are exemplary for understanding, not for limiting the scope of this invention.
The aforementioned descriptions represent merely the preferred embodiments of the present invention, without any intention to limit the scope of the present invention thereto. Various equivalent changes, alterations, or modifications based on the claims of the present invention are all consequently viewed as being embraced by the scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
108140873 | Nov 2019 | TW | national |