MN1307 sample code problem


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120

    Default MN1307 sample code problem

    Hi to all the picbasic club,

    I have a problem with the SAMPLE code of MN1307.
    I use as the code 16f628 and lcd module.I have just made some changes for the pins of the lcd and the SDA/SCL of the sensor DS1307
    BUT
    the time is going up very very slow.I change the sensor,the cystal but I have the some problem.Every seconds is approximately 6sec

    What is wrong???
    The Vbat going to ground,I have pulp up resistors for theSDA/SCL...

    Please advice
    Nikos

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


    Did you find this post helpful? Yes | No

    Default

    MN1307 just sits in a loop continuously reading the registers of the DS1307 chip (about four times a second) and displaying the results.

    If time is going by very slowly, then it is nothing to do with SDA/SCL, LCD or VBat. Either you have a defective DS1307, or a bad 32kHz Xtal (most likely), or you have additional Capacitance on that xtal that shouldn't be there... however to slow it down that much, I wouldn't think any Capacitance would pull it that slow.

    Rip apart a cheap Digital watch, steal the xtal, it should work with the DS1307. Even an xtal cut with the wrong Capacitance will work, though it keeps rubbish time (ie could be out by as much as 30 minutes in a year).

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink The Jackpot ...

    Quote Originally Posted by Melanie View Post
    Rip apart a cheap Digital watch, steal the xtal, it should work with the DS1307. Even an xtal cut with the wrong Capacitance will work, though it keeps rubbish time (ie could be out by as much as 30 minutes in a year).

    Hi, Mel

    I have a LOT of xtals from Watches and timers ( most unmarked, ... of course ) ... most work on 3.27 ... MHz and some are really "exotics" ...

    Without any verifying possibilities it's a bit ... risky.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

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


    Did you find this post helpful? Yes | No

    Default

    3.27MHz... for a timekeeping source??? Surely you mean 32.768kHz... as long as it's a rock of that frequncy, the DS1307 will drive it... but accuracy will depend on how close it is to the 'ideal' 12.5pF that the DS1307 is designed for. But slowing down to 1/6th of normal speed is abnormal.

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    If there was a large capacitance I bet it would stop completely. Let's see some schematic along with the "sample" code.

    Then we will be stopping guesses...

    Ioannis

  6. #6
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    Finally I find where was the problem

    The time was too slow beacause of the 5v power.It was the PICKIT2 which power my pcb (it has this function)...and when I use psu 5vdc all was ok.

    Does enyone has any idea why this happend???


    By the way thanks to all.
    Nikos

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Not enough amps from the PICKIT2??
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  2. PIC18F4525 & LCD simple code problem
    By aggie007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd November 2007, 16:29
  3. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  4. Servo Code problem
    By ALFRED in forum General
    Replies: 1
    Last Post: - 2nd March 2006, 03:30
  5. Sample code for ML2036 DDS
    By Tim in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 7th February 2004, 02:08

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