Parallax, Inc. • DS2760 Thermocouple Kit (#28022) • 01/2004
5
Menu:
DEBUG CLS,
"===============================", CR,
" DS2760 Thermocouple Interface ", CR,
"===============================", CR,
CR,
"Select TC Type (1 - 3)", CR,
CR,
"(1) K - Chromel/Alumel", CR,
"(2) J - Iron/Constantan", CR,
"(3) T - Copper/Constantan", CR,
CR,
">>> "
DEBUGIN DEC1 type ' get selection
IF (type < 1) OR (type > 3) THEN Menu ' validate selection
DEBUG CRSRXY, 0, 3, CLRDN ' remove selections
STORE type ' point READ to table
Show_SN:
DEBUG CRSRXY, 0, 4, "Device SN... "
FOR idx = 0 TO 7
GET idx, char
DEBUG HEX2 char
NEXT
Show_Type:
DEBUG CRSRXY, 0, 6, "TC Type..... "
LOOKUP (type - 1), ["KJT"], char
DEBUG char
' -----[ Program Code ]----------------------------------------------------
Main:
DO
GOSUB Read_TC_Volts ' read Seebeck voltage
GOSUB Read_CJ_Temp ' read cold junction temp
READ (tmpCJ * 2), Word cjComp ' get compensation voltage
' combine cjComp and tCuV
'
IF sign THEN
' TC below cold junction
IF (tCuV < cjComp) THEN
cjComp = cjComp - tCuV
ELSE
cjComp = 0 ' limit to 0C
ENDIF