In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Dunnsept wrote: OK.. final work around without using tables at all.. note: YMMV, this works for me and is accurate enough. this is also obviously not complete code [code] check_cj_temp read_tc temp = TC_LSB \ 5 temp = temp * 2 theTEMP = cj_temp + temp get_cj: owwrbyte tempin, skipnet owwrbyte tempin, rdreg owwrbyte tempin, $18 owrdbyte tempin, cj_temp owrdbyte tempin, tcuvb return check_temp: owreset tempin,temp1 owwrbyte tempin,skipnet owwrbyte tempin,rdreg owwrbyte tempin,$0E owrdbyte tempin, TC_MSB owrdbyte tempin, TC_LSB sign = TC_MSB.7 ' save sign bit TC_LSB = TC_LSB >> 3 [/code] [/code] TC_LSB is the lsb returned from the DS2760 after adjusting the 12 bit data. cj_temp is the MSB from checking the cold junction temp. I put together a speadsheet of the calculations to compare to the real K type table and the values are really close. looks like maybe +- 0.5 or so sometimes it's right on. I know that thermocouples are not linear but for the ranges I want this is really close and sure beats having to deal with all those table lookups ;-) BTW: the heat sink on my regulator on the SX tech board is 113F whilst my office is 71F isn't it wonderful the things you can discover with thermocouples? :p :p ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=127447#m127716 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)