
Originally Posted by
HenrikOlsson
Hi,
So you have a raw reading which you want to divide by 1.64, is that correct? Or do you want to multiply the raw value by 1.64?
TempC = TempC ** 39961 ' Multiplu by 0.60976 which is the same as dividing by 1.64
or
TempC = TempC */ 420 ' Multiply by ~1.641
or
TempC = TempC + (TempC ** 41943) ' Multiply by 0.64 and add result to previous value.
If neither of these works can you give us a bit more details about how the raw values correlates to actual temperature. Ie what raw value do you get at 0 temp and what raw value do you get at max temp (500 degrees in this case).
/Henrik.
Divide by 1.64. I found that the meat thermocouple in boiling water required me to divide by 1.64 to get 100C. The cooker thermocouple was a similar (but slightly different) number. In reality, I have a calibration routine that determines the number then it is stored in COOK_ADJUST or MEAT_ADJUST. This is so I can easily correct if a new thermocouple is installed.
After reading Jerson's post, I changed C_TEMP and M_TEMP (the cooker and meat raw ADC values, respectively) to LONGS. I came up with the following that I will try when I finish building the new board:
Code:
C_TEMP = C_TEMP * 1000
C_TEMP = C_TEMP / COOK_ADJUST 'ADJUST * 1000
C_TEMP = C_TEMP + (C_TEMP << 3) ' mul by 1 x + 8*x = 9x
C_TEMP = C_TEMP / 5 ' div by 5
C_TEMP = C_TEMP + 320 ' add 32 with 1 decimal accounted for
M_TEMP = M_TEMP * 1000
M_TEMP = M_TEMP / MEAT ADJUST
M_TEMP = M_TEMP + (M_TEMP << 3) ' mul by 1 x + 8*x = 9x
M_TEMP = M_TEMP / 5 ' div by 5
M_TEMP = M_TEMP + 320 ' add 32 with 1 decimal accounted for
'CT:nnn.nF MT:nnn.nF
LCDOUT $FE, $80, "CT:", DEC3 (C_TEMP / 10), ".", DEC1 (C_TEMP MOD 10), "F"
LCDOUT $FE, $80 + 9, " ", "MT:", DEC3 (M_TEMP /10), ".", DEC1 (M_TEMP MOD 10), "F"
I think this will work. Opinions?
Bookmarks