Shop OBEX P1 Docs P2 Docs Learn Events
DS2760 Question — Parallax Forums

DS2760 Question

KevinKevin Posts: 12
edited 2004-10-01 20:21 in BASIC Stamp
I bought the DS2760 Thermocouple Kit (#28022) and I have a question regarding the DS2760TC_Demo.BPE application demo that can be downloaded for the kit.

I notice that all the·READs always multiplies the location to be read·by 2 to get the actual location to be read from. This makes no sense to me since the index (i.e. tmp in degree C) is already correct.

For example, when determining the cold junction(CJ) compensation, the program first gets the CJ temp and than performs a read to get the millivolts values associated with that temp.· So, if tmpCJ already has the correct value to be used as a index, why multiple by 2?
··························READ (tmpCJ *2), Word cjComp

Also, when reading the max value in the table, it sets tblHi to 1023. But in order to read the value at that location, it multiples by 2 again. That would appear to me as if it is trying to read from 2046 instead of location 1023.
························· READ (tblHi * 2), Word testVal··············· ' check max temp
Why is this?

Thanks.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-10-01 20:15
    The thermocouple tables are stored as Words (two bytes), hence the requirement to multiply the temp by 2 in order to find its constant. And each 2K bank can hold 2048 bytes -- with two bytes per constant, constanat #1023 would be at locations 2046 (lowbyte) and 2047 (high byte).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • KevinKevin Posts: 12
    edited 2004-10-01 20:21
    Okay, now I feel dumb!!

    Thanks for the info.
Sign In or Register to comment.