Circuit for calibration measurements, method, computer program, and electronic device
10498308 ยท 2019-12-03
Assignee
Inventors
Cpc classification
International classification
Abstract
A circuit for calibration measurements comprises a first and a second current source arranged to provide current outputs; a resistor connected between the first current source and a reference voltage; a capacitor connected between the second current source and the reference voltage; a discharge switch connected in parallel with the capacitor and arranged to selectively discharge the capacitor; a comparator circuit arranged to compare voltages across the resistor and the capacitor and output a signal when voltage across the capacitor reaches the voltage across the resistor; and a controller having a clock signal input and connected to the output of the comparator circuit. The controller is arranged to control the discharge switch to discharge the capacitor, change state of the switch to enable charging of the capacitor and count clock signal pulses until the comparator provides the signal when voltage across the capacitor reaches the voltage across the resistor, wherein the controller is arranged to determine a calibration measurement from counted number of clock signal pulses. A method, computer program and electronic device are also disclosed.
Claims
1. A circuit for calibration measurements comprising a first and a second current source arranged to provide current outputs; a resistor connected between the first current source and a reference voltage; a capacitor connected between the second current source and the reference voltage; a discharge switch connected in parallel with the capacitor and arranged to selectively discharge the capacitor; a comparator circuit arranged to compare voltages across the resistor and the capacitor and output a signal when a voltage across the capacitor reaches the voltage across the resistor; a controller having a clock signal input and connected to the output of the comparator circuit, wherein the controller is arranged to control the discharge switch to discharge the capacitor, change state of the switch to enable charging of the capacitor and count clock signal pulses until the comparator provides the signal when voltage across the capacitor reaches the voltage across the resistor, wherein the controller is arranged to determine a calibration measurement from counted number of clock signal pulses; and a switching arrangement enabling an alternative connection comprising that the second current source is selectably connected to the resistor instead, and the first current source is selectably connected to the capacitor instead, wherein the controller further is arranged to control enabling of the alternative connection and to make a second determination of counted clock signals for the alternative connection, and the calibration measurement is determined from the two counts of clock signal pulses.
2. The circuit of claim 1, wherein the switching arrangement comprises: a first switch having an input connected to the first current source and arranged to selectively connect the first current source to either a first node connected to a first terminal of the resistor and a first input of the comparator, or a second node connected to a first terminal of the capacitor and a second input of the comparator; and a second switch having an input connected to the second current source and arranged to selectively connect the second current source to either the second node or the first node.
3. The circuit of claim 1, wherein the switching arrangement is also arranged to enable a swap of the comparator inputs with each other.
4. The circuit of claim 3, wherein the switching arrangement comprises a first switch having an input connected to the first current source and a first input of the comparator and arranged to selectively connect the first current source to either a first node connected to a first terminal of the resistor, or a second node connected to a first terminal of the capacitor; and a second switch having an input connected to the second current source and a second input of the comparator and arranged to selectively connect the second current source to either the second node or the first node.
5. The circuit of claim 1, further comprising a filter capacitor connected in parallel with the resistor and arranged to low-pass filter noise caused by the resistor.
6. The circuit of claim 1, wherein a calibration value is determined from the calibration measurement through a look-up table mapping calibration measurements to calibration values.
7. The circuit of claim 1, wherein a calibration value is determined from the calibration measurement through a computing arrangement arranged to compute a ratio between the counted number of clock pulses and a value indicating a number of clock pulses associated with a desired combination of resistance and capacitance.
8. The circuit of claim 7, wherein a compensation value for systematic latency in the circuit is provided, wherein a denominator of the ratio comprises a difference between the counted number of clock pulses and the compensation value.
9. The circuit of claim 7, wherein the resistor has a programmable resistance controlled by a resistor control value, and/or the capacitor has a programmable capacitance controlled by a capacitance control value, wherein the computation arrangement is arranged to adjust the calibration value for the setting of resistor control value and/or capacitor control value at the calibration measurement.
10. The circuit of claim 7, wherein computations by the computation arrangement are made for a plurality of programmable resistor or capacitance values and are stored for each programmable value, wherein the resistor or capacitance value is comprised in the denominator of the ratio.
11. An electronic device comprising a circuit of claim 1.
12. The electronic device of claim 11, being a communication apparatus.
13. A method for a calibration measurement circuit that has: a first and a second current source arranged to provide current outputs; a resistor connected between the first current source and a reference voltage; a capacitor connected between the second current source and the reference voltage; a discharge switch connected in parallel with the capacitor and arranged to selectively discharge the capacitor; a comparator circuit arranged to compare voltages across the resistor and the capacitor and output a signal when a voltage across the capacitor reaches the voltage across the resistor, wherein the method comprises: controlling the discharge switch to discharge the capacitor; clearing a counter; changing a state of the switch to enable charging of the capacitor; counting clock signal pulses until the comparator provides the signal when voltage across the capacitor reaches the voltage across the resistor; determining a calibration measurement from the counted number of clock signal pulses; forming an alternative connection comprising that the second current source is connected to the resistor instead, and the first current source is connected to the capacitor instead; and making a second determination of counted clock signals for the alternative connection, wherein the calibration measurement is determined from the two counts of clock signal pulses.
14. The method of claim 13, wherein the forming of the alternative connection also comprises swapping the comparator inputs with each other.
15. The method of claim 13, comprising determining a calibration value from the calibration measurement through a look-up table mapping calibration measurements to calibration values.
16. The method of claim 13, comprising determining a calibration value from the calibration measurement by computing a ratio between the counted number of clock pulses and a value indicating a number of clock pulses associated with a desired combination of resistance and capacitance.
17. The method of claim 16, comprising providing a compensation value for systematic latency in the circuit, wherein a denominator of the ratio comprises a difference between the counted number of clock pulses and the compensation value.
18. The method of claim 16, wherein the resistor has a programmable resistance controlled by a resistor control value, and/or the capacitor has a programmable capacitance controlled by a capacitance control value, wherein the method comprises adjusting the calibration value for the setting of resistor control value and/or capacitor control value at the calibration measurement.
19. The method of claim 16, comprising computing calibration values for a plurality of programmable resistor or capacitance values; and storing the computed calibration values for each programmable value, wherein the resistor or capacitance value is comprised in the denominator of the ratio.
20. A nontransitory computer readable medium comprising a computer program that comprises computer executable instructions which when executed by a programmable controller of an electronic circuit for performing calibration measurements causes the controller to perform a method for a calibration measurement circuit that has: a first and a second current source arranged to provide current outputs; a resistor connected between the first current source and a reference voltage; a capacitor connected between the second current source and the reference voltage; a discharge switch connected in parallel with the capacitor and arranged to selectively discharge the capacitor; a comparator circuit arranged to compare voltages across the resistor and the capacitor and output a signal when a voltage across the capacitor reaches the voltage across the resistor, wherein the method comprises: controlling the discharge switch to discharge the capacitor; clearing a counter; changing a state of the switch to enable charging of the capacitor; counting clock signal pulses until the comparator provides the signal when voltage across the capacitor reaches the voltage across the resistor; and determining a calibration measurement from the counted number of clock signal pulses; forming an alternative connection comprising that the second current source is connected to the resistor instead, and the first current source is connected to the capacitor instead; and making a second determination of counted clock signals for the alternative connection, wherein the calibration measurement is determined from the two counts of clock signal pulses.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The above, as well as additional objects, features and advantages of the present invention, will be better understood through the following illustrative and non-limiting detailed description of preferred embodiments of the present invention, with reference to the appended drawings.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
DETAILED DESCRIPTION
(14) Embodiments of the present invention are based on the following principles:
(15) When a resistor, grounded at one end and having a resistance R, is supplied with a current I.sub.R, the voltage across the resistor is V.sub.R=I.sub.R.Math.R. When an initially discharged capacitor, grounded at one end and having a capacitance C, is supplied with a constant current I.sub.C, the voltage across the capacitor is V.sub.C=(I.sub.C.Math.t)/C, where t denotes the time since the capacitor began to be charged. When I.sub.R=k.Math.I.sub.C the time t for which V.sub.R=V.sub.C is readily derived to be equal to a scaled time constant k.Math.R.Math.C, where k is a scaling factor. If k=1, this time is equal to the RC time constant. Thus, the RC time constant can be measured by measuring the time it takes for the capacitor to be charge to V.sub.C=V.sub.R. Measuring this time can e.g. be done by a counter circuit counting clock pulses of a reference clock signal having a well-defined frequency, such as a clock signal derived directly or indirectly (e.g. using a phase-locked loop) from a crystal oscillator. The detection of the event that V.sub.R=V.sub.C can be made with a voltage comparator, the output of which can be used to instruct the counter to stop counting. This is a comparably fast way of measuring the RC time constant, since in principle, the RC time constant can be measured in a single charge/discharge cycle of the capacitor (although some embodiments presented below make use of two such cycles to compensate for e.g. offset errors and/or current mismatch). Even though manufacturing inaccuracies etc. can make actual RC constants of integrated RC circuits deviate relatively much from nominal values, there is typically a strong correlation between such deviations for RC circuits (using the same types of resistors and capacitors) integrated on the same integrated circuit chip (as opposed to RC circuits integrated on different integrated circuit chips). Thus, if the RC time constant has been measured (e.g. using the principles outlined above) for a reference RC circuit on one chip, this measured RC time constant can be used to relatively accurately tune the RC time constants of other RC circuits on that same chip.
(16) According to embodiments, the currents I.sub.R and I.sub.C can be made equal. Equal should here be construed with practical technical implementation in mind where some deviation may occur due to for example manufacturing process accuracy, temperature gradients, etc. For the sake of easier understanding of principles, the embodiments demonstrated with reference to the figures assume that the currents I.sub.R and I.sub.C are equal. According to other embodiments I.sub.R and I.sub.C are scaled by a factor of k, and computations are then made taking the scaling into account. In other senses, the features demonstrated below apply for these other embodiments.
(17)
(18) Thus, the first current source 202 will provide a current through the resistor 204 wherein a voltage will be created across the resistor 204. The second current source 203 will charge the capacitor 205 which will build up a voltage across the capacitor 205. After a while, the voltage across the capacitor 205 will reach the level of the voltage across the resistor 204. The time for reaching this state will be used for the calibration measurement.
(19) A comparator circuit 206 is connected to respective nodes where the voltages across the resistor 204 and capacitor 205, respectively, are present. Thereby, the comparator circuit 206 is capable to provide an output signal indicating when the voltage across the capacitor 205 reaches the same value as that across the resistor 204. To ensure that the capacitor is discharged when the charging by the second current source 203 commences, a discharging switch 207 is provided in parallel with the capacitor 205. The switch 207 is controlled by a controller 208. The controller 208 also receives the output from the comparator circuit 206 and a clock signal. The controller 208 thus discharges the capacitor 205 by closing the switch 207, opens the switch 207 to enable charging of the capacitor 205 and starts counting clock pulses of the clock signal until the controller receives a signal from the comparator circuit 206 that the capacitor voltage has reached the resistor voltage. A calibration value can then be computed based on the number of counted clock pulses. As will be demonstrated below, the computation can be performed by fairly simple arithmetic computations, but can also be pre-calculated wherein the calibration value is read from a look-up table based on the number of counted clock pulses. As also demonstrated below, the calibration value may be a vector or matrix for different settings of the RC-circuit to be calibrated.
(20) It can thus be seen that the approach provides a fast result since the calibration value is obtainable after one measurement period, i.e. one discharging and charging of the capacitor to resistor voltage and a following arithmetic computation/look-up table access, which provides significantly shorter time than some of the approaches described in the background section. Below, it is described embodiments where two consecutive such measurement periods are made to compensate for comparator offset and/or current mismatch, but these still provide a relatively fast result since the discharging and charging of the capacitor, even if made twice, take relatively little time.
(21) Current through a resistor inherently generates noise. To avoid or at least alleviate the effect of that noise on the input of the comparator 206, a filter capacitor 209 may optionally be connected in parallel with the resistor 204 which then low-pass filters the noise contribution at the input of the comparator 206.
(22)
(23) An optional filter capacitor 309 may, similar to what has been demonstrated with reference to
(24) A further problem may be that the comparator may have an inherent offset between the inputs. This can be combated by swapping the inputs of the comparator as well and make measurements with the different configurations. This can be made by adding switches for the swapping. However, this increases complexity by additional switches, which also may have other unwanted effects if not arranged properly. As demonstrated below, an approach may be used which does not increase complexity compared to the solution demonstrated with reference to
(25)
(26) An optional filter capacitor 409 may, similarly to what has been demonstrated with reference to
(27)
(28) The voltage on capacitor 505 charged by a current i(t) is
(29)
(30) When the charging current i(t) is a constant i, and the charging is from t=0,
(31)
(32) While the voltage VR on the resistor 504 is iRn, when VR=VC, we have t=RnCm. This could be reached when the charging current i(t) is constant. In fact, as long as the current is constant, the RC measurement is independent of the current strength. However in practice of an implementation, like
(33)
(34) The timing diagram indicates the performing of two measurement periods where the gating signal is made high first for the first measurement and then made high for the second measurement. The principle of using only one measurement period, i.e. applicable for the circuit 200 demonstrated with reference to
(35) To reach higher measurement accuracy, a filter capacitor C.sub.f may be used to reduce the thermal noise during comparison. The current in the branch may be weak and the resistance Rn may be large, which may result in large voltage noise. Besides the thermal noise, some comparators often have a kick-back effect when the comparator is toggling the output, which may increase measurement error too. With the aid of the filter capacitor, the thermal noise is low pass filtered and the kick-back effect introduced by the comparator is reduced, thus improving the measurement accuracy.
(36) The input of the comparator may have an offset caused by process mismatch. In addition, the current source branches may also have mismatch. To reach higher measurement accuracy, one way to alleviate this mismatch is to increase the device sizes in the comparator and current sources, but this may make the circuit slow and having large parasitics, which in turn will introduce measurement errors as well. While the solution mentioned above is the two-period measurement where a switching arrangement is used to flip connections between the nodes of connection of the comparator and the R and C branches, so that the input offset due to the comparator and current source mismatch is cancelled effectively. This solution is able to be combined with the use of the filter capacitor demonstrated above.
(37)
(38) After the two-period measurement, a set of clock pulses at signal CCK may be created by the controller, and the computing arrangement may use these pulses to compute required control words for a variable bandwidth low-pass filter VBWLPF if the computing arrangement is implemented in on-chip hardware.
(39)
(40) The resistors of the circuit to be calibrated may be tuned linearly in a range with a programmable control word, for instance, a resistor with a fixed part R.sub.o in series with a programmable part R.sub.p, where a unit resistance r.sub.o can be used for explaining a feasible approach. The fixed part may for example have a resistance R.sub.o which is r.sub.o.Math.a.sub.0, and the programmable part may have a resistance R.sub.p which is r.sub.o.Math.p, where a.sub.0 and p are integers. The aggregate resistance then becomes R.sub.a, i.e.
R.sub.a=R.sub.o+R.sub.p=r.sub.o.Math.a.sub.0+r.sub.o.Math.p=r.sub.o(a.sub.0+p)=r.sub.o.Math.a,
(41) where a is an integer, a.sub.maxaa.sub.0 with a.sub.max representing largest resistance value, and a=a.sub.0+p.
(42) Similarly, a capacitor built with programmable unit cells connected in parallel can be expressed as
C.sub.b=c.sub.0.Math.b
(43) where b.sub.maxbb.sub.0 and b is an integer too, and b.sub.max representing a largest capacitance value.
(44) The target time constant T.sub.t for the calibration can be expressed as
T.sub.tR.sub.a.Math.C.sub.b=r.sub.o.Math.c.sub.o.Math.a.Math.b=t.sub.o.Math.a.Math.b
(45) where t.sub.o is a unit cell time constant.
(46) The sample resistor and capacitor in the sample RC time constant measurement, SRCM, circuit are also designed in a similar way, so
R.sub.n=r.sub.o.Math.n,
and
C.sub.m=c.sub.o.Math.m
(47) where n and m are integers. The R.sub.n and C.sub.m may be programmable or may be built with a fixed number of series or parallel units, i.e., n and m, respectively. We can define the unit cell time constant t.sub.o for a RC unit cell as for the circuit to be calibrated, i.e. t.sub.or.sub.o.Math.c.sub.o. With this in mind, we can express the time constant for the sampling RC components as
T.sub.mnR.sub.n.Math.C.sub.m=t.sub.o.Math.m.Math.n
(48) In practice, the resistor and capacitor components normally may occupy a relative large area, such that the matching accuracy is sufficient. However, the unit cell time constant t.sub.o for the RC unit is process dependent which may lead to as large as +/25% error. The calibration work aims at finding a proper control number, e.g. represented with a control word in binary format, for a targeted time constant in e.g. an RC based low pass filter design, i.e, the values for a and b when both R and C can be programmable, or the number b when only C is programmable, or the number a when only R is programmable.
(49) To calibrate e.g. VBWLPF, the task is further to find multiple time constants T.sub.t1, T.sub.t2, . . . T.sub.tn accordingly. For the i:th targeted time constant T.sub.ti, we can have
T.sub.ti=t.sub.o.Math.a.sub.i.Math.b.sub.i=t.sub.o.Math.M.sub.i
(50) where M.sub.i is the product of the control numbers. As
(51)
(52) we have
(53)
(54) If we use T.sub.mn as the counting time for a counter running at a system clock frequency f.sub.cks, the counted number in the end is N.sub.mn=T.sub.mn.Math.f.sub.cks and the targeted time constant can be converted also in a number counted in cycles of f.sub.cks, i.e. N.sub.ti=T.sub.ti.Math.f.sub.cks. So we can get the control number M.sub.i for i=1, 2, . . . , I.sub.n, assume that there are I.sub.n time constants in the VBWLPF:
(55)
(56) To implement the time constants, one may prefer to first fix one of the parameter a.sub.i or b.sub.i. For instance, we fix a.sub.i, i.e, use a fixed resistor R.sub.ai=r.sub.o.Math.a.sub.i, then b.sub.i can be computed according to:
(57)
(58) which can be translated into binary control words so that the filter is calibrated and the zeros and poles will be independent of process change, i.e, the change of the unit time constant t.sub.o.
(59) In general, due the circuit latency introduced by the comparator and control logic, the measured time constant for T.sub.mn may be a bit larger than the real one. As it is a constant positive error, a compensation can be added as
(60)
(61) where n.sub.c is a compensation item which is usually very small, and b.sub.i is the control value represented by the control word.
(62) For the VBWLPF multiple RC component parameters calibration, the control word can be created either by a micro controller, an on chip parameter computing arrangement implemented in hardware or extracted from a predefined lookup table. A schematic of the an embodiment of the computing arrangement 800 implemented in application-specific hardware is shown in
(63)
(64)
(65)
(66) The antenna port described above need not necessarily by connected to an antenna, but can equally be connected to a wired line which conveys radio frequency signals. Thus, the communication device 1100 described with reference to
(67) The receiver or transceiver arrangement 1102 can comprise a controller 1108 for controlling the operation of the receiver, transmitter or transceiver arrangement 1102. The controller 1108 can be arranged to perform the operations of the calibration measurements as demonstrated above, e.g. control, computation, lookup table access, etc. In particular, the calibration measurement is for calibration measurement of an RC circuit.
(68) The methods according to the present invention are suitable for implementation with aid of processing means, such as computers and/or processors, especially for the case where for example a baseband processor can be used for the control and computations or other controller used in connection with the circuits to be calibrated. Therefore, there is provided computer programs, comprising instructions arranged to cause the processing means, processor, or computer to perform the steps of any of the methods according to any of the embodiments described with reference to
(69) The invention has mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the invention, as defined by the appended patent claims.