ds1307


Closed Thread
Results 1 to 8 of 8

Thread: ds1307

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    I don't know anything about that simulator, but that code seems to work fine in the Proteus Simulator with a 16F88.
    What chip are you using?

    DT

  2. #2
    Join Date
    Jun 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    I'm using a 16F690. I have never used any rtc's at all so don't know if my simulator will do this. It does have a rtc ds1307 in it though. My simulator is keeping time off the computers time.This is my chip set up:
    Code:
    TRISC   =   %00000000
    TRISB   =   %00000000
    TRISA   =   %000000
    CM1CON0.7 =  0 ' Comparators = off
    CM2CON0.7 =  0 ' Comparators = off
    ANSEL   =   %00000000
    ANSELH  =   %00000000
    Last edited by mel4853; - 6th January 2013 at 23:53.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    The code specifies PORTB.0 and PORTB.1 as SDA and SCL.
    But the 16F690 doesn't have either RB0 or RB1, it only has RB4-RB7.

    What pins are the DS1307 connected to in your simulation?
    DT

  4. #4
    Join Date
    Jun 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    SDA to PORTA.0 & SCL to PORTA.1 sorry forgot to post that also.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    Using a 16F690 with the changes you posted ... It still works.

    I can't comment on the simulator you are using.
    But I think you can assume the problem is not in Bruce's code.

    DT

  6. #6
    Join Date
    Jun 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    Thanks Darrel really thought it was my simulator, now I know that. Thanks again, will look more into how this works with my simulator or if I'm just SOL.

  7. #7
    Join Date
    Dec 2012
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Re: ds1307

    Some simulators wont set the time automatically to system time, Ive run into this in the past, but just have your PIC chip check the time on startup and if it's all 0s, have it set the time through the code to a certain time or date. They do that for more realistic hardware, just like as if you were to hook up a blank ds1307 chip up and just started using it.

Similar Threads

  1. DS1307 RTC example
    By malc-c in forum Code Examples
    Replies: 13
    Last Post: - 12th November 2012, 20:56
  2. ds1307
    By jonas2 in forum Code Examples
    Replies: 0
    Last Post: - 2nd November 2009, 10:50
  3. ds1307 i2c
    By tamertokgoz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 13th June 2008, 16:26
  4. DS1307 help
    By Orlando in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2005, 16:17
  5. Ds1307
    By miniman in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd February 2005, 09: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