TMP03/TMP04
–13–
When the READ_TMP04 routine is called, the counter registers
are cleared. The program sets the counters to their 16-bit mode,
and then waits for the TMP04 output to go high. When the
input port returns a logic high level, Timer 0 starts. The timer
continues to run while the program monitors the input port.
When the TMP04 output goes low, Timer 0 stops and Timer 1
starts. Timer 1 runs until the TMP04 output goes high, at which
time the TMP04 interface is complete. When the subroutine
ends, the timer values are stored in their respective SFRs and
the TMP04s temperature can be calculated in software.
Since the 80C51 operates asynchronously to the TMP04, there
is a delay between the TMP04 output transition and the start
of the timer. This delay can vary between 0 µs and the execution
time of the instruction that recognized the transition. The
80C51s jump on port.bit instructions (JB and JNB) require
24 clock cycles for execution. With a 12 MHz clock, this pro-
duces an uncertainty of 2 µs (24 clock cycles/12 MHz) at each
transition of the TMP04 output. The worst case condition occurs
when T1 is 4 µs shorter than the actual value and T2 is 4 µs
longer. For a 25°C reading (room temperature), the nominal
error caused by the 2 µs delay is only about ±0.15°C.
The TMP04 is also easily interfaced to digital signal processors
(DSPs), such as the ADSP210x series. Again, only a single I/O
pin is required for the interface (Figure 11).
D
OUT
TMP04
5V
GND
V+
FI (FLAG IN)
10MHz
n
16-BIT DOWN
COUNTER
CLOCK
OSCILLATOR
ADSP-210x
TIMER
ENABLE
Figure 11. Interfacing the TMP04 to the ADSP-210x Digital
Signal Processor
The ADSP2101 only has one counter, so the interface software
differs somewhat from the 80C51 example. The lack of two
counters is not a limitation, however, because the DSP archi-
tecture provides very high execution speed. The ADSP-2101
executes one instruction for each clock cycle, versus one instruc-
tion for twelve clock cycles in the 80C51, so the ADSP-2101
actually produces a more accurate conversion while using a
lower oscillator frequency.
The timer of the ADSP2101 is implemented as a down counter.
When enabled by means of a software instruction, the counter is
decremented at the clock rate divided by a programmable pres-
caler. Loading the value n 1 into the prescaler register will
divide the crystal oscillator frequency by n. For the circuit of
Figure 11, therefore, loading 4 into the prescaler will divide the
10 MHz crystal oscillator by 5 and thereby decrement the counter
at a 2 MHz rate. The TMP04 output is ratiometric, of course,
so the exact clock frequency is not important.
A typical software routine for interfacing the TMP04 to the
ADSP2101 is shown in Listing 2. The program begins by initial-
izing the prescaler and loading the counter with 0FFFF
H
. The
ADSP2101 monitors the FI flag input to establish the falling
edge of the TMP04 output, and starts the counter. When the
TMP04 output goes high, the counter is stopped. The
counter value is then subtracted from 0FFFF
H
to obtain the
actual number of counts, and the count is saved. Then the
counter is reloaded and runs until the TMP04 output goes low.
Finally, the TMP04 pulsewidths are converted to temperature
using the scale factor of Equation 1.
Some applications may require a hardware interface for the
TMP04. One such application could be to monitor the tempera-
ture of a high power microprocessor. The TMP04 interface
would be included as part of the system ASIC, so that the micro-
processor would not be burdened with the overhead of timing
the output pulsewidths.
A typical hardware interface for the TMP04 is shown in Figure
12. The circuit measures the output pulsewidths with a resolu-
tion of ±1 µs. The TMP04 T1 and T2 periods are measured
with two cascaded 74HC4520 8-bit counters. The counters,
accumulating clock pulses from the 1 MHz external oscillator,
have a maximum period of 65 ms.
The logic interface is straightforward. On both the rising and
falling edges of the TMP04 output, an exclusive-or gate gener-
ates a pulse. This pulse triggers one half of a 74HC4538 dual
one-shot. The pulse from the one-shot is ANDed with the
TMP04 output polarity to store the counter contents in the
appropriate output registers. The falling edge of this pulse also
triggers the second one-shot, which generates a reset pulse for
the counters. After the reset pulse, the counters will begin to
count the next TMP04 output phase.
As previously mentioned, the counters have a maximum period
of 65 ms with a 1 MHz clock input. However, the TMP04s T1
and T2 times will never exceed 32 ms. Therefore, the most
s
ignificant bit (MSB) of counter #2 will not go high in nor-
mal operation, and can be used to warn the system that an
error condition (such as a broken connection to the TMP04)
exists.
The circuit of Figure 12 will latch and save both the T1 and T2
times simultaneously. This makes the circuit suitable for debug-
ging or test purposes as well as for a general purpose hardware
interface. In a typical ASIC application, of course, one set of
latches could be eliminated if the latch contents, and the output
polarity, were read before the next phase reversal of the TMP04.
REV. B
TMP03/TMP04
–14–
{ ADSP-21XX Temperature Measurement Routine TEMPERAT.DSP
Altered Registers: ax0, ay0, af, ar,
si, sr0,
my0, mr0, mr1, mr2.
Return value: ar —> temperature result in 14.2 format
Computation time: 2 * TMP04 output period
}
.MODULE/RAM/BOOT=0 TEMPERAT; { Beginning TEMPERAT Program }
.ENTRY TEMPMEAS; { Entry point of this subroutine }
.CONST PRESCALER=4;
.CONST TIMFULSCALE=0Xffff;
TEMPMEAS: si=PRESCALER; { For timer prescaler }
sr0=TIMFULSCALE; { Timer counter full scale }
dm(0x3FFB)=si; { Timer Prescaler set up to 5 }
si=TIMFULSCALE; { CLKin=10MHz,Timer Period=32.768ms }
dm(0x3FFC)=si; { Timer Counter Register to 65535 }
dm(0x3FFD)=si; { Timer Period Register to 65535 }
imask=0x01; { Unmask Interrupt timer }
TEST1: if not fi jump TEST1; { Check for FI=1 }
TEST0: if fi jump TEST0; { Check for FI=0 to locate transition }
ena timer; { Enable timer, count at a 500ns rate }
COUNT2: if not fi jump COUNT2; { Check for FI=1 to stop count }
dis timer;
ay0=dm(0x3FFC); { Save counter=T2 in ALU register }
ar=sr0-ay0;
ax0=ar;
dm(0x3FFC)=si; { Reload counter at full scale }
ena timer;
COUNT1: if fi jump COUNT1; { Check for FI=0 to stop count }
dis timer;
ay0=dm(0x3FFC); { Save counter=T1 in ALU register }
ar=sr0-ay0;
my0=400;
mr=ar*my0(uu); { mr=400*T1 }
ay0=mr0; { af=MSW of dividend, ay0=LSW }
ar=mr1; af=pass ar; { ax0=16-bit divisor }
COMPUTE: astat=0; { To clear AQ flag }
divq ax0; divq ax0; { Division 400*T1/T2 }
divq ax0; divq ax0; { with 0.3 < T1/T2 < 0.7 }
divq ax0; divq ax0;
divq ax0; divq ax0;
divq ax0; divq ax0;
divq ax0; divq ax0;
divq ax0; divq ax0;
divq ax0; divq ax0;
divq ax0; divq ax0; { Result in ay0 }
ax0=0x03AC; { ax0=235*4 }
ar=ax0-ay0; { ar=235-400*T1/T2, result in øC }
rts; { format 14.2 }
.ENDMOD; { End of the subprogram }
Listing 2. Software Routine for the TMP04-to-ADSP-210x Interface
;
REV. B
TMP03/TMP04
–15–
Monitoring Electronic Equipment
The TMP03 are ideal for monitoring the thermal environment
within electronic equipment. For example, the surface-mounted
package will accurately reflect the exact thermal conditions which
affect nearby integrated circuits. The TO-92 package, on the
other hand, can be mounted above the surface of the board, to
measure the temperature of the air flowing over the board.
The TMP03 and TMP04 measure and convert the temperature
at the surface of their own semiconductor chip. When the TMP03
are used to measure the temperature of a nearby heat source,
the thermal impedance between the heat source and the TMP03
must be considered. Often, a thermocouple or other tempera-
ture sensor is used to measure the temperature of the source
D
OUT
TMP04
GND
T1 T2
V
CC
CLR
B
A
Q
Q
5V
5V
0.1F
74HC4538
GND
OUT
1
10
74HC373
V
CC
LE
D1 D2 D3
D4
D5
D6
D7
D8
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
2 5 6 9 12 15 16 19
3 4 7 8 13 14 17 18
20
11
5V
3
1
2
3
1
2
5
4
74HC08
1
74HC4520 #1
V
CC
CLK
Q0 Q1 Q2 Q3 Q0 Q1 Q2 Q3
3 4 5 6 11 12 13 14
9
7
815
16
5V
10
EN
EN
2
CLK GND RESET RESET
10
3
13
8
12
11
74HC373
V
CC
LE
D1 D2 D3
D4
D5
D6
D7
D8
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
2 5 6 9 12 15 16 19
3 4 7 8 13 14 17 18
20
11
5V
74HC373
V
CC
LE
D1 D2 D3
D4
D5
D6
D7
D8
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
2 5 6 9 12 15 16 19
3 4 7 8 13 14 17 18
20
11
5V
74HC373
V
CC
LE
D1 D2 D3
D4
D5
D6
D7
D8
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
2 5 6 9 12 15 16 19
3 4 7 8 13 14 17 18
20
11
5V
74HC4520 #2
V
CC
Q0 Q1 Q2 Q3 Q0 Q1 Q2 Q3
3456 11121314
17
9
15
16
5V
10
EN
EN
2
CLK GND RESET RESET
1MHZ
CLOCK
6
T1 DATA (MICROSECONDS) T2 DATA (MICROSECONDS)
GND
T1 T2
CLR
B
A
Q
Q
5V
5V
10F
GND
V+
5V
20pF
3.9k
9
15 14
16
6
7
5
8
4
1k
20pF
74HC86
10pF
10k
4
5
6
NC
NC
CLK
8
GND
OUT
1
10
GND
OUT
1
10
GND
OUT
1
10
Figure 12. A Hardware Interface for the TMP04
while the TMP03 temperature is monitored by measuring T1
and T2. Once the thermal impedance is determined, the tem-
perature of the heat source can be inferred from the TMP03
output.
One example of using the TMP04 to monitor a high power
dissipation microprocessor or other IC is shown in Figure 13.
The TMP04, in a surface mount package, is mounted directly
beneath the microprocessors pin grid array (PGA) package. In
a typical application, the TMP04s output would be connected
to an ASIC where the pulsewidth would be measured (see the
Hardware Interface section of this data sheet for a typical inter-
face schematic). The TMP04 pulse output provides a significant
REV. B

TMP03FRU-REEL7

Mfr. #:
Manufacturer:
Analog Devices Inc.
Description:
SENSOR DIGITAL -40C-100C 8TSSOP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union