Ds1620
jc3III
Posts: 21
why does the Applied Sensor book use the number 2 to configure the DS1620 to continuous conversion with CPU. The book says that it is mode 2. On the data sheet 02h(2) writes low temp. value into TL register. EEh(238) initiates temp conversion, AAh(170), 0Ch(12) Writes configuration data to configuration register. I would like to know why are they using the number 2. It doesn't seem to match up with the DS1620 data sheet.
Comments
The answer is that some of the DS1620 commands have two parts, , the command itself, and the parameter. The sequence from Applied Sensors is
The command is 12 (configure), and the parameter is 2 (continuous conversion with CPU).
As a command, 2 has a different meaning (set low threshold).
Page 12 (write configuration)
http://datasheets.maxim-ic.com/en/ds/DS1620.pdf
See 'CONFIGURATION/STATUS REGISTER' on page 5
Also 'OPERATION IN STAND-ALONE MODE' on page 6
jc3III,
This reference doesn't specifically bring up 2 either, but the binary placement of the 'CPU bit' in the configuration status register is in position 2
"What is connected to the DS1620's T-com pin" - Nothing is connected if you don't use the alarm outputs.
TLOW and THIGH are alarm thresholds that you can set via the Write TH [01h] and the Write TL [02h].
TCOM is an alarm output that basically OR's TLOW an THIGH.... if either alarm has been tripped, so is the output of TCOM.
http://www.maxim-ic.com/app-notes/index.mvp/id/67
basically, you can connect anything that's TTL compatible to the outputs.
I am now trying to learn how to use a DS1620
Using it with BS1
I was trying to figure myself how to set a new temperatures to thermostat mode.
For example 25*C on High & 19*C on Low.
Anyone can help me?
I think I can't figure out how to "Shout" 9 bits of temperature number. I understand there is a W(n) memory slot must be used.
Anyway, any suggestions?
Here is the program for BS1 from Volts & nuts:
You would need to modify the Shout routine to send either 8 or 9 bits. I'm pretty rusty on the BS1, but I'd start by making the number of bits sent be a variable. To set the thresholds, you send the command, 8 bits, and then the desired threshold value, 9 bits, then set the RSTn line back low to complete the command.
Tracy, I need to set-up a high limit of (for example 22 degree C
I need to set up as:
SYMBOL HighTemp = B3
LET B3 = 22
Then I need to Shout this into DS1620 right after code (Write TH) High Temperature limit.
This is were I am losing something.
I am going to read more about.
Anyway, I did not get it yet...
Make B3=8, for sending the command (%00000001 for upper threshold and %00000010 for lower threshold), and B3=9 for nine bits to send the threshold value. The DS1620 requires 9 bits for the threshold value, and the 9th bit is the sign bit.
Here is the sequence to set the upper threshold to 22 °C using my program mods:
RSTn starts low.
B3=8 and DSout=1, call shout.
B3=9 with DSout=44, call shout.
set RSTn high to finish the command.
I have applicable info but using the Stamp 2 on this page:
http://www.emesystems.com/OL2d1620.htm#thermostat
Why can't we use the same to send comands?
I do not know what I am doing wrong...
I was trying to use your code, nothing worked.
I will post my modifications I made to the program.
Look at the above code
Remember, both DSout and DSin are using W0 register.
Original flie above. For anyone who wish to play with. (For BS1)
After bunch of trial and error.
It is now works prefect.
However, I had to break program into two. (There is a limit on GOSUB (16))
First will write desired High & Low limits.
Second program will read & display in DEBUG Terminal: High, Low, Curent Temperatures.
I think the main trick is at the top of both programs.
Look how I formatted temperature codes
High limit is 22C
Low limit is 19C
I would like to see your comments on both programs modifications I made.
And of cource big thanks to Scott Edwards!
W/out his help all of this may never be possible.
Temperature Write DS 1620 revB.bs1
Temperature Read DS 1620 revC.bs1
On the pictures you will see Green & Red LED.
Green will go on when T=>22C
Red will go on when T<=19C
I will take a look today. I will get back to you later.
I don't check my Parallax mail every day. Send me an e-mail to get a hold of me faster. romsk22@gmail.com.
Paul
I could only read the code because I do not have a DS1620. I didn't make any modifications to the code, however, I did "beautify" the code so it is eaiser to read.
Whenever I grab someone else's code, I usually have to throw in a LOT of WHITESPACE and INDENT the loops and conditionals. Notice how I added some comments based only on what I was able to determine from the code.
I suggest that you do the same (especially when you are learning a new device). Look at the code that I attached below. Notice how this is the same code, but now it is broken down into logical functions and is just a little bit "cleaner". Trust me, if you do this to every piece of code you view (or write) you WILL find mistakes and bugs faster, learn what another's code is doing quicker, and last but not least, make the code easy to read for the next reader.
Keep up the good work.
Paul