Dip switches or write to EEPROM or ?
I am designing an irrigation controller. Apart from the date and time, which will be maintained by a RTC chip, it needs to the know the current water restriction level. This is simply a number between 1 and 5. This number will control when it is legal for the controller to irrigate. I want to make this value persistent, to cater for any power interuptions. I don't water the unit switching to stage 1 restictions (minimal) in the heat of summer when we are on, say, stage 3 restrictions after an accidental power interuption. Apart from the increased water usage, heavy fines can be imposed.
My choices are:
1 - write the single byte stage value back to EEPROM whever it is changed. This value may be changed several times each summer.
PROS: No additional hardware required.
CONS: Limited number of writes to EEPROM ( but only a few writes a year so shouldn't be an issue )
2 - Use 3 DIP switches to store the value 1 thu 5
PROS: Persistent and robust
CONS: Requires extra hardware, and uses 3 extra I/O pins
3 - Another solution that just occured to me. Make the default restriction stage STAGE 5, which means DO NOT IRRIGATE.
PROS: Simple, cannot accidentally breach the regulations
CONS: Annoying if we get a lot of power interruptions, which we don't.
I think I have answered my own question!![lol.gif](http://forums.parallax.com/images/smilies/lol.gif)
KISS is always the best solution.
My choices are:
1 - write the single byte stage value back to EEPROM whever it is changed. This value may be changed several times each summer.
PROS: No additional hardware required.
CONS: Limited number of writes to EEPROM ( but only a few writes a year so shouldn't be an issue )
2 - Use 3 DIP switches to store the value 1 thu 5
PROS: Persistent and robust
CONS: Requires extra hardware, and uses 3 extra I/O pins
3 - Another solution that just occured to me. Make the default restriction stage STAGE 5, which means DO NOT IRRIGATE.
PROS: Simple, cannot accidentally breach the regulations
CONS: Annoying if we get a lot of power interruptions, which we don't.
I think I have answered my own question!
![lol.gif](http://forums.parallax.com/images/smilies/lol.gif)
KISS is always the best solution.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
That is an idea I had not considered. I am using a battery backed DS1307 RTC in my design. How much RAM is available, and how do I address it? Time to download yet another datasheet.
This is soooo much fun!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
56-byte, battery-backed nonvolative RAM for data storage.
That's more than the BS2 has AND it will survive a power interuption!
Thanks Jon - what a brilliant idea.
And it will help me with my memory problems. I am currently struggling for RAM with my controller program. This will give me all the room I need and more.
Post Edited (Bullwinkle) : 5/9/2006 2:22:20 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I live in Australia!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Except, your country prohibits all alcoholic beverages!
According to http://www.auspost.com.au/Pdfs/DangerousGoodsGuide.pdf
D2.3.1 – Alcoholic beverages
...
Subject to D10.10 – Liquids, Australia Post accepts in the post an alcoholic beverage of 70% (or less)
alcohol by volume, contained in primary receptacles of less than 5 litres capacity. Exceptionally, The
United States of America prohibits all alcoholic beverages.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
I'll send you a beer Jon!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'll send you a Coopers. Best beer in the country!
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
1+1=10
Sid
I'll send you one of these Jon, just as soon as I find a sturdy enough shipping container.