Professional Documents
Culture Documents
Target Specification
TDC-GP2
2-channel Universal
Time-to-Digital Converter
26th May 2010
Document-No.: DB_GP2_e V2.0
TDC
TDC-GP2
Disclaimer / Notes
The information provided by this data sheet is believed to be accurate and reliable. However, no
responsibility is assumed by acam for its use, nor for any infringements of patents or other rights
of third parties that may result from its use. The information is subject to change without notice
and is provided as is without warranty of any kind (expressed or implied). Picostrain is a registered
trademark of acam. All other brand and product names in this document are trademarks or service
marks of their respective owners.
Support
For a complete listing of direct sales, distributors and sales representatives visit the acam website
at:
http://www.acam.de/company/distributors
For technical support you can contact the acam support team in the headquarter in Germany or the
Distributor in your country. The contact details of acam in Germany are:
sales@acam.de
or by phone
+49-7244-74190.
TDC-GP2
Table of Contents
1-4
1 Overview
2 Characterisitcs &
Specifications
2-1
2.2 Timings
2-3
2-6
2-7
2-8
3 Measurement Mode 1
4 Measurement Mode 2
2-10
3-1
3-2
4-1
4-2
4-7
5.1 Oscillator
5-1
5-4
5-7
5.4 SPI-interface
5-10
5-11
5-11
6 Applications
6-1
7 Miscellaneous
7-1
Time-to-Digital-Converter
TDC-GP2
TDC-GP2
Overview
1.1
Introduction
TDC-GP2 is the next generation of acam generalpurpose TDCs. Higher resolution and smaller package size make it ideal for cost sensitive industrial applications. With special functional blocks like a
fire-pulse generator, stop-enable, temperature measurement, and clock control it is perfectly suited
for ultrasonic flow-meter and heat-meter applications.
1.2
Features
Measurement Mode 1
Temperature Measurement
2 or 4 sensors
PT500/PT1000 or higher
1.8s
every 30 seconds)
each other
Trigger to rising or/and falling edge
General
QFN 32 package
I/O voltage 1.8 V to 5.5 V
Measurement Mode 2
multihit capability
lution
1-4
Time-to-Digital-Converter
1.3
1-5
TDC-GP2
Blockdiagram
TDC-GP2
2.1
Electrical Characteristics
- 0.3 to 4.0 V
- 0.3 to 7.0 V
30 mA
- 65 to 150 C
max.125 C
Recommended Operating Conditions
Symbol
Parameter
Conditions
Min
Vcc
Vio
tri
Max
Unit
1.8
3.6
1.8
5.5
50
ns
tfa
50
ns
tri
ms
tfa
ms
Ta
Ambient Temperature
120
Typ
-40
125C
*including the oscillator pins XIN, XOUT, Clk32In, Clk32Out
DC Characteristics (Vio = Vcc = 3.3 V 0.3 V, Tj = -40 to +85C)
Symbol
Parameter
Conditions
I32
Current 32 kHz
Min
Typ
Max
Unit
4.5
260
15
mA
<150
nA
cillator running,
Vcc = 3.6 V
Ihs
Current 4 Mhz
Itmu
Iddq
unit
measurement
Quiescent current
Il
Voh
-1
Ioh= tbd mA Vio=Min.
+1
Vio-
A
V
0.4
2-1
Time-to-Digital-Converter
Symbol
Parameter
Conditions
Vol
Vih
Vil
Vth
TDC-GP2
Min
Typ
Max
Unit
0.4
2.0
V
0.8
1.1
2.4
0.6
1.8
Voltage
Vtl
Vh
0.1
Terminal Capacitance
Symbol
Terminal
Condition
Rated Value
Min.
Typ.
Unit
Max.
Ci
Input
10
Co
Output
f = 1 MHz,
10
Cio
Bidirectional
Ta = 25C
10
pF
Terminal
LSB
Condition
Vio = Vcc = 3.3 V
Standard Deviation
2-2
Rated Value
Unit
Min.
Typ.
Max.
-40 C
25 C
85 C
3.6 V
3.3 V
3.0 V
35
63
111
-40 C
25 C
85 C
2.75 V
2.5 V
2.25 V
38
76
156
2.75 V
2.5 V
50
ps
TDC-GP2
Terminal
Condition
Rated Value
Min.
Typ.
Unit
Max.
Resolution RMS
16.0
Bit
SNR
PT1000
96
dB
Absolute Gain-Error
150 nF Capacitance
0,1
0,08
%/V
0,0008
%/K
Uncalibrated Offset
<0.01
<0,2
ppm/K
>100
dB
Temp
PSRR
2.2
Timings
At Vcc = 3.3 V 0.3 V, ambient temperature -40 C to +85 C unless otherwise specified
Oscillator
Symbol
Parameter
Min.
Typ.
Clk32
32,768
kHz
toszst
200
toszst
ms
ClkHS
Max.
Unit
MHz
Serial Interface
Symbol
Parameter
Max. @ Vio =
Unit
2.0 V
2.5 V
3.3 V
20
25
fclk
10
Symbol
Parameter
Min. @ Vio =
MHz
Unit
2.0 V
2.5 V
3.3 V
50
25
20
tpwh
ns
tpwl
tsussn
20
40
10
ns
tpwssn
50
30
20
ns
thssn
70
40
25
ns
tsud
10
ns
thd
10
ns
ns
2-3
Time-to-Digital-Converter
Symbol
tvd
TDC-GP2
Parameter
Max. @ Vio =
Unit
1.8 V
2.5 V
3.3 V
30
20
16
Serial Interface (SPI compatible, Clock Phase Bit =1, Clock Polarity Bit =0):
Figure 2-1: SPI Write
8-Bit Opcodes:
MSB
2-4
LSB
Description
ADR2
ADR1
ADR2
ADR1
Init
Power On Reset
Start_Cycle
Start_Temp
Start_Cal_Resonator
Start_Cal_TDC
ns
TDC-GP2
Disable Timings
Figure 2-3:
Spec
Description
Min (ns)
Max (ns)
tS-EN
5 ns
tSH-EN
5 ns
Min (ns)
Max (ns)
50 ns
200 ns
Reset Timings
Figure 2-4:
Spec
Description
tph
trfs
2-5
Time-to-Digital-Converter
2.3
No.
TDC-GP2
Pin Description
Name
Description
Buffer type
Value
If not
used
Xin
Oscillator driver in
Xout
Vio
GND
Ground
Fire1
48 mA
Fire2
48 mA
Fire_In
INTN
Interrupt flag
12 mA
LOW active
SSN
Slave select
Schmitt trigger
LOW active
10
SCK
Schmitt trigger
11
SI
Schmitt trigger
12
SO
12 mA tristate
13
RSTN
Reset input
Schmitt trigger
14
Vcc
15
Clk32Out
n. c.
16
Clk32In
GND
2-6
GND
GND
LOW active
TDC-GP2
No.
Name
Description
Buffer type
Value
If not
used
17
SenseT
Schmitt trigger
GND
24 mA
n.c.
ment
18
LoadT
19
PT4
48 mA
20
PT3
48 mA
21
GND
Ground
22
Vio
23
PT2
48 mA
24
PT1
48 mA
25
Schmitt trigger
HIGH active
Vio
26
Schmitt trigger
HIGH active
Vio
27
Stop2
Stop input 2
28
GND
Ground
29
Vcc
30
Stop1
Stop input 1
31
Start
Start input
32
En_Start
2.4
GND
GND
Schmitt trigger
HIGH active
Vio
Package Drawings
Dimension in Millimeters
Min.
Nom.
Max.
A1
0.17
0.3
0.5
0.3
0.5
3.24
Thermal resistance
Roughly 40 K/W at 0 m/s air flow, 37 K/W at 1 m/s air flow, 35 K/W at 2m/s air flow (values
just for reference).
2-7
Time-to-Digital-Converter
TDC-GP2
Maximum temperature
The maximum temperature requirement for the resin surface, given 260C as the peak temperature of the package bodys surface, is that the resin surface temperature must not exceed 250C
for more than 10 seconds. This temperature should be kept as low as possible to reduce the load
caused by thermal stress on the package, which is why soldering for short periods only is recommended. In addition to using a suitable temperature profile, we also recommend that you check carefully
to confirm good soldering results.
2.5
Power Supply
Supply voltage
Although the TDC-GP2 is a fully digital circuit, some analog measures affect the circuit. The reason
is that the TDC is based on the internal analog measure propagation delay time which is influenced
by temperature and supply voltage. A good layout of the supply voltage is essential for good measurement results. It should be high capacitive and of low in-ductance.
The TDC-GP2 provides two pairs of power supply terminals:
Vio
Vcc
All ground pins should be connected to a ground plane on the printed circuit board. Vio and Vcc
should be provided by a battery or fixed linear voltage regulator. Do not use switched regulators to
avoid disturbances caused by the I/O supply.
2-8
TDC-GP2
The measurement quality of a time-to-digital converter depends on a good power supply. The chip
sees mainly pulsed current and therefore a sufficient bypassing is mandatory:
Vcc
100 F
(minmum 47 F)
Vio
10 F
(minimum 1 F)
The supply voltage should be provided through analog regulators. We strongly recommend not to use
switch mode power supplies.
Current consumption
The current consumption is the sum from different parties (all data for Vio = Vcc = 3.6V):
Iddq
< 150 nA
Quiescent current,
I32
typ. 4.5 A
oscillator is connected
Ihs
* (active runtime)
Itmu
typ. 15 mA/s
the time measuring unit is active for the start-stop time inter
Ialu
a calibration calculation.
2-9
Time-to-Digital-Converter
IT
TDC-GP2
typ. 2.5 As * measure rate The current for a full temperature measurement is typ.2.5As.
2.6
Register settings
Service bits are for acam testing and security purposes only, Please use the recommended values.
2.6.1
Write registers
Reg0
23
FIRE#
(*) Reg1
CONF_FIRE
(*)
s.c.
s.c.
s.c.
s.c.
21
EN_ERR_VAL 0
s.c.
20
RFEDGE2
SEL_TIMO_
s.c.
EN_STARTNOISE 0
RFEDGE1
MR2
s.c.
DIS_PhaseNoise
DELVAL1
DELVAL2
DELVAL3 0
REPEAT_FIRE
HIT1
EN_INT
(*) Reg5
(*) Reg4
DIV_FIRE
HIT2
(*) Reg3
22
19
(*) Reg2
18
17
16
EN_FAST_INIT 0
s.c.
HITIN2
15
CALRES#
14
13
ClkHSDiv
PHASE_FIRE
12
11
START_ClkHS 0
10
HITIN1
PORT#
TCycle
No_FAKE
n.c
SelClkT
n.c
Calibrate
n.c
DisAutoCal
n.c
MRange2
n.c
NEG_STOP2
n.c
NEG_STOP1
n.c
NEG_START
n.c
2-10
TDC-GP2
Name
Descritpion
Value
NEG_START
NEG_STOP1
NEG_STOP2
MRange2
0 = measurement range 1
1 = measurement range 2
DisAutoCal
Enables/disables auto-calibration
run in the TDC
Calibrate
Enables/disables calibration
calculation in the ALU
SelClkT
Select reference signal for internal 0 = use 32,768 kHz as cycle clock
1 = use 128 * CLKHS as period for cycle clock
cycle clock for tem-perature
(32s with 4 MHZ high speed clock signal )
measurement
FAKE#
0 = 2 Fake measurements
1 = 7 Fake measurements
TCycle
PORT#
10-11
START_CLKHS
0
1
2
3
=
=
=
=
Oscillator off
Oscillator on
settling time = 640 s
settling time = 1280 s (see Bug Report)
12-13
ClkHSDiv
0
1
2
3
=
=
=
=
divided
divided
divided
divided
14-15
CALRES#
0
1
2
3
=
=
=
=
2 periods = 61.035 s
4 periods = 122.07 s
8 periods = 244.14 s
16 periods = 488.281 s
16-19
DIV_FIRE
15 = divided by 16
Reg 0
by
by
by
by
1
2
4
4
2-11
Time-to-Digital-Converter
20-23
TDC-GP2
FIRE#
0 = off
1 = 1 pulse
2 = 2 pulses
3 = 3 pulses
15 = 15 pulses
8-10
HITIN1
0
1
2
3
4
5
11-13
HITIN2
0
1
2
3
4
5
15
EN_FAST_INIT
16-19
HIT1
MRange1:
0 = Start
1 = 1. Stop Ch1
2 = 2. Stop Ch1
3 = 3. Stop Ch1
4 = 4. Stop Ch1
5 = no action
6 = Cal1 Ch1
7 = Cal2 Ch1
9 = 1. Stop Ch2
A = 2. Stop Ch2
B = 3. Stop Ch2
C = 4. Stop Ch2
MRange2:
1 = Start
20-23
HIT2
MRange1:
0 = Start
1 = 1. Stop Ch1
2 = 2. Stop Ch1
3 = 3. Stop Ch1
4 = 4. Stop Ch1
5 = no action
6 = Cal1 Ch1
7 = Cal2 Ch1
9 = 1. Stop Ch2
A = 2. Stop Ch2
B = 3. Stop Ch2
C = 4. Stop Ch2
MRange2:
2 = 1. Stop Ch1
3 = 2. Stop Ch1
4 = 3. Stop Ch1
Reg 1
2-12
TDC-GP2
Reg 2
0-18
DELVAL1
Delay value for internal stop enable unit, hit 1 channel 1. Fixed
point number with 14 integer
and 5 fractional digits in multiples of Tref
DELVAL1 = 0 to 16383.96875
19
RFEDGE1
20
RFEDGE2
21-23
EN_INT
Reg 3
DELVAL1 = 0 to 16383.96875
0-18
DELVAL2
19-20
SEL_TIMO_MR2
21
EN_ERR_VAL
0 = disabled
1 = enabled
Reg 4
0-18
DELVAL1
Delay value for internal stop enable unit, hit 3 channel 1. Fixed
point number with 14 integer
and 5 fractional digits in multiples of Tref
DELVAL1 = 0 to 16383.96875
2-13
Time-to-Digital-Converter
TDC-GP2
Reg 5
0-15
PHASE_FIRE
16-18
REPEAT_FIRE
0=
1=
2=
...
7=
no signal repetition
1 signal repetition
2 signal repetition
7 signal repetition
19
DIS_PHASENOISE
Phase noise unit, has to be disabled, See bug report section 7.2
20
EN_STARTNOISE
21-23
CONF_FIRE
2.6.2
ADR
Symbol
Bits
Description
RES_0
32
2-16
RES_1
32
RES_2
32
RES_3
32
STAT
16
15 - 13
12
11
10
8-6
5-3
2-0
n.c.
Error
short
Error
open
Timeout
Precounter
Timeout
TDC
# of hits
Ch2
# of hits
Ch1
Pointer
result
register
REG_1
Content of highest 8 Bits of write register 1, to be used for testing the communication
The data structure and the occupancy of the result registers depends on the operation mode and
whether calibrated or non-calibrated data are stored. Several cases must be distinguished:
Only in measurement range 1 negative results are possible.
In measurement range 2 only positive results are possible, given as unsigned numbers.
A non-calibrated measurement is only possible in measurement range 1.
In measurement range 1 with calibrated data (ALU) the time intervals that have to be measured
can not exceed twice the period of the calibration clock. When measuring bigger time intervals an
ALU - overflow will occur and 0xFFFFFFFF is written in the appropriate result register.
2-14
TDC-GP2
2-15
Time-to-Digital-Converter
2.6.3
TDC-GP2
Status register
Bits
Name
Description
20
53
# of hits Ch 1
86
# of hits Ch 2
Timeout TDC
Values
1 = overflow
10
Timeout Precounter
1 = overflow
11
Error open
1 = open
12
Error short
1 = short
2-16
TDC-GP2
Measurement Mode 1
3.1
General Description
The measuring unit is actuated by a START signal and stopped by a STOP signal. Based on the position of the ring oscillator and the coarse counter the time interval between START and STOP is calculated with a 20 Bit measurement range.
The BIN size (LSB) is typically 65 ps at 3.3 V and 25 C ambient temperature. The RMS noise is
about 50 ps (0.7 LSB). The gate propagation delay times strongly depend on temperature and voltage. Usually this is solved doing a calibration. During such a calibration the TDC measures 1 and 2
periods of the reference clock.
The measurement range is limited by size of the counter:
tyy = BIN x 26224 ~ 1.8 s
3-1
Time-to-Digital-Converter
Time (Condition)
Description
tph
2,5 ns (min.)
tpl
2,5 ns (min.)
tss
3.5 ns ns (min)
Start to Stop
TDC-GP2
1.8 s (max.)
trr
15 ns (typ.)
tff
15 ns (typ.)
tva
560 ns uncalibrated
4.6 s calibrated
txx
No timing limits
tyy
1,8 s (max)
Figure 3-2
Input circuitry
Each input separately can be set to be sensitive to rising or falling edge or both edges. This is done
in register 0, Bits 0 to 2. (NEG_START, NEG_STOP1, NEG_STOP2) and register 2, Bit 19&20,
RFEDGEx.
Furthermore all Start/Stop-inputs support a high active enable pin.
3.2
Measurement Flow
Figure 3-3
3.2.1
Configuration
3-2
TDC-GP2
nuously on). In case both oscillators are used for current saving reasons this should be set to 2 for
ceramic oscillators and to 3 for quartz oscillators.
Register 0, Bits 12&13, ClkHSDiv sets an additional internal divider for the reference clock (1,2 or
4). This is important for calibrated measurements in measurement range 1 because the ALU works
correctly only if 2*Tref(intern) is bigger than the maximum time interval to be measured. Otherwise
the ALU output is 0xFFFFFFFF.
Make also sure that 2*Tref(intern) < 1.8 s to avoid a timeout during calibration.
c. Set the number of expected hits
In register 1, Bits 8 to 10 and 11 to 13, HITIN1 and HITIN2 the user has to define the number of
hits the TDC-GP2 has to wait for. A maximum of 4 on each channel is possible. The TDC-GP2 measures until the set number of hits is registered or a timeout occurs.
d. Select calibration
As the BIN size varies with temperature and voltage the TDC-GP2 ALU can internally calibrate the
results. This option is switched on by setting register 0, Bit5, Calibrate = 1. It is recommended to
do this.
For the calibration the TDC measures 1 and 2 cycles of the reference clock. The two data are stored
as Cal1 and Cal2.
There are two ways to update the calibration data Cal1 and Cal2:
- Separate calibration by sending opcode Start_Cal_TDC via the SPI interface
- Automatic update by setting register 0, Bit 4, DisAutoCal = 0. In most applications this will be the
preferred setting.
e. Define ALU data processing
While the TDC unit can measure up to 4 hits on each channel the user is free in his definition what
the ALU shall calculate. The settings are done in register 1, Bits 16 to 19 and 20 to 23, HIT1 and
HIT2. Both parameters can be set to:
0 = Start
1 = 1. Stop Ch1
9 = 1. Stop Ch2
2 = 2. Stop Ch1
A = 2. Stop Ch2
3-3
Time-to-Digital-Converter
3 = 3. Stop Ch1
B = 3. Stop Ch2
4 = 4. Stop Ch1
C = 4. Stop Ch2
6 = Cal1 Ch1
7 = Cal2 Ch1
The ALU calculates Hit1 - Hit2.
TDC-GP2
Examples:
Reg1 = 0x01xxxx - 1st Stop Ch1-Start
Reg1 = 0x2Bxxxx - 3rd Stop Ch2-2nd
Stop Ch1
Reg1 = 0x06xxxx - Cal1
In case calibration is active the ALU does the full calibration calculation (except when reading the calibration values. In this case the ALU writes the Cal1/Cal2 raw data to the output register).
N = 1, 2 or 4.
Figure 3-4
3-4
TDC-GP2
EN_INT =
no Interrupt source
ALU ready
The different options are wired by OR to enable more than one source.
There are further configuration options that will be described later in this chapter.
After the configuration the user has to initialize the TDC-GP2 by sending opcode Init so that the TDC
accepts Start and Stop hits.
3.2.2
Measurement
After an initialization the TDC unit will start with the first pulse on the Start input. It will run until:
the set number of hits has been seen (maximum 4 on both stop channels in MR1)
or until a timeout occurs at the end of the measurement range (at about1.8s in ,MR1).
The time measurement raw data are internally stored. The number of hits can be seen from the
status register, bits 3 to 8. In case calibration is active the TDC now measures one and two periods
of the internal reference clock (Tref * 1,2 or 4). The calibration raw data Cal1 and Cal2 are also
internally stored.
Figure 3-5
3.2.3
Data Processing
At the end of the measurement the ALU starts to process the data according to the HIT1, HIT2 settings and transfers the result to the output register. In case calibration is off the ALU transfers the
16 Bit raw data to the output register. With calibration the ALU calculates according to 3.1.1.d and
transfers the 32Bit fixed point number to the output register.
The ALU can be switched off configuring HIT1=HIT2=5.
3-5
Time-to-Digital-Converter
TDC-GP2
The time it takes the ALU depends on whether calibration is on or not and the supply voltage.
Table 3-1: ALU timings
un-calibrated
calibrated
3.3 V
220 ns
2.3 s
2.5 V
310 ns
2.5 s
2.0 V
580 ns
2.8 s
3.2.4
Reading Data
register, Bits 0 to 2.
Now the user can read the data sending the opcode 10110ADR. With the next 16 cycles (un-calibrated data) or 32 cycles (calibrated data) the TDC-GP2 will send the result, beginning with the most
significant Bit (MSB).
a. Un-calibrated data format:
16 Bit Signed integer in complements of 2. 1BIN = uncalibrated gate delay is about 65ps at 5V and
25C.
Time = RES_X x 65ps
Example:
configuration
...
write reg1=0x104400
4 hits on channel 1,
calculate Hit1-Start
...
Initialize
...
ter.
write reg1=0x204400
wait(4.6s)
write reg1=0x304400
wait(4.6s)
write reg1=0x404400
wait(4.6s)
calculate Hit2-Start
calculate Hit3-Start
calculate Hit4-Start
3-6
TDC-GP2
Measurement Mode 2
4.1
General Description
The BIN size (LSB) is typically 65 ps at 3.3 V and 25 C ambient temperature. The RMS Noise is
approx. 50 ps (0.7 LSB). The gate propagation delay times strongly depend on temperature and voltage. In measuring range 2 the result is the sum of different fine and coarse-count results. Therefore
it is necessary in measuring range 2 to make a calibration. During a calibration the TDC measures 1
and 2 periods of the reference clock.
The measurement range is limited by size of the coarse counter:
tyy = Tref x 214 = 4.1ms @ 4MHz
The time interval between START and STOP is calculated with a 26 Bit measurement range.
4-1
Time-to-Digital-Converter
TDC-GP2
Figure 4-2
Time (Condition)
Description
tph
2,5 ns (min.)
tpl
2,5 ns (min.)
tss
2*Tref
Start to Stop @
Dis_Phasenoise=1
trr
2*Tref
tff
2*Tref
tva
4.6 s (max.)
tyy
4 ms (max)
Input circuitry
Each input separately can be set to be sensitive to rising or falling edge. This is done in register 0,
Bits 0 to 2. (NEG_START, NEG_STOP1).
Further all Start/Stop-inputs support a high active enable pin.
Note:
In case the Start-Stop interval is less than the lower limit tzz the TDC will ignore more and more
events the smaller it is. In no case there will be wrong results.
4.2
Measurement Flow
Figure 4-3
4.2.1
Configuration
At the beginning the TDC-GP2 has to be configured. The main settings for measurement range 2
are:
a. Select measurement range2
setting register 0, Bit3, MRange2 = 1.
b. Select the reference clock
(see also section 5.1)
In measurement range 2 the TDC-GP2 needs
the high-speed clock for the time measurement.
In case of low-power applications this clock can
be switched of in between measurements. The
a 32.768 kHz clock is necessary for the timing
control during the oscillator power-on.
4-2
TDC-GP2
Register 0, Bits 10&11, START_CLKHS defines the switch-on behavior of the high-speed clock. If
only the high-speed clock is used this is be set to 1(continuously on). In case both oscillators are
used for current saving reasons this should be set to 2 for ceramic oscillators and to 3 for quartz
oscillators.
Register 0, Bits 12&13, ClkHSDiv sets an additional internal divider for the reference clock (1,2 or
4). The choice has an influence on the minimum time interval
Otherwise the ALU will go into an overflow during calibration and write 0xFFFFFFFF as output data.
c. Set the number of expected hits
In register 1, Bits 8 to 10, HITIN1 the user has to define the number of hits the TDC-GP2 has to
wait for. A maximum of 3 on channel 1 is possible. The number HITIN1 always has to be higher by 1
than the number of expected hits. The reason is that the Start is also counted as a hit. The TDC-GP2
measures until the set number of hits is registered or a timeout occurs. register 0, Bits 11 to 13,
HITIN2 have to be set to 0.
Example:
2 stop pulses are expected:
HITIN1 = 3, HITIN2 = 0
d. Select calibration
The calibration is switched on by setting register 0, Bit5, Calibrate = 1. It is mandatory to do this.
For the calibration the TDC measures 1 and 2 cycles of the reference clock. The two data are stored
as Cal1 and Cal2.
There are two ways to update the calibration data Cal1 and Cal2:
Separate calibration by sending opcode Start_Cal_TDC via the SPI interface
Automatic update by setting register 0, Bit 4, DisAutoCal = 0. In most applications this will be
the preferred setting.
4-3
Time-to-Digital-Converter
TDC-GP2
no Interrupt source
ALU ready
4-4
TDC-GP2
4.2.2
Measurement
After an initialization the TDC unit will start with the first pulse on the Start input. It will run until:
the set number of hits has been seen (maximum 3 on channel 1 in measurement range 2)
or until a timeout occurs. The timeout can be programmed in multiples of the reference clock
setting Reg 3, Bits 19&20, SEL_TIMO_MR2. At 4 MHz the values are:
SEL_TIMO_MR2 (@ 4 MHz, ClkHSDiv = 0)
= 0
= 64 s
= 1
= 256 s
= 2
= 1024 s
= 3
= 4096 s
At the end of the time measurement the TDC measures 2 periods of the reference clock for calibration.
4.2.3
Data processing
At the end of the measurement the ALU starts to process the data according to the HIT1, HIT2
settings and transfers the result to the output register. The ALU calculates according to 4.1.2.e and
transfers the 32Bit fixed point number to the output register.
The time it takes the ALU depends on the supply voltage:
Table 4-1: ALU timings
calibrated
3.3 V
2.3 s
2.5 V
2.8 s
2.0 V
3.1 s
As soon as the data is available from the output register the interrupt flag is set (assumed that the
ALU interrupt is enabled, see reg 2, EN_INT). Further the load pointer of the output register is increased by 1 and points to the next free memory. The actual position of the load pointer can be seen in
the status register, Bits 0 to 2.
4-5
Time-to-Digital-Converter
4.2.4
TDC-GP2
Reading Data
Now the user can read the data sending the opcode 10110ADR. With the next 32 cycles (calibrated
data) the TDC-GP2 will send the result, beginning with the main significant Bit (MSB).
The 32 Bit fixed-point number in complements of 2 represent the time interval in multiples of the
reference clock.
The configuration of the ALU allows only one hit calculation at the time. In case more than one hit
has been measured it is necessary to write new commands to HIT1/HIT2 to instruct the ALU for
calculating the other hits. After writing to HIT1/HIT2 it is necessary to wait for minimum 4.6s (calibrated data) or 580ns (un-calibrated data) before reading or writing again to HIT1/HIT2.
Example:
configuration
...
write reg1=0x214400
...
Initialize
...
while(Check interrupt flag)
write reg1=0x314400
calculate Hit2-Start
wait(4.6s)
write reg1=0x414400
calculate Hit3-Start
wait(4.6s)
Now all hit data are available from registers 0 to 2. The load pointer value is 3.
At the end the TDC-GP2 has to be initialized again to be ready for the next measurement. This is
done by sending the opcode Init so that the TDC accepts new Start and Stop hits.
4-6
TDC-GP2
4.3
Stop Masking
The TDC-GP2 can set time-based masking windows for each of the 3 hits on Stop1 input when no
hits are accepted. The masking refers to the start event and has an accuracy of less than 10 ns.
The internal enable unit is connected to the external enable pin by a logical AND. The external enable
pin must be set to 1 to use the internal masking unit. The configuration settings are made in registers 2 to 4, DELVAL1, DELVAL2 and DELVAL3:
DELVAL1 DELVAL3 are fixed point numbers with 14 bit integer and 5 bit fractional digits, in
multiples of the internal reference clock
DELVAL2 = 0x3300 2nd Stop not accepted before 204 s after Start
DELVAL1 = 0x3400 3rd Stop not accepted before 208 s after Start
4-7
Time-to-Digital-Converter
4-8
TDC-GP2
TDC-GP2
5
5.1
Oscillator
High-Speed Oscillator
Generally the TDC-GP2 needs a 2 to 8 MHz high-speed clock for calibration. Operating in measurement range 2 the TDC-GP2 needs the high-speed clock signal also as a part of the time measuring
unit. The oscillator takes an average current of 260 A when running all the time.
Because it is needed only during the time measurement the TDC-GP2 has the capability to control
the on-time by itself. The high-speed clock can be
switched on automatically with a INIT opcode only
for the period of time measurement. An additional
delay cares for the settling time of the oscillator.
The settings are done in register 0, Bits 10 & 11,
START_CLKHS:
START_CLKHS
=0
Figure 5-1
Oscillator off
= 1
Oscillator on
=2
= 3
The programmable delay guarantees that the oscillator has settled before the measurement starts.
For ceramic resonators 640 s will be sufficient.
Note:
Notice the Bug report in section 7 when using Start_CLKHS with quartz oscillators.
By this measure the average current consumption can be drastically reduced.
Example:
At one ToF measurement in an ultrasonic flowmeter (forth/back) per second the high-speed oscillator is active only for about 2 ms. The average current consumption is 260 As * 2 ms = 0.52 A.
5-1
Time-to-Digital-Converter
5.1.2
TDC-GP2
The TDC-GP2 needs a 32.768 kHz reference for the start-up control of the high-speed clock and the
clock calibration. It therefore offers a an integrated driver:
There is no need for the 32.768 kHz clock if the high speed clock is permanently running (START_
CLKSHS = 1) and the high speed clock calibration is not used (e.g. in case of a quartz oscillator).
3.6
V. It is also
to is
provide
an external
low-and has a current consumption of about 4.5 A at
The 32.768
kHzpossible
oscillator
permanently
running
frequency rectangular clock at the CLK32Out pin
(3.6 V max.). This signal could be generated by an
external microprocessor. It will reduce the current
consumption down to 1.2 A. For this reason the
32 kHz oscillator should only be used if no external
low-current 32.768 kHz clock is available. The
settling time of this oscillator is about 2 s.
Figure 5-2
Using a ceramic oscillator for the 2 to 8 MHz clock will be attractive because it is of low cost and
has a fast settling time. Unfortunately it has a poor tolerance of 0.3 to 0.5 % and shows a temperature drift. For this reason the TDC-GP2 allows to execute a calibration measurement that allows
to compensate this behavior. This measurement is based on the very precise 32.768 kHz clock. The
TDC-GP2 generates start/stop pulses from the 32.768 kHz and measures this time interval with its
TDC unit. The result is stored in the result register and the interrupt flag is set. The frequency error
of the ceramic resonator can be calculated by the microprocessor. The calibration is configured by
setting register 0, CALRES# and is started with START_Cal_Resonator - instruction by the microprocessor.
The time interval to be measured is set by CALRES# which defines the number of periods of the
32.768kHz clock:
CALRES#
=0
2 periods = 61.035 s
=1
4 periods = 122.07 s
=2
8 periods = 244.14 s
=3
16 periods = 488.281s
5-2
TDC-GP2
The results is given in multiples of the high-speed clock and (divided by 1, 2 or 4 (DIV_CLKHS)) as 32
bit fixed point numbers with 16 integer bits and 16 fractional bits.
The microcontroller can compare this measured value to the theoretical value and calculate the correction factor RES_X/REStheor.
Example:
The system shall work with a 4 MHz resonator. With CLKHSDIV=0 and CALRES#=1 the theoretical result is 122.0703125s/250ns = 488.28125 (RES_0 = 0x01E84800). If the ceramic
resonator in use is not exactly at 4MHz but only 3.98MHz the calibration measurement will show
485,83984375 (RES_0 = 1E5D700). The correction factor for the microcontroller is 1.005.
Note:
During clock calibration the start input has to be enabled.
5.1.4
a. Application
This option is dedicated especially to ultrasonic flow and heat meters. In those applications the use
of ceramic oscillators shows two main advantages: lower cost and less current consumption. Mainly
because of the short oszillation start up time of the ceramic oscillator the operating current can be
reduced by several A. Referring to 10 years of operation this saves several 100 mAh in battery
capacitance. There is no negative effect on the resolution when using this option the correct way.
b. Jitter of the 32 kHz clock and consequences
The 32 kHz clock is very precise in frequency with only a few ppm error. However the phase jitter is
about 3 to 5 ns peak-peak. For this reason also a calibration measurement (Start_Cal_Resonator)
has this error. When multiplying a measurement result with the calibration result, the jitter of the
calibration is transferred to the result by the ratio calibration measurement time (see CALRES#) to
measurement time. Using a permanently updated calibration value will add a considerable jitter to the
measurement result.
5-3
Time-to-Digital-Converter
TDC-GP2
Fire-pulse Generator
General Description
The fire-pulse generator generates a sequence of pulses which is highly programmable in frequency,
phase and number of pulses. The high-speed oscillator frequency divided by the factor selected for
ClkHSDiv is used as the basic frequency. This frequency is internally doubled and can freely be divided
by a factor of 2 to 15. It is possible to generate 1 to 15 pulses. For each pulse the phase can be adjusted per register configuration. The fire-pulse generator is activated by sending opcode Start_Cycle.
The fire-pulse generator provides 2 outputs, Fire1 and Fire2. The driver strength of each output is
48mA @5V. These 2 outputs can be paralleled to increase the driver strength up to 96 mA. Furthermore Fire2 output signal can be inverted to double the signal amplitude. The outputs can be set
individually high-Z.
The fire-pulse generator allows to generate and send pulse sequences multiple times for use in a quasi sing-around method. Using this feature the received pulse sequence is fed into TDC-GP2 Fire_In
input. It is digitally amplified and directly forwarded to the output buffer for an immediate re-emittance
without any clock delay.
Note: When the fire pulse generator is use it is mandatory to send a start pulse.
5.2.2
Configuration
Number of pulses:
FIRE# = 0
1 pulse
2 pulses
15
15 pulses
5-4
TDC-GP2
Phase:
The phase of each pulse can be defined in register 5, Bits 0 to 15, PHASE_FIRE. 0 stands for
HIGH-LOW and 1 for LOW-HIGH. The pulse sequence begins with the LSB and ends with the MSB
Example:
Fire# = 7, PHASE_FIRE = 0x0055
Fire-pulse frequency:
The input signal fireclk1 for the fire pulse generator is derived from the high speed clock CLKHS and
the selected value for the high speed clock divider CLKHS_DIV.
Figure 5-3
not permitted
divided by 2
divided by 3
...
...
15
divided by 16
Register 5, Bit 19, DIS_PHASESHIFT actives the phase shift, which introduces additional noise to
improve statistical behaviour when averaging.
DIS_PHASESHIFT = 0 Phase shift on
5-5
Time-to-Digital-Converter
TDC-GP2
As shown in Figure 16 at least 2 clock periods Tfireclk2 are required to send one Fire_Pulse. One for
the high phase and one for the low phase of the Fire1/Fire2 output signal.
Example:
CLKHS = 4 MHz, CLKHS_DIV = 1, DIV_FIRE = 1
Max. frequency of the Fire1 / Fire2 output signal:
Driver outputs:
The output drivers are configured in register 5, Bits 21 to 23, CONF_FIRE:
Bit 23 = 1
Bit 22 = 1
Bit 21 = 2
no repetition
= 1
1 repetition
...
...
= 7
7 repetitions
Only the number of pulses set under FIRE# will be repeated. With a period of 5 s without a pulse
the TDC-GP2 detects the end of a pulse sequence.
Note:
It is strongly recommend that the summarized time of flight of the up to 7 repetitions does not exceed the measurement range of the GP2!!!
5-6
TDC-GP2
5.3
Temperature Measurement
Especially for heat meter applications the TDC-GP2 has a PICOSTRAIN based temperature measuring
unit that offers high resolution and very low current consumption.
The measurement is based on measuring discharge times. Therefore a capacitor is discharged alternately through the sense resistors and the reference resistors.
Figure 5-5
Figure 5-6
PT2
PT3
PT4
The temperature sensor should have a minimum resistance of 500 Ohm. The TDC-GP2 measures
the discharge times of the RC-networks made of each resistor and the capacitor.
The precision of the temperature measurement is about 0.004C several times better than needed
for heat meters.
The temperature measurement is fully automated. It is triggered by the C sending the opcode
Start_Temp. The TDC-GP2 controls the 4 measurements by itself. After the 4 measurements have
finished the interrupt flag is set. The four data are found in registers 0 to 3.
5-7
Time-to-Digital-Converter
TDC-GP2
From Res_2/RES_1 and RES_3/RES_4 the microcontroller can calculate the ratio Rtemp/Rref. By
means of a look-up table it can calculate the temperature for the special type of sensor in use.
It is not possible with TDC-GP2 to use 4-wire temperature sensors.
Configuration
Register 0, Bit 8, Tcycle sets the cycle time for the temperature measurement.
Tcycle = 0
Tcycle = 1
Register 0, Bit9, Port# sets the number of ports that will be used.
Port# = 0
2 ports = 1 sensor
Port# = 1
4 ports = 2 sensors
Register 0, Bit 7, Fake# sets the number of dummy measurements at the beginning of a temperature measurement. This is necessary to overcome mechanical effects of the load capacitor.
Fake# = 0
2 dummy measurements
Fake# = 1
8 dummy measurements
220 nF
PT1000:
100 nF
5-8
TDC-GP2
A full temperature measurement with 2 sensors, 2 references am PT1000 sensor type, including
all calculations takes less than 2.5As. With one temperature measurement in 30 seconds (typical
for heatmeters) the average current consumption is 0.08 A only. This is about 50 times less than
other solutions. A PT500 sensor doubles the current.
Note:During temperature measurement the start input has to be enabled.
Error detection
Additionally the temperature unit checks the plausibility of the results. It is able to detect a short circuit of the sensor or an open sensor. The TDC-GP2 provides in the relevant output register an error
code instead of a measurement value.
1. Short circuit: equivalent to a very short time interval (< 8 x Tref = 2 s @ 4 MHz). The TDC-GP2
writes a 0x0 to the output register of the shorted sensor.
2. Broken sensor: equivalent to no stop signal or timeout. The TDC-GP2 writes a 0xFFFFFFFF into
the output register of the open sensor.
Table 5-1: Analog specifikation
Parameter
Resolution RMS
SNR
16.0 Bit
96 dB
Absolut Gain-Error
Gain-Drift vs. Vio
0,1 %
0,08 %/V
0,0008 %/C
Uncalibrated Offset
<0.01 %
<0,2 ppm/C
>100 dB
5-9
Time-to-Digital-Converter
5.4
TDC-GP2
SPI-interface
The serial interface is compatible with the 4-wire SPI standard. It needs the SerialSelectNot (SSN)
and can not operated as 3-wire interface.
SSN
- Slave Select
SCK
- SPI Clock
SI
- SPI Data In
SO
The timings are shown in fiures setion 2.2. It is mandatory to set the SSN line to High-state for at
least 50ns between each Read-/Write sequence.
SSN as Reset
The SerialSelectNot (SSN) line is the HIGH-active reset for the serial interface. After SSN is set to
LOW different operations can be addressed, not depending on the status of the interface before the
reset.
OPCodes
MSB
1
LSB
0
ADR2
ADR1
Description
ADR2
ADR1
Init
Power On Reset
Start_Cycle
Start_Temp
Start_Cal_Resonator
Start_Cal_TDC
5-10
followed by
24 bit data
TDC-GP2
The transfer starts with the MSB and is finished sending the LSB. After sending the last Bit TDC-GP2
transfers the data into the target register or executes the command. It is not possible to do incremental writing. Each register must be addressed separately.
When reading from the chip it is necessary to send the opcode first, too. With the first positive edge
of the clock following the opcode the TDC-GP2 sends the MSB of the addressed register to SO output. Each positive edge transfers the next lower Bit to the output.
5.5
Fast Initialization
In measurement range 1 the TDC-GP2 offers the possibility of a fast initialization. Activated by setting
register 1, Bit 15, EN_FAST_INIT = 1 the interrupt flag automatically initializes the TDC. So the TDC
is already prepared for the next measurement while the data can be read out. This mode is for highest speed applications only. It is most reasonable for un-calibrated measurements with only one stop.
5.6
Noise Unit
In case the user wants to improve the measuring results by averaging it is necessary that the values
do not always display exactly the same time difference. Instead the user should provide some noise
so that different quantization steps of the characteristic curve of the TDC are involved. This can not
happen with very constant time differences. One would constantly hit the same LSB.
The noise unit enables the use of weighted averaging even for constant time differences. The noise
unit adds a random offset to the start. It is dedicated to applications where the TDC gets a dummy
start and measures the time difference between STOP1 and STOP2 (e.g. laser range finders).
The noise unit is switched on by setting register 5, Bit 20, EN_STARTNOISE = 1
5-11
Time-to-Digital-Converter
5-12
TDC-GP2
TDC-GP2
Applications
6.1
6.1.1
Ultrasonic Heatmeter
General Description
The TDC-GP2 is perfectly suited for low-cost ultrasonic heatmeter designs. Thanks to the implemented functionality, including precision temperature measurement, fire pulse generation, windowing and
clock calibration it is sufficient to add a simple microprocessor (without A/D converter) and a transducer dependant driver and receiver. The extremely low current consumption guarantees the necessary long battery lifetime in such applications.
The measurement is fairly automated by the TDC-GP2. The microprocessor just sends a start command. The TDC then fires the transducers and measures the time of flight. It calibrates the results
and provides them to the microprocessor.
Figure 6-1
6-1
Time-to-Digital-Converter
6.1.2
TDC-GP2
Configuration
0x338AE8
NEG_START = 1
Register 1:
0x214400
Register 2:
0xE03200
DELVAL1 = 400
Register 3:
0x083300
Register 4:
0x203400
DELVAL3 = 416
Register 5:
0x080000
REPEAT_FIRE = 0, PHASE_FIRE = 0
6-2
TDC-GP2
6.1.3
Measurement Flow
Power-on reset:
Send SO = 0x50
Configuration:
Send SO = 0x80338AE8
Send SO = 0x82114000
Send SO = 0x82E03200
Send SO = 0x83083300
Send SO = 0x84203400
Send SO = 0x85080000
Calibrate Clock:
Send SO = 0x03 Start_Cal_Resonator
Check-loop INTN = 0?
Send SO = 0xB0, Read SI = RES_0
Correction factor = 488.28125/RES_0
Measurement loop:
Temperature measurement every 30 seconds:
Send SO = 0x02 Start_Temp
Check-loop INTN = 0?
Send SO = 0xB4, Read SI = STAT
STAT&0x1E00 > 0: -> Error routine
Send SO = 0xB0, Read SI = RES_0
Send SO = 0xB1, Read SI = RES_1
Send SO = 0xB2, Read SI = RES_2
Send SO = 0xB3, Read SI = RES_3
Rhot/Rref = RES_0/RES_1
Rcold/Rref = RES_3/RES_2
Go to look-up table to get the temperatures
6-3
Time-to-Digital-Converter
6.1.4
TDC-GP2
Current consumption
a. Time measurement
32.768kHz: are provided by the P: < 1.3 A
4 MHz:
TDC:
< 150 nA if not active, 15 mA during active time of the high-speed unit
With 2 measurements per second (forth and back flow) the total consumption is < 3 A.
b. Temperature measurement
A full measurement over all four ports takes less than 2.5 As current. Typically the temperature is
measured once in 30 seconds. The average current then is about 0.085 A. This is about 50 times
less than with solutions without a TDC.
c. Quiescent current
Thanks to the current optimized 0.35 technology the quiescent current is less than 150 nA typ.
d. Total system current
The complete current for the measuring unit (TDC, analog part, Transducer) will depend on the analog circuit part. It will be in the range of 4 to 6 A.
With a low-power P (e.g. MSP430 series from TI) the average current consumption of the total
device might be in the range of 11 to 16 A.
It is possible to operate the system from a lithium-thionylchloride AA cell for 10 years without changing the battery. At 6 years runtime it maybe even possible to work with a low-cost 3V CR2450 coin
cell battery.
6-4
TDC-GP2
7
Miscellaneous
7.1
Bug Report
7.1.1
Bug:
When using a quartz resonator for the oscillator the oscillation start up time is about
3 ms even with an optimized circuit. The TDC-GP2s automatic on-time control for the
high speed clock is based on 640 s or 1280 s delay without any activity. In case of a
quartz resonator this delay is too short and will cause malfunction.
7-1
Time-to-Digital-Converter
7.1.2
Bug:
TDC-GP2
DIS_PHASENOISE
The TDC-GP2 offers a Phase-Noise function that decouples the calibration clock from
the fire pulse generator. This option was implemented to provide the necessary statistics for averaging in case the user is looking for a resolution much better than 1 LSB
(about 65 ps) and has a a very strong coupling between the start and the reference
clock.
Because of a design bug the phase noise unit might fail in case of distortions on the
power supply. This is relevant only in measurement range 2.
Corrective: The phase noise unit has to be switched off by setting DIS_PHASE_NOISE = 1. In case
the start is already asynchronous to the referenceclock this has no effect on the capability of averaging.
7.2
Last Changes
05.10.2006
27.11.2006
01.02.2007
26.05.2010
7-2
TDC-GP2
7-3
Data Sheet
acam-messelectronic gmbh
Am Hasenbiel 27
76297 Stutensee-Blankenloch
Germany / Allemagne
ph. +49 7244 7419 - 0
fax +49 7244 7419 - 29
e-mail: support@acam.de
www.acam.de