The subject matter presented herein relates generally to duty-cycle correction, and in particular to circuits and methods for measuring, adjusting, and maintaining a desired duty cycle for a clock signal.
Periodic events are often characterized as having a “duty cycle,” which is the ratio of the duration of the event to the total period. Consider clock signals, for example, which are commonly used to time events on integrated circuits. Clock signals transition regularly between high and low voltage levels, and the transitions can be used as timing references. The duty cycle of a clock signal is the ratio of the amount of time the clock signal remains at the high voltage level relative to the total period of the clock. A clock signal that remains high 30% of the time has a 30% duty cycle, for example.
Many synchronous circuits are timed to just one type of clock edge, such as every rising edge. In that case, the spacing between rising edges, the clock period, is important to ensure precise timing. Because falling edges are not used, in this example, the spacing between adjacent rising and falling edges of less importance. Some circuits are timed to both rising and falling edges of a clock signal, however, in which case the spacing between adjacent rising and falling edges is ideally uniform, which is to say that the duty cycle should be 50%.
The figures are illustrations by way of example, and not by way of limitation. Like reference numerals in the figures refer to similar elements.
State machine 105 includes two input clock nodes, one to receive input clock signal CKin and another to receive a sample clock signal CKsam from a clock source 120. State machine 105 additionally includes a sampler 125, an accumulator 130, a counter 135, and a register 140.
Sampler 125 samples clock signal CKin on rising edges of sample clock signal CKsam. In this embodiment, sample clock signal CKsam has a period Tsam that can be specified using the following equation:
Tsam=Tin(M±1/N) (1)
where Tin is the clock period of clock signal CKin. M is an integer, five in this example, that provides a gross measure of the period of sample clock CKsam relative to signal CKin. In general, higher sample-clock frequencies resolve duty cycles more quickly but require increased power consumption and impose greater design constraints on source 120 and associated logic and routing. Furthermore, as the frequency of clock signal CKin increases, it may be difficult to generate a sample-clock having a frequency higher than the clock signal. Variable M can be selected to achieve a desired balance between efficiency and performance. The denominator N in equation (1) specifies the number of sample periods Tsam required to scan a full period of input clock signal CKin, and thus generate a measure of the duty cycle of clock signal CKin. Greater values of N provide improved measurement precision, but require more sample periods—and thus more time—to acquire a measure of duty cycle. N can also have positive fractional values, and can be an integer. A full measure of duty cycle can be taken using N samples, but other numbers might also be used depending upon the desired measurement accuracy and the time available to perform a duty-cycle measurement. If N is one thousand, for example, taking N±1 samples would introduce a relatively small error. In general, the number of samples taken can be varied depending on a desired measurement accuracy. Multiples of N samples can also be used, but the requisite additional measurement interval is undesirable in some embodiments.
Because the sample period Tsam includes the fractional value 1/N, the phase shift between clock signals CKsam and CKin increments by Tin/N for each period Tsam, and signal CKsam can be used to sub-sample CKin to measure its duty cycle. As a result, N successive samples taken over N sample periods Tsam represent a scan of one period Tin of the input clock signal. In the instant example, ten samples are taken over ten sample periods, and each sample instant is offset relative to signal CKin by an additional 1/10 of the period Tin. Three of the ten samples Sam are logic one, which indicates a duty cycle of 3/10, or 30%.
The sample window can begin on any edge of sample clock signal CKsam without impacting the measure of duty cycle. With reference to the specific example of
Accumulator 130 stores the ratio of samples to sampler periods (Sam/N), and consequently provides a measure of duty cycle. State machine 105 uses this information to correct duty-cycle errors. Assuming a 50% duty cycle is desired, for example, accumulator 130 can issue a hold signal Hold to counter 135 if the value Sam/N is 5. If Sam/N is greater than five, accumulator 130 can de-assert the hold signal and assert up/down signal U/D, causing counter 135 to increment. If Sam/N is less than 5, accumulator 130 de-asserts the hold signal and signal U/D, causing counter 135 to decrement. Digital calibration signal Dcal thus increments or decrements as needed to make duty-cycle corrections.
In this embodiment DAC 110 converts digital signal Dcal to an analog calibration voltage Vcal that adjusts the relative delays imposed by delay circuit 115 on rising and falling edges. In the example of
State machine 105 can continuously or periodically measure duty cycle and provide the appropriate feedback as needed to correct for changes that can result from e.g. supply-voltage and temperature variations. Register 140 can store the calibrated value for the count stored in counter 135 to expedite duty-cycle calibration when DCCC 100 is enabled or powered on. In some embodiments register 140 can be loaded, via a preload signal PreLD, to speed calibration, or can be read from for test purposes or to store the calibration value elsewhere. Accumulator 130 may also be configurable, and a register (not shown) may be included to store the value N and the desired number of “one” samples. Finer measurement granularity might be obtained, for example, by setting N equal to 100 and sample period Tsam to Tin(M+ 1/100).
Assume, for example, that clock signal CKref has a duty cycle of less than a desired 50%. Delay circuit 115 with an even number of stages (P is even), can be used to “stretch” the relatively high portion of each clock period by both advancing the rising edges and delaying the falling edges. This can be accomplished by decreasing voltage Vcal, and consequently increasing voltage Vcal/. The increase in voltage Vcal/ to the odd-numbered inverters increases their response to rising edges of the input and decreases their response to input falling edges. The concomitant decrease in Vcal has the opposite effect on the even-numbered inverters. The inputs to the even-numbered inverters are inverted relative to the inputs to the odd-numbered inverters, however, so the even-numbered inverters enhance the effects of the odd-numbered inverters. Delay circuit 115 thus increases the duty cycle of clock signal CKin responsive to reductions in voltage Vcal, and vice versa, in this embodiment. In embodiments in which voltages Vcal and Vcal/ control the odd-numbered and even-numbered inverters, respectively, duty cycle increase responsive to increases in Vcal.
If the duty cycle of signal CKref is greater than 50%, then signal AND/OR to multiplexer 420 is asserted. Clock signal CKin is therefore the AND of reference and delayed clock signals CKref and CKd. As depicted in
Timing circuit 600 includes a phase-locked loop (PLL) 605 and sample-clock tracking circuitry 610. PLL 605 is conventional, so a detailed discussion is omitted. Briefly, PLL 605 includes a phase detector 615, a charge pump 620, a low-pass filter 625, and a voltage-controlled oscillator (VCO) 630 placed in a negative feedback configuration. A frequency divider 635 may be included in the feedback path between the output of VCO 630 and phase detector 615 to make the frequency of reference clock signal CKref a multiple of a signal CKext. Clock signal CKext may be e.g. a reference clock signal supplied from a reference source external to an integrated circuit.
Tracking circuit 610 includes a divider 640, an accumulator 645, a DAC 650, an adder 655, and a VCO 660. Divider 640 includes a pair of counters (not shown) that accumulate the numbers of signal transitions for each of clock signals CKref and CKsam over a designated sample period. In the example in which Tsam=Tref(M+1/N), the ratio of frequencies Fref/Fsam ideally equals (MN+1)/N. Recalling that M is 5 and N is 10 in the example of
Divider 640 asserts a signal Inc/Dec to accumulator 645 if the sensed ratio exceeds (MN+1)/N. Accumulator 645 responds by incrementing its output Doff to DAC 650, which in turn increases offset voltage Voff. Adder 655 adds signal Voff and control voltage Vctrl from PLL 605. The increased offset voltage Voff increases the sum of voltages provided to VCO 660, causing VCO 660 to increase the frequency of sample clock signal CKsam, and therefore to reduce the sample period Tsam. Divider 640 de-asserts signal Inc/Dec if the sensed ratio falls below (MN+1)/N, leading to an increase in sample period Tsam. Control signal Vctrl from PLL 605 is shared in this embodiment so that VCO 660 tracks VCO 630 once the correct ratio is established. While adder 655 and the associated input from filter 625 are not absolutely necessary, they help in reducing the gain Kvco of VCO 660 and providing better accuracy for sampling clock CKsam. Timing circuit 600 can be instantiated entirely on an integrated circuit, or all or part can be located off-chip. In some embodiments, for example, either of both of the sample and reference clock signals can be developed off chip.
An output of a process for designing an integrated circuit, or a portion of an integrated circuit, comprising one or more of the circuits described herein may be a computer-readable medium such as, for example, a magnetic tape or an optical or magnetic disk. The computer-readable medium may be encoded with data structures or other information describing circuitry that may be physically instantiated as an integrated circuit or portion of an integrated circuit. Although various formats may be used for such encoding, these data structures are commonly written in Caltech Intermediate Format (CIF), Calma GDS II Stream Format (GDSII), or Electronic Design Interchange Format (EDIF). Those of skill in the art of IC design can develop such data structures from schematic diagrams of the type detailed above and the corresponding descriptions and encode the data structures on computer readable medium. Those of skill in the art of integrated circuit fabrication can use such encoded data to fabricate integrated circuits comprising one or more of the circuits described herein.
While the present invention has been described in connection with specific embodiments, variations of these embodiments will be obvious to those of ordinary skill in the art. For example, while the presented duty cycle corrector circuit embodiment uses single ended inverters, similar ideas can be used for differential delay elements. Moreover, some components are shown directly connected to one another while others are shown connected via intermediate components. In each instance the method of interconnection, or “coupling,” establishes some desired electrical communication between two or more circuit nodes, or terminals. Such coupling may often be accomplished using a number of circuit configurations, as will be understood by those of skill in the art. Therefore, the spirit and scope of the appended claims should not be limited to the foregoing description. Only those claims specifically reciting “means for” or “step for” should be construed in the manner required under the sixth paragraph of 35 U.S.C. §112.
Number | Date | Country | |
---|---|---|---|
61534676 | Sep 2011 | US |