METHOD AND APPARATUS FOR FILTER TUNING
FIELD OF THE INVENTION
The present invention relates generally to the field of communications devices and, more specifically, to filter tuning.
BACKGROUND OF THE INVENTION
In many filter circuit designs, resistance and capacitance are basic, yet critical design elements. A filter circuit is designed to function with particular results based on definite resistance and capacitance values. However, when the filter circuit is included within an integrated chip (IC), slight fabrication errors cause variations in the values of the resistors and capacitors in the filter circuit. These variations can be as large as ± 20% for resistors and ± 15% for capacitors. Thus, with variations so large, the filter circuit may exhibit significant errors in the filter response. Consequently, to overcome the undesirable variations in resistors and capacitors, a tuning circuit is required.
BRIEF DESCRIPTION OF THE DRAWINGS
The present invention is illustrated by way of example and should not be limited by the figures of the accompanying drawings in which like references indicate similar elements and in which: Figure 1 is a diagram of one embodiment of a tuning circuit 100 configured according to the present invention.
Figure 2 is a flow diagram of one embodiment of a method 200 for tuning a filter circuit.
Figure 3 is a flow diagram of one embodiment of a method 300 for varying a real RC value until it is closest to a predetermined RC value in a filter tuning circuit.
Figure 4 is a flow diagram of one embodiment of a method 400 for tuning a filter circuit.
Figure 5 is an exemplary embodiment of a method 500 of measuring an RC time constant.
SUMMARY OF THE INVENTION
A method and apparatus for filter circuit tuning is described. In one embodiment the method includes determining a real RC time constant value for a filter circuit, then comparing the real RC value to a predetermined RC value. If the real RC value does not match the predetermined RC value, the method continues with varying the real RC value until it matches the predetermined RC value.
Other features of the present invention will be apparent from the accompanying drawings and from the detailed description that follows.
DETAILED DESCRIPTION OF THE INVENTION
Described herein is a method and apparatus for tuning a filter. In the following description numerous specific details are set forth in order to provide a thorough understanding of the present invention. One of ordinary skill in the art, however, will appreciate that these specific details are not necessary to practice the present invention. While certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative and not restrictive of the current invention, and that this invention is not restricted to the specific constructions and arrangements shown and described since modifications may occur to those ordinarily skilled in the art.
Apparatus
Figure 1 is a diagram of one embodiment of a tuning circuit 100 configured according to the present invention. Referring to Figure 1, tuning circuit 100 includes an op-amp 102, a resistor 110, and a capacitor array 120. The op-amp 102 includes first and second inputs 104 and 106, and an output 108. The op-amp 102 may be any kind of op-amp known in the art. The resistor 110 has an arbitrary design value and is coupled to the first input 104 of the op-amp. In one embodiment, the resistor value is 265.08 k'Ω, however due to fabrication errors in the manufacturing process, a resistor's value may vary by as much as ± 20% of the design value for current CMOS IC fabrication. The capacitor array 120 is coupled in a feedback path between the first input 104 and the op-amp output 108. The capacitor array 120 includes a plurality of capacitors 124 (Ci - CN) connected in parallel to each other, each capacitor having a
particular value, and each of the plurality of capacitors 124 having a corresponding switches 122 (Si - SN). In one embodiment, capacitor array 120 further has a base capacitor value Q, 129, with an associated switch 128 (Sb).
The capacitance values of the plurality of capacitors 124 in the capacitor array 120 should be such that when switched together in combination, at least one combination of values will provide an optimal capacitance required by a filter circuit, thus producing a tuning effect that will tune the filter circuit as close as possible to a predetermined RC value. The predetermined RC value is arbitrary and is determined by the design rules of the circuit.
In one embodiment, the capacitor array 120 consists of 16 capacitors (including the base capacitor) with the following values:
In one embodiment, one switch 126 (SR) does not have a corresponding capacitor and creates a short circuit across the capacitor array when closed to initialize the capacitor array 120. When switch 126 is closed and switches 122 and 128 are closed, the plurality of capacitors 122 and 129 discharge, or reset. Thus switch 126 may also be referred to, herein, as a reset switch.
In one embodiment the tuning circuit 100 further includes a CPU 170, a clock signal generator 150, a memory 130, and a counter 140. The CPU 170 is used to control which switches are to be opened and closed. The clock signal generator 150 may be any kind of clock signal generator known in the art, such as a crystal oscillator, and is configured to produce a clock signal with a certain frequency. The frequency of the clock signal can be arbitrary, but may be determined by design rules. In one embodiment, the clock signal has a frequency of 24 MHz. The memory 130 is used to store the codes which the CPU 170 will execute.
The clock signal generator 150 produces a clock signal at a predetermined frequency (e.g., 24 MHz). The counter 140 is configured to determine the number of cycles of the clock signal that occur during a measurable time period corresponding to
an RC time constant of the tuning circuit. The RC time constant of the tuning circuit is equivalent to the product of the resistance value of the resistor 110 and the capacitance value of the capacitor array 120. A method for determining a number of cycles, according to the present invention, is described in more detail in conjunction with Figure 4 below.
The tuning circuit 100 further includes a comparator 160 which is configured to generate an output signal to the counter 140 so that the corresponding RC time constant of the. tuning circuit can be measured. A method of measuring the RC time constant of the tuning circuit is explained in further detail in conjunction with Figure 4 below.
The desired RC time constant is equivalently represented, in terms of the number of clock cycles, by a predetermined number stored in memory. The predetermined number may be determined by design rules and may be the equivalent of the clock signal generator frequency multiplied by the designed RC value for the filter circuit. In one embodiment, the predetermined RC time constant (i.e., designed RC value) is 2μs. Exemplary embodiments of a method of utilizing the tuning circuit 100 will follow in further detail below.
Refer to the tuning circuit 100, when the tuning circuit 100 is in use, voltages Vi, V2 and V3 must be provided. The voltages provided to op-amp 102 and comparator 160 are denoted by Vj V2 and V3 where Vi, > V2 > V . The voltages Vj, V2 and V3 can be generated by using any state-of-art bias circuits.
Method
Figure 2 is a flow diagram of one embodiment of a method 200 for tuning a filter circuit. Method 200 begins, at processing block 202, with determining a real RC time constant value (also referred to herein as an "RC value") for the tuning circuit. This is the actual RC value according to the circuit as fabricated, not merely as designed. Next, method 200 continues, at processing block 204, with comparing the real RC value to a predetermined RC value. The predetermined RC value is the designed value of the time constant. Finally, method 200 concludes, at processing block 206 by varying the real RC value (e.g., by opening and closing appropriate combinations of capacitor array switches 122) until the RC product equals, or closely
approximates to within an acceptable error, the predetermined RC value. Method 200 may then continue, at processing block 208, with applying the real RC value of the tuning circuit to the filter circuit. A method of finding the appropriate RC value is described in further detail below in conjunction with Figure 3. Figure 3 is a flow diagram of one embodiment of a method 300 for varying a real RC value until it is closest to a predetermined RC value in a filter tuning circuit. Method 300 begins, at processing block 302, with varying the capacitance value (also referred to herein as "C value" or "C") of the real RC value by a first increment to produce a first real RC value. Method 300 continues, at processing block 304, with varying the C value by a second increment to produce a second real RC value. Method 300 then continues, at processing block 306, with comparing the first and second real RC values to the predetermined RC value. Method 300 concludes, at processing block 308, with storing in a memory which ever of the first or second real RC value is closest to the predetermined RC value. In one embodiment, method 300 may further include, as shown in processing block 310, varying the C value in further increments to produce subsequent real RC values (fourth, fifth, and so on). Then, at processing block 312, method 300 may further include comparing the subsequent real RC values and the stored real RC value to the predetermined RC value. Finally, method 300 may further include, as shown in processing block 314, storing in memory the subsequent real RC values if closer to the predetermined RC value than the stored real RC value. In one embodiment, the real RC value may be incremented up to 16 times. These increments correspond to different open/closed combinations of capacitor array switches 122 and 128.
Figure 4 is a flow diagram of one embodiment of a method 400 for tuning a filter circuit. Method 400 utilizes elements described in conjunction with tuning circuit 100 further above. Referring to Figure 4, method 400 begins, at processing block 402, with initializing the capacitor array 120. Initializing the capacitor array 120 includes closing all the switches in the capacitor array 122 and 128, then closing the reset switch 126 to discharge the base capacitor 129 and the plurality of capacitors 124. In one embodiment, it is advantageous to wait at least one microsecond for the capacitors to discharge.
Then, method 400 continues, at processing block 404, with switching (closing and/or opening) a first combination of switches to provide a first capacitance in the capacitor array 120. The combination of switches can be determined by a computing algorithm stored in memory 130 and effectuated by CPU 170. In one example, a (4+l)-bit control line may be connected to the CPU 170 and configured to switch the capacitors in 16 different combinations (4 bits) as well as to control the reset switch (1 bit).
Next, at processing block 406, method 400 continues with measuring the RC time constant corresponding to the first capacitance value. An exemplary method 500 of measuring the RC time follows, is shown in Figure 5. First, in processing block 502, method 500 includes opening the reset switch immediately after, or simultaneously with, the switching of the first combination of switches. Then, method 500 continues, as shown in processing block 504, with starting the counter 140 immediately after, or simultaneously with, the opening of the reset switch. As time passes, the combination of switched capacitors in the capacitor array 120 will charge, causing output 108 to decrease as time passes. Method 500 may then continue, as shown at processing block 506, by stopping the counter 140 once the capacitors in the capacitor array 120 have charged. In one embodiment, the time it takes for the capacitor combination to charge corresponds to the RC time constant of the capacitor combination. Hence, the comparator 160 can be configured so that the voltage signal (V) received at the first comparator input 112 is at a low level thus causing the output 109 of the comparator 160 to go high when the output of the op-amp 108 drops below the other comparator input voltage signal (V3). Thus, once the comparator output signal 109 goes high, the counter 140 will stop counting. The counter 140 then has stored in it the number of clock cycles that cycled during the charging of the first combination of switched capacitors. This number of clock cycles represents the measurable time period it takes for the first combination of switched capacitors to reach their real RC time constant value.
Next, at processing block 408, method 400 continues with determining an RC time constant for the first capacitance value. The RC time constant is determined by multiplying the value of the resistor 110, the capacitance value of the capacitor array 120 for any given capacitor combination, and the design value (V2 - V3) / (Vi - V2).
For example, in one embodiment, capacitor array 120 may have 16 different capacitors (i.e., , and Ci - Cι5). A (4+l)-bit control line may also be used to switch the capacitors in 16 different combinations (4 bits) as well as to control the reset switch (1 bit). One exemplary combination would be, for instance, when capacitor array switches Sb, Si, S2 and S3 are switched on (which corresponding to the case of 4 bit control signal equal to 3). The corresponding RC time constant value would be the real resistance value (e.g., 265.08 kΩ ± manufacturing error ) multiplied by the sum of Cb (e.g., 5.4529 pF ± manufacturing error), Cj (e.g., 419.454 fF ± manufacturing error), C2 (e.g., 419.454 fF ± manufacturing error), and C3 (e.g., 209.727 fF ± manufacturing error), times the value (V2 - V3)/(V! - V2) (e.g., 1) or:
RC time COnstantfirst= RrealX Creal-first capacitance value (V2 -V3)/(Vι -V2) =
=Rreal x (Cb+ C,+ C2+ C3) x (V2 - V3)/(V, - V2) = 265.08 kΩ x (5.4529 pF + 419.454 fF + 419.454 fF + 209.727 fF) ± manufacturing error x (1) =1.723 μs + 5% (manufacturing error)
≡ 1.809 μs
The first RC time constant has a measurable time period (e.g., 1.809 μs). Next, method 400 continues, at processing block 410, with determining a first number of cycles of a clock signal. The clock signal generator 150 produces the clock signal at a particular frequency (e.g., 24. MHz). The number of cycles is computed by multiplying the frequency of the clock signal generator 150 (e.g., 24 MHz) by the measurable time period of the first RC time constant (e.g., 1.809 μs) , or: number of cyclesfιrst = (RC time constantfjrst) x (clock signal generator frequency)
= (1.809 μs) x (24 MHz)
= 43 ≤ a value Y representing the number of cycles Because the first RC time constant is measured in seconds and the clock signal generator frequency is measured in 1 /seconds, the number of cycles is a scalar value. Consequently, method 400 continues, at processing step 412, with comparing the first number of cycles (e.g., Y x 24 MHz, or 43) to a predetermined number of
cycles. The predetermined number of cycles is determined by multiplying the clock signal generator frequency by a predetermined measurable time period corresponding to a predetermined RC value (e.g., 24 MHz x 2μs = 48). The predetermined RC value is the designed RC value for a filter circuit. The predetermined number of cycles also results in a scalar value and may be stored in memory 130. Thus, in one embodiment, the scalar value of the first number of cycles can be compared to the scalar value of the predetermined number of cycles using a computing algorithm (e.g., is Y x 24MHz = 2μs x 24 MHz?). In another embodiment, the scalar values may each be stored in registers and compared to each other using hardware logic. After the first number of cycles is compared to the predetermined number of cycles, method 400 may continue in various ways depending on the outcome.
In one embodiment, if the first number of cycles is equal to the predetermined number (e.g., Y x 24MHz = 2μs x 24 MHz), then method 400 may continue, at processing block 414, with storing the bit value associated with the first combination and ending the process (e.g., storing the bit value of the control line that corresponds to the combination of switched switches Sb, Si, S2 and S3).
If, however, the first number of cycles is not equal to the predetermined number of cycles (e.g., Y x 24MHz ≠ 2μs x 24 MHz), method 400 may continue, as shown in processing blocks 416 - 422 with (1) storing the bit value of the first combination, (2) closing a second combination of switches to produce a second capacitance value, (3) turning on the clock signal generator and determining a second number of cycles, and (4) comparing the second number of cycles to the predetermined number of cycles.
In one embodiment, the CPU 170 may intelligently compare how close the first number of cycles was to the predetermined number of cycles and accordingly compute a second combination that will attempt to bring the second number of cycles closer to the predetermined number of cycles than the first. For instance, if the first number of cycles is 43, as shown in the example above, and the predetermined number of cycles is 48, then the CPU 170 can determine that 43 is lower than 48 and thus determine that the capacitance value of the capacitor array 120 must increase (i.e., switch on more capacitors, or switch off lower valued capacitors and switch on higher valued capacitors).
Then, if the second number of cycles is closer to the predetermined number of cycles than the first number of cycles, method 400 may continue, at processing block 424, with storing the bit value associated with the second combination. If, however, the second number of cycles is not closer to the predetermined number of cycles than the first number of cycles, then method 400 may continue, as shown in processing block 426, with repeating for subsequent combinations until one of the subsequent combinations of capacitance values produces a number of cycles equal to the predetermined number of cycles. In one embodiment, repeating may occur for a limited number of combinations until a subsequent value of clock cycles closely approximates the predetermined number of cycles (e.g., within an acceptable error tolerance). Then, at processing block 428, method 400 continues with storing the bit value of the subsequent combination associated with the subsequent number of cycles equal to, or most approximately equal to, the predetermined number of cycles.
Consequently, a filter circuit may have an RC filter design with a capacitor array similar to that of the tuning circuit. Method 400, therefore, may continue, as shown in processing block 430, with applying the bit value associated with any one of the first, second, or subsequent combination of switches to a capacitor array of a filter circuit. In one embodiment, the filter circuit may have a similar capacitor array and resistor as those of the tuning circuit, thus the RC value can be applied to the filter circuit by switching the capacitors in the capacitor array of the filter circuit to have the same switched configuration as the capacitors in the capacitor array of the tuning circuit. Hence, the filter circuit will have an RC response equal to, or very close to, that of the filter circuit, which should approximate that of the designed RC response.
Thus a method and apparatus for filtering a tuning circuit has been described. The scope of the present invention should only be measured by the claims, which follow.