RTC date problem


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    10

    Default RTC date problem

    Hi, I am working with a PCF 8583 real time clock. I can read and write to the device correctly, but as soon as the time changes to 00:00:00, the day and month gets incremented by the RTC automatically. I have tried changing the RTC, but the same thing happens.

    Can anyone help me?

    Thanks

  2. #2
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Are you sure you are masking off the unused bits in the month and date registers while reading/writing?

    You can expect bizarre things if you are simply reading (or writingto) the whole register(s).

    Regards,

    Anand

  3. #3
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Yes, I have masked it ( I2CWrite DPIN,CPIN, RTC,$00,[ $09 ] ).

    Could it be because I'm reading the RTC every second, it is confuses the RTC when it wants to update the date the same time as I'm trying to read it?

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi Peder,

    I dont think reading the chip every second should be an issue; I have used a PCF 8563 in a propeller clock that gets polled far more frequently, and there is no problem.

    I am attaching a snippet using PBP with the PCF8583 that I had downloaded some time ago; this might lead you in the right direction.

    Regards,

    Anand
    Attached Images Attached Images  

  5. #5
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thanks man, by checking your code and comparing it to mine, I realised that I made my "DAY" variable WORD instead of BYTE. It works perfectly now...

    Thank you for your help and time.

    Cheers

  6. #6
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi ardhuru,

    Would it be possible for you to post the rest of the code for the RTC including time setting? I think many people on this forum would be interested as there have been some posts requesting specifically this chip.

    Thank you very much!

    BobK

Similar Threads

  1. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  2. PIC 16F877 I2C communications
    By sigmoideng in forum General
    Replies: 7
    Last Post: - 13th July 2007, 10:28
  3. 8583 rtc date problem
    By crazyhellos in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th February 2007, 15:28
  4. X1226 RTC - Help
    By charudatt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2006, 17:54
  5. RTC Problem
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th March 2006, 05:13

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