Jon need programming tip
Guido
Posts: 195
Jon,
I have a simple one for you today. I am trying to run 3 DS1620 Temperature Sensors and wondering if there is a trick of the trade to not use so much variable space? Or is just the case with the stamp?Here is a basic example.
RstPin······· VAR· Nib····································· ' DS1620.3 (1 of 3)
RdTmp······ CON· $AA····································· ' READ TEMPERATURE
tempIn····· ·VAR· Word···································· ' RAW TEMPERATURE
tempC········VAR· Word···································· ' Celsius
tempF······· ·VAR· Word···································· ' Fahrenheit
ADDR1······· VAR· Word···································· ' INSIDEADDRESS FOR TIME/DATE STAMP
TL1············ VAR· Word···································· ' INSIDE LOW TEMPERATURE WORD
TH1··········· ·VAR· Word···································· ' INSIDE HIGH TEMPERATURE WORD
ADDR2····· · VAR· Word···································· ' OUTSIDE ADDRESS FOR TIME/DATE STAMP
TL2········· · ·VAR· Word···································· ' OUTSIDE LOW TEMPERATURE WORD
TH2········· ··VAR· Word···································· ' OUTSIDE HIGH TEMPERATURE WORD
ADDR3···· ·· VAR· Word···································· ' SHED ADDRESS FOR TIME/DATE STAMP
TL3·········· ·VAR· Word···································· ' SHED LOW TEMPERATURE WORD
TH3········· ·VAR· Word···································· ' SHED HIGH TEMPERATURE WORD
THANK YOU
Guido
I have a simple one for you today. I am trying to run 3 DS1620 Temperature Sensors and wondering if there is a trick of the trade to not use so much variable space? Or is just the case with the stamp?Here is a basic example.
RstPin······· VAR· Nib····································· ' DS1620.3 (1 of 3)
RdTmp······ CON· $AA····································· ' READ TEMPERATURE
tempIn····· ·VAR· Word···································· ' RAW TEMPERATURE
tempC········VAR· Word···································· ' Celsius
tempF······· ·VAR· Word···································· ' Fahrenheit
ADDR1······· VAR· Word···································· ' INSIDEADDRESS FOR TIME/DATE STAMP
TL1············ VAR· Word···································· ' INSIDE LOW TEMPERATURE WORD
TH1··········· ·VAR· Word···································· ' INSIDE HIGH TEMPERATURE WORD
ADDR2····· · VAR· Word···································· ' OUTSIDE ADDRESS FOR TIME/DATE STAMP
TL2········· · ·VAR· Word···································· ' OUTSIDE LOW TEMPERATURE WORD
TH2········· ··VAR· Word···································· ' OUTSIDE HIGH TEMPERATURE WORD
ADDR3···· ·· VAR· Word···································· ' SHED ADDRESS FOR TIME/DATE STAMP
TL3·········· ·VAR· Word···································· ' SHED LOW TEMPERATURE WORD
TH3········· ·VAR· Word···································· ' SHED HIGH TEMPERATURE WORD
THANK YOU
Guido
Comments
Another approach is to use the EEPROM (or an external EEPROM) to hold values. That way, you can reuse a 'TempLow' and 'TempHigh' variable for Raw, Inside, Outside, or Shed temperatures, holding the values long enough in TempLow and TempHigh to read or write them to the eeprom. Also, I believe an eeprom address is a byte, not a word.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office