| 数据搜索系统,热门电子元器件搜索 |
|
TMP03FSZ 数据表(PDF) 14 Page - Analog Devices |
|
|
|||||||||||||||||||||||||||||
TMP03FSZ 数据表(HTML) 14 Page - Analog Devices |
|
14 / 16 page ![]() TMP03/TMP04 REV. A –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 ; |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |