·· You may have to convert one of the existing PBASIC programs over to SX/B.· BASIC Stamp HR programs for the DS1620 have been posted before and are also in some Nuts & Volts articles.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
Chris,
Thank you for your reply. I have been working with the PBASIC program you are referring to for quite some time and have confirmed the fact that I am just not that smart. I have the .5 resolution transferring information from SX (slave) to BS2 (master) and have it displaying on the debug screen. I want to send the high-resolution information and was hoping someone had already got it working. I will keep trying.
Here is my snippet. I took this from an SX-28 example and ported it to SX-48. When I toggled the
Rst line, I would receive all three values: temperature, counter, and slope.
You must be in One-Shot mode when reading the High Resolution temperatures. The reason is that there is more than one
register that you need to read from in order to determine a temperature in high resolution mode. If you are free running, then
there is a likely chance that the register can be overwritten before you have had a chance to read all of the necessary register
values. In that case, the temperature reading will not be accurate.
The code below is untested, but if you take JDOhio's code, and make the following changes for One-Shot mode it should work.
While I can follow the Spin syntax for most of your post, I'm not sure about the conversion from temperature reading/counts/slope to a number that has 0.0625 resolution (How did you calulcate that resolution?). Would you be able to post the equation/algorithm you are using in a language neutral manner? The DS1620 documentation has something close to your post but there isn't enough parenthesis, and I wasn't sure what to do with the LSB.
JDOhio,
The high resolution is in 1/16th Deg C units.... or 0.0625 that's the best resolution obtainable from the DS1620.
Here is my revised "spin code" ... it basically follows the datasheet...
tc := ReadRegister(RdTmp,9) ' read temp in 0.5° C units
if tc > 255
tc -= 512
tc >>= 1 'Strip LSB divide by 2 ' Scale 0.5° units to 1° units
tc *= 100 ' Scale 1° units to 0.01° units
tc -= 25 ' Offset adjustment for high resolution conversion
cr := ReadRegister(RdCntr,9) ' read remaining counts
cpd := ReadRegister(RdSlope,9) ' read counts per degree
tc += ((cpd - cr)*100)/ cpd ' calculate high resolution temperature value
Result := tc
'' Note: In the New RevE DS1620 chips released (06/05/2003), the Slope register($A9) will always
'' read a value of 16 so it would be unnecessary to read the slope. Simply hard code the
'' 'cpd' value in the above code with a value of 16 instead.
Note for the above code.... 'tc' returns a value in x100 notation ... in other words 25 Deg C returns 2500
Note: The DS1620 RevD implemented a proprietary temperature sensing architecture using dual slope convergence method to determine temperature.
The DS1620 RevE implements a commonly used bandgap reference with sigma-delta ADC approach to determine temperature.
Attached is a file I received directly from Dallas Semiconductor/Maxim noting the difference between RevD and RevE version of the DS1620
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 11/23/2006 4:44:19 AM GMT
JDOhio,
Here is my work in progress.· I already have a functioning program working however it does not return the high resolution hence work in progress.· Hopefully you can pull from it what works for you.· The temperature acquisition and conversion seems to work for me.· I am sending this information to a BS2 to be viewed in the debug screen.· I read your latest post and hurriedly uploaded this file, when I have more time I will double-check if this file is in fact the latest of my versions.· Please anyone feel free to point out my errors and guidance in a better direction. ·
Also I did not include any way possible for the sign bit to be used.· I wondered if this is considered bad code writing, should it be included in the program even though it will never be used?
I have been able to read temperature, counter, and slope as Steve has done in his program. I did not attempt the conversion. My application is designed to write the information to an SD card using the Rogue Robotics MMC Module. In this manner, I can read a file from the SD card and do conversions in Excel. In an experiment, I also found that the slope does not change and am happy to learn that I won't have to read it (I suspect I have Rev E of the DS1620 - thanks Beau for the documentation).
Another curious thing - I think it's curious. My experiment was to log temperature measurements (counter and slope, too) over a 24 hour period in my sunroom. I started in the morning before the sun hits the sunroom and continued until the next morning. When I graphed the results, I saw where the temperature went down from the ambient in my office to something cold in the sunroom. As the sun heated the sunroom the temperature rose, and as the sun set, the temperature went down. The curious thing is that when the DS1620 was exposed directly to the sun, there was a significant rise in temperature (the DS1620 is on the SX-48 protoboard and the protoboard is not enclosed). It is clear in the graph where the DS1620 was in shadow and where it was exposed to direct sun. My theory is that the dark color of the chip absorbs a little heat and the sensor reacts accordingly. I attached the graph.
If you're measuring ambient air temperature, then the device doing the measuring must be in shade the whole time. This is true of plain old thermometers, and it's true of their digital equivalents. If the measuring device is in the sun, then you are measuring how hot the sun heats up the measuring device, not the ambient air temperature.
I thought so - I just thought it was cool to show it. As a verification, I set up my camera to take pictures every 30 seconds a day or so after I made the temperature measurements (using an intervalometer I made with an SX-48). The resulting time lapse MPEG showed the same number of sun/shadow transitions as the data. This is just too fun.
Hello,
I asked a similar question before, but nobody responded. I am getting a temperature somewhat offset with my DS1620. It gives me 25C, however other mercury and digital thermometers around say 22C. Do any of you have similar findings? Please send me a private message and carbon copy it on the board.
Thanks.
Comments
·· You may have to convert one of the existing PBASIC programs over to SX/B.· BASIC Stamp HR programs for the DS1620 have been posted before and are also in some Nuts & Volts articles.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thank you for your reply. I have been working with the PBASIC program you are referring to for quite some time and have confirmed the fact that I am just not that smart. I have the .5 resolution transferring information from SX (slave) to BS2 (master) and have it displaying on the debug screen. I want to send the high-resolution information and was hoping someone had already got it working. I will keep trying.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Did you find any temperature offsets when testing the DS1620? Mine seems to be 5C warmer on the chip than the ambiant air.
Frank
Rst line, I would receive all three values: temperature, counter, and slope.
I haven't evaluated chip temperature and ambient temperature.
Joe
You must be in One-Shot mode when reading the High Resolution temperatures. The reason is that there is more than one
register that you need to read from in order to determine a temperature in high resolution mode. If you are free running, then
there is a likely chance that the register can be overwritten before you have had a chance to read all of the necessary register
values. In that case, the temperature reading will not be accurate.
The code below is untested, but if you take JDOhio's code, and make the following changes for One-Shot mode it should work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 11/20/2006 6:40:11 AM GMT
While I can follow the Spin syntax for most of your post, I'm not sure about the conversion from temperature reading/counts/slope to a number that has 0.0625 resolution (How did you calulcate that resolution?). Would you be able to post the equation/algorithm you are using in a language neutral manner? The DS1620 documentation has something close to your post but there isn't enough parenthesis, and I wasn't sure what to do with the LSB.
Thanks,
Joe
The high resolution is in 1/16th Deg C units.... or 0.0625 that's the best resolution obtainable from the DS1620.
Here is my revised "spin code" ... it basically follows the datasheet...
Note for the above code.... 'tc' returns a value in x100 notation ... in other words 25 Deg C returns 2500
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 11/23/2006 4:44:19 AM GMT
Here is my work in progress.· I already have a functioning program working however it does not return the high resolution hence work in progress.· Hopefully you can pull from it what works for you.· The temperature acquisition and conversion seems to work for me.· I am sending this information to a BS2 to be viewed in the debug screen.· I read your latest post and hurriedly uploaded this file, when I have more time I will double-check if this file is in fact the latest of my versions.· Please anyone feel free to point out my errors and guidance in a better direction.
·
Also I did not include any way possible for the sign bit to be used.· I wondered if this is considered bad code writing, should it be included in the program even though it will never be used?
Hope this helps and thanks,
Steve
Post Edited (SteveD) : 11/24/2006 1:25:28 AM GMT
http://forums.parallax.com/showthread.php?p=608042
I have been able to read temperature, counter, and slope as Steve has done in his program. I did not attempt the conversion. My application is designed to write the information to an SD card using the Rogue Robotics MMC Module. In this manner, I can read a file from the SD card and do conversions in Excel. In an experiment, I also found that the slope does not change and am happy to learn that I won't have to read it (I suspect I have Rev E of the DS1620 - thanks Beau for the documentation).
Another curious thing - I think it's curious. My experiment was to log temperature measurements (counter and slope, too) over a 24 hour period in my sunroom. I started in the morning before the sun hits the sunroom and continued until the next morning. When I graphed the results, I saw where the temperature went down from the ambient in my office to something cold in the sunroom. As the sun heated the sunroom the temperature rose, and as the sun set, the temperature went down. The curious thing is that when the DS1620 was exposed directly to the sun, there was a significant rise in temperature (the DS1620 is on the SX-48 protoboard and the protoboard is not enclosed). It is clear in the graph where the DS1620 was in shadow and where it was exposed to direct sun. My theory is that the dark color of the chip absorbs a little heat and the sensor reacts accordingly. I attached the graph.
Joe
If you're measuring ambient air temperature, then the device doing the measuring must be in shade the whole time. This is true of plain old thermometers, and it's true of their digital equivalents. If the measuring device is in the sun, then you are measuring how hot the sun heats up the measuring device, not the ambient air temperature.
Thanks, PeterM
Thanks and sorry for the delay!
I thought so - I just thought it was cool to show it. As a verification, I set up my camera to take pictures every 30 seconds a day or so after I made the temperature measurements (using an intervalometer I made with an SX-48). The resulting time lapse MPEG showed the same number of sun/shadow transitions as the data. This is just too fun.
Joe
I asked a similar question before, but nobody responded. I am getting a temperature somewhat offset with my DS1620. It gives me 25C, however other mercury and digital thermometers around say 22C. Do any of you have similar findings? Please send me a private message and carbon copy it on the board.
Thanks.