Need help intergating a PIC16F628 with a DS1307


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2007
    Posts
    2

    Default Need help intergating a PIC16F628 with a DS1307

    I'm trying to modify an existing project (the http://www.alan-parekh.com/hard_drive_clock.html ) and I only know very little about programming. The modifications I did to the base coding already is make it run on an external 4MHz crystal and added a second hand to the clock (instead of the 2 LED ports lighting up) on the RB3. Looking at the schematic, the RA0 to RA5 ports are free and so is port RB7. I have the DS1307 and the PIC16F628 chips and would like to interface them, but I don't know how to intagrate it into the exisiting coding.

    I'm seeking your help here, because I believe Melanie wrote the original coding that's on the PICBasic site and it's the only coding that I can find interfacing a PIC16F628 with a DS1307 in PICBasic coding.

    My modified source code is here and if you spot any bugs, please point them out:
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81


    Did you find this post helpful? Yes | No

    Default

    Use Melanie's code by itself, once you have that working with the DS1307 then move on to integration.

    Also this code you show is quite long, trying to debug it with new code being added will be a nightmare..........................

    So start with getting small pieces of code to work at first and build upon it.

    good luck

  3. #3
    Join Date
    Oct 2007
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    I'll try, it's going to be a pain to seperate what I can use for the coding

  4. #4


    Did you find this post helpful? Yes | No

    Smile Man That's useless :P

    I have nevertheless an idea for you, the simple pic16F628 can work as a very good clock by itself, check Elapsed_Timer in the forum, if you are thinking on DS to keep time even when the device is off power then you can consider using the pic in low power too and using the same battery to keep him alive.

    Note: you can use even less power with the pic using a 32Khz cristal really convinient if you want to measure time also

    If you insist in RTC there is not much more to say than the example and the datasheet. Using RTC is a simple i2C read or write BUT take into account that data is delivered and stored in BCD.

    good luck

Similar Threads

  1. Watchdog Timers
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th August 2014, 18:03
  2. 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
  3. DS1307 on fire
    By brid0030 in forum General
    Replies: 6
    Last Post: - 25th November 2006, 02:44
  4. Connecting DS1307 to PIC16F877A
    By amindzo in forum General
    Replies: 4
    Last Post: - 8th September 2006, 14:11
  5. Serout PIC16F628 to PC R18iXL Board
    By Spindle in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th June 2005, 00:29

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