iButton RTC
![LoopyByteloose](https://forums.parallax.com/uploads/userpics/025/nC57NMH1BTW54.gif)
I have recently renoticed the iButtons with one-wire interface and see that they have a Real Time Clock that is quite compact and only requires the one wire to interface with the BasicStamps or even the Propeller.
One the other hand, I begin to wonder if the software overhead of One-wire is much larger than using an I2C or SPI device.· Does anyone know for sure?
I am pretty sure it is more if you want to address many devices on one bus. But if I just use the RTC do I have to concern myself with the addressing and the Cyclic Redundancy Checking?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Post Edited (Kramer) : 9/10/2006 9:11:35 PM GMT
One the other hand, I begin to wonder if the software overhead of One-wire is much larger than using an I2C or SPI device.· Does anyone know for sure?
I am pretty sure it is more if you want to address many devices on one bus. But if I just use the RTC do I have to concern myself with the addressing and the Cyclic Redundancy Checking?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
···················· Tropical regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Post Edited (Kramer) : 9/10/2006 9:11:35 PM GMT
Comments
But a Real Time Clock that keeps time when the unit is powered down is a different kind of a problem. You have to add a crystal and a backup battery. The One-wire package has all that inside and a very simple footprint that will provide time for ten years.
I still face the dilemma that I would like to use one with the Propeller, but it is a 3.3volt system. I may just buy one and use it on my Development Board as the socket is already there. Seems to be a trade off between how much programing space or how much construction one is will to provide.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
A while back I wrote something that will be overkill for what you might want but should give you a feeling of what to do.
- My feeling is when feeding all the devices with 5V you can use parasite power (2 wires).
- The Propeller and others that use 3.3V go with 3 wire interface: Power, Data, Ground,
- Don't bother with CRC on a basic stamp. If you are seeing errors then change your wires.
- iButton's are VERY powerful once you understand them.
- Compared to the I2C types: DS1307,PCF8583, The SPI type DS1302, The 1-Wire DS1921 seems to be doing very well with just a few lines of code.
- iButton's are slow, the DS1904 can only work at 16.3Kbits. The DS1921 is faster with Hype drive at 125kbits/sec.
The attached code is for the DS1921 which has a Clock and a whole lot more but I am afraid the DS1904 will be harder because it does not define Months Days Years, hours and so on. What you need to see is only about 5 lines of this attachment :
I have since written a version that uses slots but stamps and slots make for read only code. The Propeller looks like a good fit for one wire esp. since the demo board has so few spare I/O ports.
Regards
Tim
Post Edited (TimC) : 9/10/2006 2:02:14 PM GMT
(BCD coded)
Just remember to stop the oscilator when you don't need it, so that the Lithium cell lasts longer...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
I just got the ThermoChron in the mail and downloaded a day's worth of data -- quite useful and nice [noparse][[/noparse]sees to be about 5 times as expensive too].
It has temperature and clock alarms too.
I used the Java Interface, but the above code will allow me to move data directly to an LCD or eliminate Java as a PC download requirement.
Well, that settles it! I have to order some more of these ASAP.
I have been looking at chips and clock crytals and BU batteries all year, but didn't like the complexity of the hardware.
Seemed a bit too many pieces to play with and get right.
It is nice to know I can have both a 3.3volt SX and a 3.3V Propeller use these.
I need to print out the 44 page document
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········