DS1307 Functionality


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382

    Question DS1307 Functionality

    I have my DS1307 wired up and working well. I used the MN1307 example as a kind of template.

    I'm looking to trim back the code and make it less extensive. The MN1307 code does all of the hand holding to ensure values don't go out of range.

    I would like to just increment a value, send it to the RTC, then read the RTC and display the result.

    The question is if the value is out of range, for example value 25 is sent for the hour, will the RTC just loop back around to 1? (basically I want the RTC to do the hand holding)

  2. #2
    mytekcontrols's Avatar
    mytekcontrols Guest


    Did you find this post helpful? Yes | No

    Default Error checking on external input is required

    I'm using this RTC in my project as well.

    Yes it does need you to do the error checking as far as setting the clock is concerned. I did a test where I entered the value of 60 into the Seconds register. it kept on counting 61,62,63... until it got to 80, where it rolled over and left 40 behind. After this it continued to work correctly, and rolled over properly at 59, only leaving zero behind as it should.

    So to reiterate; an error routine is required to limit the values that someone can enter when setting the clock (and calendar as well), but other than this the DS1307 will take care of itself from a time and date keeping sense.

  3. #3
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Fair enough I will just leave that code in there.

    As far as date is the same issue going to occur? Example: User enters 31st for the date but the month they selected has 30 days.

    Thanks for checking this out....my code isn't fair enough for me to test.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The DS1307 allows the entry of silly values which is why you need to prevent it happening.

  5. #5
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Oh well, can't fault a guy from trying. Thanks for the help.

Similar Threads

  1. DS1307 12-hour mode with AM/PM divisor
    By JNOR07 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th August 2007, 13:26
  2. DS1307 on fire
    By brid0030 in forum General
    Replies: 6
    Last Post: - 25th November 2006, 02:44
  3. Connecting DS1307 to PIC16F877A
    By amindzo in forum General
    Replies: 4
    Last Post: - 8th September 2006, 14:11
  4. ds1307 from f877 to f452 not work
    By microkam in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th July 2005, 00:02
  5. DS1307 help
    By Orlando in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2005, 15:17

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts