DS1307 not running?


Results 1 to 19 of 19

Threaded View

  1. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: DS1307 not running?

    not sure what version of pbp you are using but you could try
    DEFINE I2C_SLOW 1


    your original CODE LOOKS PRETTY GOOD TO ME

    I2CWrite SDA, SCL, $D0, $00, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear, RTCCtrl]
    I2CWrite SDA, SCL, $D0, 0, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear] would do

    Return

    ' Subroutine to read time from RTC
    gettime:
    I2CRead SDA, SCL, $D0, $00, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear, RTCCtrl]
    I2CRead SDA, SCL, $D0, 0, [RTCSec, RTCMin, RTCHour, RTCDay, RTCDate, RTCMonth, RTCYear] would do
    Return

    sometime the rtc osc needs a wake up
    i2cwrite sda,scl,$D0,0,[%10000000] ' FORCE CLK OSC TO START st bit
    i2cwrite sda,scl,$D0,0,[0] ' FORCE CLK OSC TO START

    if you don't have a battery on the 1307 the vbatt pin nees to be grounded , if left floating the chip can be difficult

    ps this is for pbp 3 not sure about earlier verrsions
    Last edited by richard; - 30th May 2014 at 13:08. Reason: pbp3 note

Similar Threads

  1. Replies: 8
    Last Post: - 28th January 2014, 14:21
  2. using DS1307
    By Scampy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 2nd December 2013, 10:01
  3. 18F4550 not running
    By comwarrior in forum General
    Replies: 6
    Last Post: - 1st January 2011, 01:07
  4. Cant get my PIC running
    By Viberer in forum Off Topic
    Replies: 13
    Last Post: - 29th August 2008, 20:07

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