A time to digital converter (TDC) is a device that converts time information into a digital code. The TDC measures a time difference between features of input signals and generates a digital code corresponding to the time difference. The features may, for example, include rising edges of the signals, falling edges of the signals, logic level transitions of the signals, etc. TDCs are used in a variety of applications, such as analog to digital converters, phase locked loops, delay locked loops, image sensors, scanning devices, distance measurement devices, etc.
A time to digital converter that compensates for timing errors induced by use of asynchronous start and stop signals with synchronous circuitry is disclosed herein. In one embodiment, a timing circuit includes an interpolator. The interpolator includes a fine counter, a coarse counter, and stop correction logic. The coarse counter is incremented by a rollover output of the fine counter to generate a coarse count value. The rollover output includes a leading edge and a trailing edge. The stop correction logic is coupled to the fine counter and the coarse counter. The stop correction logic is configured to divide each cycle of the rollover output into three time intervals. A first of the three time intervals extends from the leading edge to a predetermined time prior to the trailing edge. A second of the three time intervals extends from the predetermined time prior to the trailing edge to a predetermined time after the trailing edge. A third of the three time intervals extends from the predetermined time after the trailing edge to a succeeding leading edge. The stop correction logic is also configured to select a coarse counter output value to represent a time interval measured by the coarse counter based on a one of the first, second, and third intervals in which a time measurement stop signal is detected.
In another embodiment, a timing circuit includes a clock counter, an interpolator, and timer control logic. The clock counter is configured to count cycles of a reference clock. The interpolator is configured to measure time intervals at higher resolution than the clock counter. The timer control logic is configured to generate a timing window about each edge of the reference clock on which the clock counter is incremented, to control starting of the clock counter based on a timing relationship of the timing window to a start signal that indicates initiation of a time interval to be measured, and to combine an output count of the clock counter and an output count of the interpolator to generate a value corresponding to a duration of the time interval to be measured.
In a further embodiment, a timing circuit includes a clock counter, an interpolator, and timer control logic. The clock counter is configured to count cycles of a reference clock. The interpolator is configured to measure time intervals at higher resolution than the clock counter. The interpolator includes a fine counter, a coarse counter, and stop correction logic. The coarse counter is incremented by a rollover output of the fine counter to generate a coarse count value. The rollover output includes a leading edge and a trailing edge. The stop correction logic is coupled to the fine counter and the coarse counter. The stop correction logic is configured to divide each cycle of the rollover output into three time intervals. A first of the three time intervals extends from the leading edge to a predetermined time prior to the trailing edge. A second of the three time intervals extends from the predetermined time prior to the trailing edge to a predetermined time after the trailing edge. A third of the three time intervals extends from the predetermined time after the trailing edge to a succeeding leading edge. The stop correction logic is also configured to select a coarse counter output value to represent a time interval measured by the coarse counter based on a one of the first, second, and third intervals in which a time measurement stop signal is detected. The timer control logic is configured to generate a timing window about each edge of the reference clock on which the clock counter is incremented, to control starting of the clock counter based on a timing relationship of the timing window to a start signal that indicates initiation of a time interval to be measured, and to combine an output count of the clock counter and an output count of the interpolator to generate a value corresponding to a duration of the time interval to be measured.
For a detailed description of exemplary embodiments of the invention, reference will now be made to the accompanying drawings in which:
Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, various companies may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . . ” Also, the term “couple” or “couples” is intended to mean either an indirect or direct connection. Thus, if a first device couples to a second device, that connection may be through a direct connection or through an indirect connection via other devices and connections. The recitation “based on” is intended to mean “based at least in part on.” Therefore, if X is based on Y, X may be based on Y and any number of additional factors.
The following discussion is directed to various embodiments of the invention. Although one or more of these embodiments may be preferred, the embodiments disclosed should not be interpreted, or otherwise used, as limiting the scope of the disclosure, including the claims. In addition, one skilled in the art will understand that the following description has broad application, and the discussion of any embodiment is meant only to be exemplary of that embodiment, and not intended to intimate that the scope of the disclosure, including the claims, is limited to that embodiment.
High precision time to digital converters (TDCs) are subject to a variety of issues and limitations. For example, in high precision time to digital converters (TDC), resolution is limited by the fastest reference frequency available in the system, and the fastest gate-delay achievable in the applied semiconductor process. For the sub 100 pico-second resolution required in state of the art TDCs, power efficiency concerns bar the use of high frequency oscillators. Instead, interpolation techniques using delay lines are often implemented.
The use of interpolation techniques leads to two fundamental problems in cases where the START and STOP events triggering the TDC are asynchronous events that need to be detected with minimal delay. First, synchronizers and other standard digital techniques cannot be used because their use results in undesirable timing errors. Second, any counters used should be started, stopped, and count values saved without introducing timing errors.
Embodiments of the TDC disclosed herein provide high-resolution time measurements with asynchronous start and stop signals. Embodiments control counter operation based on a timing relationship of the start and stop signals defining an interval to be measured to a clock that increments the counter. Embodiments also include an interpolator that corrects coarse counter output values based on a timing relationship of the stop signal to a clock incrementing the coarse counter. The aforementioned innovations allow embodiments of the present disclosure to provide high-resolution time measurement while avoid the timing errors and other issued to which conventional TDCs are subject.
While clock counter 102 provides time measurement that is limited to the resolution of the reference clock, the interpolator 104 can provide a substantially higher timing resolution than that associated with the reference clock. Accordingly, the interpolator 104 may time sub-intervals of the reference clock in situations where an interval to be measured by the TDC 100 is asynchronous to the reference clock.
The timer control logic 106 includes logic that controls the operation of the clock counter 102 and interpolator 104, and generates a time value based on outputs of the clock counter and/or the interpolator 104. For example, when an event (e.g., a time measurement start event) triggers the TDC 100 to begin measurement, the timer control logic 106 may assert signals 108, 112 to initiate operation of the clock counter 102 and/or the interpolator 104 as needed to measure a time interval. The timer control logic 106 may receive time measurement values 110, 114 from the clock counter 102 and/or the interpolator and process the time values (e.g., combine the time values) to generate a final time value corresponding to the measured time of the interval.
The registers 304 latch the outputs of the ring oscillator delay elements. Table 1 shows a sequence of values output by the ring oscillator 302 and presented to the registers 304. In practice, the registers 304 may latch the ring oscillator outputs only when a timing value is needed, for example, when use of the interpolator 104 for timing measurement is complete. While particular thermometer codes are shown in Table 1 as being generated by the ring oscillator 302, some embodiments of the ring oscillator 302 may generate different thermometer codes.
The transition detector 306 receives the ring oscillator count values latched in the registers 304 and adjusts the count values to correct bubbles in the latched values. Bubbles are erroneous digits (e.g., erroneous logic zeroes) in the thermometer codes generated by the fine counter 202.
The coarse counter 204 is incremented by the roll over signal 208 generated by the ring oscillator 302. The coarse counter 204 may generate count values as a gray code.
The stop correction logic 206 includes registers 310 and 322, gray code to binary code conversion logic 312, selector 314, stop detection logic 316, multiplier 318, adder 320, and thermometer to binary code conversion logic 308. The thermometer to binary code conversion logic 308 converts the thermometer code values generated by the fine counter 202 to binary count values, as illustrated in Table 1 above. In some embodiments, the thermometer to binary code conversion logic 308 may include logic to correct bubbles in the thermometer codes.
Time count values generated by the coarse counter 204 are latched in the register 310 and converted from the gray code values produced by the coarse counter 204 to binary values, by the gray code to binary code conversion logic 312. In some embodiments, the coarse counter 204 may be incremented on the leaded edge of the rollover signal 208 and the coarse counter output value latched into register 310 on the trailing edge of the rollover signal 208.
A stop signal (i.e., to halt interpolator 104 time measurement) asynchronously asserted near in time to the rollover of the fine counter can cause an error in the latched output of the coarse counter 204, which in turn can cause a substantial error in time measurement. To prevent such errors from affecting the interpolator output count value 114, the stop detection logic 316 monitors the timing of stop signal assertion relative to the rollover signal 208 that increments the coarse counter 204. Based on a relationship of the stop signal to the rollover signal, the stop detection logic 316 will correct the coarse output count value by selecting either the coarse counter output value most recently latched in register 310 or the coarse counter output value generated by the coarse counter on the cycle immediately prior to the last latched coarse counter output value to use in generation of the interpolator output value 114.
If the stop detection logic 316 detects assertion of a stop signal during intervals A or C, then the stop detection logic 316 causes the selector 314 to select the coarse counter output value generated one clock cycle prior to the last latched coarse counter output value for further processing. On the other hand, if the stop detection logic 316 detects assertion of a stop signal during interval B, then the stop detection logic 316 causes the selector 314 to select the most recently latched coarse counter output value for further processing. Stop signals asserted during interval B are asserted after the coarse counter 204 has been incremented (i.e., after the leading edge), and therefore, the last coarse count value prior to assertion of the stop signal will be latched on the subsequent trailing edge of the coarse counter clock 208. Conversely, the coarse counter 204 is incremented one additional time after assertion of a stop signal during intervals A or C, and thereafter the incremented output of the coarse counter 204 is latched. The stop detection logic 316 compensates for the additional increment of the coarse counter 204 caused by assertion of stop signals during intervals A or C. By identifying the timing relationship of the asynchronously asserted stop signal to the coarse counter clock 208, the stop detection logic 316 can correct errors in coarse counter output and resulting interpolator timing output.
Returning now to
To eliminate timing errors due to uncertainties arising from the asynchronous nature of the signals that start and stop the TDC 100, the timer control logic 106 controls activation of the clock counter 102 and the interpolator 104 based on the timing relationship between the start/stop signals and the edge of the reference clock on which the clock counter 102 is incremented.
The timer control logic 106 generates a time window (Tu) about the edge of the reference clock that increments the clock counter 102. In
If a start or stop signal is asserted within the timing window Tu, then the timer control logic 106 may delay activation of the clock counter 102 until the next occurring edge of the reference clock that increments the clock counter (i.e., the next rising edge of the reference clock). In
If a stop signal is asserted during the timing window Tu, then the timer control logic 106 allows the clock counter 102 to remain active until the next rising edge of the reference clock and activates the interpolator 104 to time the interval between the stop signal and the deactivation of the clock counter 102.
The timing circuits disclosed herein are suitable for use in various devices and applications that require precise time measurement. For example, the TDC 100, or portions thereof (e.g., the interpolator 104) may be included in an analog to digital converter, a phase locked loop, a delay locked loop, an image sensor, a scanning device, a distance measurement device, or any other device that benefits from precise time measurement.
The above discussion is meant to be illustrative of the principles and various embodiments of the present invention. Numerous variations and modifications will become apparent to those skilled in the art once the above disclosure is fully appreciated. It is intended that the following claims be interpreted to embrace all such variations and modifications.
The present application claims priority to U.S. Provisional Patent Application No. 61/936,580, filed Feb. 6, 2014, titled “CORRECTIVE SCHEME FOR LOW POWER, HIGH RESOLUTION TRANSIT TIME MEASUREMENT,” which is hereby incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
61936580 | Feb 2014 | US |