Shop OBEX P1 Docs P2 Docs Learn Events
RTC chip - Recommendations — Parallax Forums

RTC chip - Recommendations

pacmanpacman Posts: 327
edited 2009-11-09 21:47 in Propeller 1
I would like to utilise a RTC chip with a propeller; after much reading of the forums and data sheets I'm still as confused as ever.

I realise that there is no 100% correct answer, but if what are the _relative_ merits of a couple of the RTC chips (DS1302, DS1307, etc, etc). I can't seem to figure out why/where you would use one over another (in a simple application without the need for various alarm times)

I realise that there are some objects in the OBEX to talk to some, so they would be the first choice for utilisation, but perhaps there are compelling reasons to use model XYZPQ?


Thanks for your insight in advance....

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
=================
The future is in our hands.
Which way to the future?
=================

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-11-09 02:27
    You always start with figuring out what you need. Do you want something with an alarm? Do you want something that keeps track of hours / minutes / seconds? How much smaller a time interval is needed? How many I/O pins do you have? I2C only needs 2 I/O pins and a clock can be added to the same I/O lines as the boot EEPROM. SPI needs 3 or 4 I/O pins and is the simplest protocol. 1-Wire only needs one, but the software is a lot messier. Is there already code to do what you want?

    The Dallas DS1307 uses an I2C bus and has 64 bytes of battery backed RAM.
    The Dallas DS1302 uses an SPI bus, has 32 bytes of battery-backed RAM and a trickle charger for a rechargable battery.
    The Philips PCF8583 is also I2C and has 240 bytes of battery-backed RAM.
    There are others.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-11-09 02:59
    It might help to look at the required voltage range, what its power consumption will be if you are running on batteries or have a remote station going for long periods of time, and whether or not you want a backup battery to keep it alive during a power outage. Also, look at their temperature ranges: some are not rated for below 0 Celsius operation. If you need higher precision, you might want to keep your unit inside a temperature controlled box so the crystal frequency doesn't drift too much and cause your RTC to run fast or slow. I've used a DS1307 and the object for it in the obex and it seems to work just fine, though I've never needed high precision. Longstoryshort, the best thing you can do is go through the data sheets item by item and try to understand what the numbers really mean. Most of them you probably don't need to know about unless you're going to write software from scratch and need to know rise times, etc. for pulses, but other numbers are critical: voltage requirements, how many Propeller pins you want it to consume, how fast it can give you an update on the time (if it takes 3 seconds for it to give you a number, then you obviously can't ask it for the time every 2 seconds and get a reasonable result).

    my .2 cents worth.
    smile.gif
  • pacmanpacman Posts: 327
    edited 2009-11-09 03:37
    Thanks guys,

    You know I read the DS spec sheets and completely glazed over the I2C SPI difference (they both do I2C - why are their two of models?...). Sort of explains why I'm a noob... blush.gif

    I'm thinking one of those funky word clocks www.instructables.com/id/A-Word-Clock/ and obviously the 'best' chip to do it with would be the propeller. Why the competition even bother to sell any of the lesser PIC's is beyond me smilewinkgrin.gif

    So I'm thinking the prop would poll the RTC on power-up and then once every 30 seconds or so there after. Basically the RTC is a 'time checker' to stop drift....

    No need for alarms, or other cleverness.

    I2C would be my first choice ('cause I have had success with I2C in the past), but I'm not locked into any hard rules - provided I have enough 'pins' left for driving the LEDS (also by I2C perhaps..).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-09 04:20
    I find that the PCF8563 is readily available, I2C, and cheap (cheapest?). What's more it has very low standby consumption (0.25ua) which you don't get with those RTC+RAM combos.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • AleAle Posts: 2,363
    edited 2009-11-09 08:17
    Kye wrote an object for the DS1307. Be aware that it is a 5V device. I do not think that connecting the output (SDA) would cause a problem with the 3.3V EEPROM, but there are a couple of recommended ways. Supposedly the output is open-drain or open-collector...
    I wanted one that had a seconds counter instead of hs, mins and seconds...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • dMajodMajo Posts: 860
    edited 2009-11-09 11:19
    Take also a look on Ramtron FM31L278. Beside being a RTC it replaces also the 32K boot eeprom (no wear on write - same speed as read cycle). It have also many other functions. What is nice about the RTC compared to other chips (with backed sram) is that the RTC registers are fram based and the battery is only used to keep the oscillator running. That means that if you have a minute power outage (and the backup battery/capacitor is out of order) when the power comes back your time is late by 1 minute and not reset to some random value: you will not lose your time, it will only not be so accurate. In many applications this is very useful.

    Free samples available

    PEdit: spelling

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search

    Post Edited (dMajo) : 11/9/2009 4:51:07 PM GMT
  • heaterheater Posts: 3,370
    edited 2009-11-09 11:47
    Hmm interesting.

    Does anyone know if the RAMTRON FM31256G 256Kb I2C Processor companion also works as a Propeller EEPROM? It's the only thing close to an AT24C256 that I can get locally here. Having an RTC into the bargain would be great.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • AleAle Posts: 2,363
    edited 2009-11-09 12:13
    dMajo: Do you mean we will not lose that much time ?


    @heater: It answers in the address 1010x(a1)(A0) like the 24LC256 (and similar ics) so It should work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU

    Post Edited (Ale) : 11/9/2009 12:26:19 PM GMT
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-11-09 12:52
    Mouser has only 25 in stock of the FM31L278 and at 100 off qty they are only $10 a piece ^%*%$#@$$

    I know the Ramtron stuff is rather specialized but the whole 8 cores of 32-bit cpu plus RAM etc cost only $8 in one off qtys, and yet a simple little glorified counter chip costs almost as much or more in this case, crazy!

    PCF8563 at Digikey costs $1.48 one off, more like it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*
  • localrogerlocalroger Posts: 3,452
    edited 2009-11-09 13:17
    Sparkfun has a DS1307 module available with everything assembled, including the oscillator and lithium battery, for about $20.
  • heaterheater Posts: 3,370
    edited 2009-11-09 13:20
    On the other hand ELFA here has FM31256G for 7.30 euro which compares favorably to the last EEPROMS I bought so having a free RTC as well is quite a bargain. Mind you they have been obsoleted now. And how to deal with these didddy surface mount parts...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • dMajodMajo Posts: 860
    edited 2009-11-09 13:36
    @heater: by an early/fast comparison of the datasheets also the FM31256G should work (addressing seems the same) but the product is not anymore recomended for new designs.

    @Ale: I think yes. I want to say that eg. if you loose power from 22:00:00 to 22:01:00 then when power is back (without any initialization) the RTC starts from 22:00:00 so when you read it you read a time that is only 1min late. If you have eg. to turn lights of your garden on/off than 1 min. is not a problem, but if the RTC resets to random time is a problem (lights can light during day and stay off during night). The same can be said if you relay on calendar eg. you have date based events.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search
  • dMajodMajo Posts: 860
    edited 2009-11-09 13:47
    @heater: don't know from where you are but

    http://www.futureelectronics.com/en/Technologies/Product.aspx?ProductID=FM31L278GRAMTRON5037577

    http://it.mouser.com/Search/Refine.aspx?Keyword=FM31L278

    http://www.newark.com/ramtron/fm31l278-g/40c-to-85c/dp/98M0903


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search

    Post Edited (dMajo) : 11/9/2009 1:57:34 PM GMT
  • SapiehaSapieha Posts: 2,964
    edited 2009-11-09 15:25
    Hi heater


    FM31256G This IC is same as FM31L278 and it must work
    And is pin compatible to

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nothing is impossible, there are only different degrees of difficulty.
    For every stupid question there is at least one intelligent answer.
    Don't guess - ask instead.
    If you don't ask you won't know.
    If your gonna construct something, make it·as simple as·possible yet as versatile as posible.


    Sapieha
  • heaterheater Posts: 3,370
    edited 2009-11-09 16:07
    Great stuff guys, I'll get a couple and try them out. Hope I can solder an SO8 somehow.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • AleAle Posts: 2,363
    edited 2009-11-09 16:18
    dMajo:
    www.yourdictionary.com/loose
    www.yourdictionary.com/loose

    If you meant that the "time" as a continuous flow is loosened from its tightness for 1 minute because of not being counted, if one can say such a thing, then yes, to loose it would be correct wink.gif

    Changing topic a bit I found 3 DLG-2416 in an old Nicolet Series 400 Osci that I have laying around... Did someone connect any of them to a prop yet ?

    Edit: removed the food related comment wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU

    Post Edited (Ale) : 11/9/2009 5:07:22 PM GMT
  • dMajodMajo Posts: 860
    edited 2009-11-09 16:48
    Ale said...
    dMajo:
    www.yourdictionary.com/loose
    www.yourdictionary.com/loose

    If you meat that the "time" as a continuous flow is loosened from its tightness for 1 minute because of not being counted, if one can say such a thing, then yes, to loose it would be correct wink.gif

    Changing topic a bit I found 3 DLG-2416 in an old Nicolet Series 400 Osci that I have laying around... Did someone connect any of them to a prop yet ?

    Yes Ale, I mean this .... now I get your lose/loose commentblush.gif : better late than never tongue.gif ... I will correct the typo ...

    BTW isn't "meat" more related to food rather than to electronics?smilewinkgrin.gif In every way pls keep correcting me: I have to improve my english!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · Propeller Object Exchange (last Publications / Updates);·· Vaati's custom search
  • heaterheater Posts: 3,370
    edited 2009-11-09 16:56
    I think Ale meant "meant" not "meat" if you know what I mean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • AleAle Posts: 2,363
    edited 2009-11-09 17:06
    hahaha, I fell in my own trap, sweet sweet world of ours, hahaha.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
  • photomankcphotomankc Posts: 943
    edited 2009-11-09 21:47
    Peter Jakacki said...
    I find that the PCF8563 is readily available, I2C, and cheap (cheapest?). What's more it has very low standby consumption (0.25ua) which you don't get with those RTC+RAM combos.

    Dang. Wish I had found that one and not the 8583. I would have preferred the straight-forward clock registers and full 0-99 year counter. I may have to get that one and adapt my 8583 driver to it! Shouldn't be hard.


    ETA: Question here..... that trimmer cap on the crystal from the input to VDD, what is the expected effect on the OSC frequency as the capacitance is increased? I never saw them describe what the effect would be, only that it would have an effect. I know on the breadboard mine runs slow but I wasn't expecting much given the medium. So far I have not been able to accurately determine what the trimmer would do as it's value is changed.

    Post Edited (photomankc) : 11/9/2009 9:55:00 PM GMT
Sign In or Register to comment.