tmp03fruz-reel7 Analog Devices, Inc., tmp03fruz-reel7 Datasheet - Page 14
![no-image](/images/no-image-200.jpg)
tmp03fruz-reel7
Manufacturer Part Number
tmp03fruz-reel7
Description
Serial Digital Output Thermometers
Manufacturer
Analog Devices, Inc.
Datasheet
1.TMP03FRUZ-REEL7.pdf
(16 pages)
TMP03/TMP04
{ ADSP-21XX Temperature Measurement Routine
}
.MODULE/RAM/BOOT=0
.ENTRY TEMPMEAS;
.CONST PRESCALER=4;
.CONST TIMFULSCALE=0Xffff;
TEMPMEAS:
TEST1:
TEST0:
COUNT2:
COUNT1:
COMPUTE:
.ENDMOD;
;
Altered Registers:
Return value:
Computation time:
si=PRESCALER;
sr0=TIMFULSCALE;
dm(0x3FFB)=si;
si=TIMFULSCALE;
dm(0x3FFC)=si;
dm(0x3FFD)=si;
imask=0x01;
if not fi jump TEST1;
if fi jump TEST0;
ena timer;
if not fi jump COUNT2;
dis timer;
ay0=dm(0x3FFC);
ar=sr0-ay0;
ax0=ar;
dm(0x3FFC)=si;
ena timer;
if fi jump COUNT1;
dis timer;
ay0=dm(0x3FFC);
ar=sr0-ay0;
my0=400;
mr=ar my0(uu);
ay0=mr0;
ar=mr1; af=pass ar;
astat=0;
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;
divq ax0; divq ax0;
divq ax0; divq ax0;
ax0=0x03AC;
ar=ax0-ay0;
rts;
TEMPERAT;
Listing 2. Software Routine for the TMP04-to-ADSP-210x Interface
ax0, ay0, af, ar,
si, sr0,
my0, mr0, mr1, mr2.
ar —> temperature result in 14.2 format
2
TMP04 output period
{ Beginning TEMPERAT Program }
{ Entry point of this subroutine }
{ For timer prescaler }
{ Timer counter full scale }
{ Timer Prescaler set up to 5 }
{ CLKin=10MHz,Timer Period=32.768ms }
{ Timer Counter Register to 65535 }
{ Timer Period Register to 65535 }
{ Unmask Interrupt timer }
{ Check for FI=0 to locate transition }
{ Enable timer, count at a 500ns rate }
{ Check for FI=1 to stop count }
{ Save counter=T2 in ALU register }
{ Reload counter at full scale }
{ Check for FI=0 to stop count }
{ Save counter=T1 in ALU register }
{ mr=400 T1 }
{ af=MSW of dividend, ay0=LSW }
{ ax0=16-bit divisor }
{ To clear AQ flag }
{ Division 400 T1/T2 }
{ with 0.3 < T1/T2 < 0.7 }
{ Result in ay0 }
{ ax0=235 4 }
{ ar=235-400 T1/T2, result in øC }
{ format 14.2 }
{ End of the subprogram }
{ Check for FI=1 }
TEMPERAT.DSP