Shop OBEX P1 Docs P2 Docs Learn Events
Applied Sensors - Thermometer Calibration Page 78, question? — Parallax Forums

Applied Sensors - Thermometer Calibration Page 78, question?

MichelBMichelB Posts: 154
edited 2009-08-16 07:48 in Accessories
Hi all, after ran ThermometerCalibration.bs2 I obtained the following values: kal = 15608, degC = 26, rct = 522 and Kelvin = 299 (273+26). kal = (299·* 522) / 10 = 156078 / 10 = 15608, all is OK, but I can see in the memory map at the top the 2 bytes stored, C4 and 3B. C4=196, 3B=59 and C43B = 50235, where is the relation with the constant calculated? If I recalibrate and obtain an other value of kal 15556 for example C43B remains in memory! Curious, is it not?

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2009-08-16 01:23
    point 1: You should read that value stored in the first two locations of eeprom as the word value 3BC4, rather than as C43B. That is because the Stamp stores word values small-endian, with the least significant byte at the lower eeprom address. $3BC4 = 15300, which is the decimal value you can find in the program code:

    Ekal   DATA  Word 15300
    



    point 2: When you run the calibration program, it uses the DS1620 temperature sensor as a calibration reference. I finds a new value for Ekal and enters that in the same eeprom locations where there was originally the $3BC4 = 15300. In your setup, that changed the value stored there to 15608. That happens at RUN time, and does not show up on the memory map. The memory map only shows the memory as it is in the program code at compile time. To make it show up in the memory map, you coulc change the statement in the program to:

    Ekal   DATA  Word 15608
    



    That would then become the default value, until you again hold down the button for three seconds to enter the calibrate subroutine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • MichelBMichelB Posts: 154
    edited 2009-08-16 07:48
    OK, Tracy, well understood. Thank you very much.
Sign In or Register to comment.