Thanks old chap
i have been beating my head into the wall
I understand the alarm registers are 8 bit with the MSB being the sign bit. Is that a straight decimal conversion? i.e. 25 degrees Celsius would be %00011001
Again
Thanks a lot
Thanks old chap
i have been beating my head into the wall
I understand the alarm registers are 8 bit with the MSB being the sign bit. Is that a straight decimal conversion? i.e. 25 degrees Celsius would be %00011001
Again
Thanks a lot
Sure, that'll work. Added: (not the beating your head part)
Or you could just use 25.
High limit = 25°CCode:OWOUT DQ, 1, [$CC, $4E, 25, 0]
Low limit = 0°C
If you want to use negative alarms, it's easier to use a variable
Do you know how to read the alarm status yet?Code:LowLimit VAR BYTE HighLimit VAR BYTE HighLimit = 20 LowLimit = -10 OWOUT DQ, 1, [$CC, $4E, HighLimit, LowLimit]
<br
Last edited by Darrel Taylor; - 9th May 2008 at 07:13. Reason: Add:
DT
Think so
How's this?
Alarm_H VAR Bit
Alarm_L Var Bit
Owout DQ, 1, [$CC, $EC]
Owin DQ, 1, [Alarm_H, Alarm_L]
Is it going to send back a 1 or 0 alarm bit?
Well, not so good.
There is only 1 Alarm status bit, No SkipROM, and mode 4 (bit data) is used to retrieve it after the AlarmSearch command.
If there is an alarm, you have to read the temperature to figure out whether it's too high or too low.Code:Alarm VAR BIT OWOUT DQ, 1, [$EC] OWIN DQ, 4, [Alarm]
It will return a 0 if there is an alarm, 1 if not. But you can reverse that easily with...hth,Code:Alarm = Alarm ^ 1
DT
Thanks Darrell
I see. I forgot to change the mode bit. Still learning.
I really need a setpoint temperature for the "smarter" HVAC thermistat I am working on. I think I will just use another 18B20 as my setpoint temp and not worry about the alarms.
Absolutely
I am entering a setpoint in the software and also going to have another 18B20 outside to give me the "variable setpoint". This way the system knows if it really needs to turn on or to just pause until it warms up or cools down
Bookmarks