Shop OBEX P1 Docs P2 Docs Learn Events
Difference between DS1307 and DS1302? — Parallax Forums

Difference between DS1307 and DS1302?

jcpolejcpole Posts: 92
edited 2006-02-08 16:40 in BASIC Stamp
Hi all...

Aside from I2C support, are there any serious differences between the DS1307 RTC that comes installed on the PDB and the DS1302 that people keep talking about? I'm working on a BS2px application where the correct time will be pulled down from NTP (Network Time Protocol) chimers through a PINK, and I need to know if one of the RTC chips is better than the other. Since the eventual device is being designed from the ground up, I have the luxury of choosing the better of the two RTCs, assuming that one actually is better than the other.

Just out of curiosity, will the same commands control both devices? Ignoring I/O pin discrepancies for a moment, will sample code written for the DS1302 also run on the DS1307?

Thanks...

Jamie

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--
Jamie C. Pole
Principal Consultant
J.C. Pole & Associates, Inc.
http://www.jcpa.com/

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-07 06:06
    The best thing to do, of course, is compare the datasheets -- you can get them from Dallas/Maxim. Being 130x devices, they are nearly identical in basic timekeeping features. There are differences: The DS1302 will charge a battery, the DS1307 won't. The DS1307 has more RAM. The DS1307 has a programmable square-wave output, the DS1307 does -- there's probably more I missed but I think those are the major highlights.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-07 16:20
    Jamie,

    ·· Technically no, the DS1302 and the DS1307 do not use the same commands.· The DS1302 has an SPI interface and the DS1307 has an I2C interface.· On a BS2px using either chip will be no problem.· However if you were using a BS2 without I2C support more code would be involved.· Each chip will have registers in certain locations, etc.· As Jon said that's in the datasheet.· I personally prefer the DS1302.· Many prefer the DS1307.· It's really a matter of personal taste and if you require features one has that the other does not.· I don't believe either one is more accurate than the other.· Dallas/Maxim does have more accurate RTC chips, but between these it is pretty even.· If you need DS1307 code Jon has written some.· If you need DS1302 code there is some in a few threads in the Projects Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • NavNav Posts: 23
    edited 2006-02-07 21:41
    Chris Savage said...
    The DS1302 has an SPI interface ...
    Does it have an SPI interface ?· I thought it had a Maxim 3-wire interface.· I have used it in 3-wire configuration without any problems.· Or does it have both interfaces ?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-08 02:36
    SPI and the 3-wire interface are essentially the same.· Data/Clock lines and the Chip Select.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-08 16:09
    Historically I think that first there was Microwire, then SPI, then Maxim 3-wire.

    The BasicStamp groups them all under Shift-in and Shift-out, but there are proprietary details which are mainly for the programmer to sort out. Speed is a factor in some cases.

    The wiring pretty much looks the same.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-02-08 16:40
    The SPI spec allows for separate data in and data out lines, although in practice many devices simply use one line or tie the two together using a 1K resistor.· In any event it could all be called Synchronous Serial Devices.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.