DS1307 help


Closed Thread
Results 1 to 3 of 3

Thread: DS1307 help

  1. #1
    Orlando's Avatar
    Orlando Guest

    Default DS1307 help

    Does anyone know how to interface to the DS1307 with an 18Fxxx series?
    I am using a PIC18F6620 @ 20MHz. On the DS1307 I have 2 10K pullups on SDA & SCL and an XTAL @ 32,768kHz. Below is sample code I have written just as a test program. My LCD reads zeros when I try to read the data. I have followed several examples in this archive but nothing seems to work! I have even replace the chip and nothing.
    thanks in advance for your help!


    DEFINE OSC 20
    DEFINE I2C_SLOW 1


    SCL var PORTF.4
    SDA var PORTF.5


    mins var byte
    hr var byte
    day var byte
    date var byte
    month var byte
    year var byte


    TRISF=0


    Start:


    I2CWRITE SDA,SCL,$D0,$00,[$00,$00,$12,$02,$16,$03,$05]
    pause 10

    I2CREAD SDA,SCL,$D1,$01[Mins,Hr,Day,Date,Month,Year]
    pause 10

    debug PlaceCursor,78," DATE & TIME ",PlaceCursor,105,126,"1. Time: ",hex Hr,":",hex2 Mins,PlaceCursor,145," 2. Date: ",PlaceCursor,158,",",hex2 Month,"/", hex2 Date ,"/",hex2 year

    goto start

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


    Did you find this post helpful? Yes | No

    Default

    Orlando,

    an excellent example can be found here

    and please see this: this
    regards

    Ralph

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



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


    Did you find this post helpful? Yes | No

    Default

    Also drop those 10K's down to 4K7.

Similar Threads

  1. DS1307 RTC example
    By malc-c in forum Code Examples
    Replies: 13
    Last Post: - 12th November 2012, 20: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, 14:26
  3. DS1307 on fire
    By brid0030 in forum General
    Replies: 6
    Last Post: - 25th November 2006, 03:44
  4. Connecting DS1307 to PIC16F877A
    By amindzo in forum General
    Replies: 4
    Last Post: - 8th September 2006, 15:11
  5. ds1307 from f877 to f452 not work
    By microkam in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th July 2005, 01:02

Members who have read this thread : 1

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