Help with MS5607 corrections for low temperatures
Hi,
Hopefully I can get some last minute help. I'm launching a high altitude balloon tomorrow (Saturday May 24th) with the MS5607 altimeter on board on the Propeller BOE with an LCD readout as well data logging. My code does not have the two corrections needed for lower operational temperatures (below 20 celsius and below -15 celsius). Can anyone give me code suggestions as to how to incorporate these two corrections?
Much appreciated. Otherwise will have to launch as is and see what happens.
Andres
Hopefully I can get some last minute help. I'm launching a high altitude balloon tomorrow (Saturday May 24th) with the MS5607 altimeter on board on the Propeller BOE with an LCD readout as well data logging. My code does not have the two corrections needed for lower operational temperatures (below 20 celsius and below -15 celsius). Can anyone give me code suggestions as to how to incorporate these two corrections?
Much appreciated. Otherwise will have to launch as is and see what happens.
Andres
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
sd_DO = 22
sd_CLK = 23
sd_DI = 24
sd_CS = 25
TX_PIN = 2
BAUD = 19_200
START_ALT = 20
OBJ
sdfat : "fsrw"
pst : "Parallax Serial Terminal"
LCD : "FullDuplexSerial.spin"
alt : "29124_altimeter"
PUB start | a , t , mount
LCD.start(TX_PIN, TX_PIN, 00, 19_200)
waitcnt(clkfreq / 100 + cnt)
mount := \sdfat.mount_explicit (sd_DO, sd_CLK, sd_DI, sd_CS)
LCD.tx(17)
if mount < 0
lcd.str( string( 13, "Failed to mount", 13 ) )
abort lcd.str(string( 13, "SD card found & mounted", 13) )
alt.start(alt#QUICKSTART, alt#BACKGROUND)
alt.set_resolution(alt#HIGHEST)
alt.set_altitude(alt.m_from_ft(START_ALT * 100))
sdfat.popen( string("Data.csv"),"w")
repeat
a := alt.altitude(alt.average_press)
lcd.str(string("Alt:"))
lcd.str(alt.formatn(a, alt#TO_FEET,8))
sdfat.popen( string("Data.csv"),"a")
sdfat.pputs(alt.formatn(a, alt#TO_FEET,8))
lcd.str(string("Temp:"))
lcd.str(alt.formatn(t, alt#TO_DEGF,8))
t := alt.current_temp
sdfat.pputs(alt.formatn(t, alt#TO_DEGF,8))
sdfat.pputs(string(" ",13,10))
sdfat.pclose LCD.tx(13)
waitcnt(clkfreq * 5 + cnt)
» 
Comments
After calculating cur_temp, you would have to do two if statements (one nested inside the first) to calculate a T2, OFF2, and SENS2 based off the equations in the datasheet. Ultimately, the best thing to do in your case until you can get the 2nd order compensation figured out on the board is just record the raw values and post-process in a program you're comfortable with such as excel or MATLAB.