+ Reply to Thread
Results 1 to 8 of 8

Thread: Ds1307

  1. #1
    miniman's Avatar
    miniman Guest

    Default Ds1307

    Could anyone help me in the interface of a PIC16F877A to DS1307 using the i2c protocol to set up and read.


    Hi, we are pleased to see that you are using our forum.

    We'd like you to become a member of our community. Membership is FREE, please REGISTER and view our forums without these annoying reminders!

    Once registered you may post on the forums, download from the file areas and use the WIKI without interruption.





  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    miniman

    Have you searched the Forum for "DS1307"

    There is plenty of stuff !

    And if you have a look at the Melabs site you will find a redy to run example from Melanie.


    You have got to do your homework on your own now.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3
    photoeye's Avatar
    photoeye Guest

    Default ds1307 code

    Hi miniman,

    do you know what is needed
    to change Mel's code from
    the melabs site to work with a
    PIC16F877?

    I read about the @ command
    but not sure how to change this
    to work with the 16F877.

    thanks.

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    Click Here

    Sorry for this comment,
    but if you don't know how to load Melanies code onto a 16F877
    you will not be able to understand that code at all.
    Last edited by NavMicroSystems; - 1st February 2005 at 22:57.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    photoeye's Avatar
    photoeye Guest

    Default ds1307

    I understand some of the code, not all of it.
    as I mentioned, I don't know the assembly side of things so that is why I am asking what changes are required to program it on a 16F877.

    I did not know I had to fully understand every bit
    of her code to post a question that would result in a
    helpful answer or one that I could learn from.

    darn, what happened to if you don't understand something, just ask?

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762

    Default

    photoeye

    The link posted earlier should give vo all information you need.

    BTW

    Melanies DS1307 example does not involve any assembler at all !!
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    photoeye's Avatar
    photoeye Guest

    Default ds1307

    not sure what link you are referring to.

    sorry, maybe I did not ask clearly enough.
    I am using the microcode studio. loaded
    the ds1307.bas file. when I compile, I get
    the following error messages:

    Error ds1307~1.asm 166:[255]undefined symbol 'intrc_osc_noclkout'
    etc...

    I went back to the pic basic manual
    to find out what the @ command does,
    it mentions the @ command allows insertion
    of an assembly line of code.

    I understand her code is written entirely
    in pic basic. there are lines of code in there
    that are assembly related.

    such as how the months are stored. that is
    why I am asking if there are changes
    required to properly compile for the 16f877 since
    the memory locations maybe different for each pic.
    I am guessing here that is why I am asking. I am
    not at your senior level to know and understand every
    line of code.


    if I select the target processor as 16F628, it compiles
    just fine but I don't have the 16F628 pic.

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

    Default

    Those @DEFINE statements preset the configuration bits for the 16F628. You can just delete those lines out and compile with default settings for your PIC16F877 or whatever you chose.

    If you go to the FAQ's section of this forum, see the thread on "Preseting Configuration Fuses". It tells you ALL you need to know about those lines. Insert one's appropriate to your chosen PIC - detailed instuctions on how to find all about your particular PIC's config fuses are contained theirin.

    The 16F877 doesn't have an equivallent to the 16F628's 'intrc_osc_noclkout', you'll have to chose a different oscillator setting - whatever option you chose will not affect the code (as long as it's 4MHz).

Similar Threads

  1. DS1307 RTC example
    By malc-c in forum Code Examples
    Replies: 13
    Last Post: - 12th November 2012, 19:56
  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. ds1307 from f877 to f452 not work
    By microkam in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th July 2005, 00:02

Members who have read this thread : 2

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