Matching time conditions


Closed Thread
Results 1 to 40 of 49

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Alain, another module to add to my collection....

    Don't tell the wife I'm spending more money on this project

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Alain,

    Quick question, I take it this new module will still work with the same code for the DS1307, ie

    Code:
    I2CRead SDApin,SCLpin,$D0,$00,[RTCSec,RTCMin,RTCHour,RTCWDay,RTCDay,RTCMonth,RTCYear,RTCCtrl]
    Incidentally, can someone break down that line. I understand it's the code to read the I2C channel, data pin, clock pin, and then the current value for each of the time / date fragments, but in what format is the raw code. It mentions BCD ?

    Also, do you have to read [RTCSec,RTCMin,RTCHour,RTCWDay,RTCDay,RTCMonth,RTCY ear,RTCCtrl] in one hit, or could you choose to read back just the hours and mins ?

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


    Did you find this post helpful? Yes | No

    Default

    DATASHEET!!!!

    Just as you wouldn't have a clue what CMCON was for a PIC that you never met before, in the same way you need to know what Registers you've got inside your DS1307, in what sequence you arrive at them, and what their contents are.

    Download the DATASHEET for the DS1307.

    You will follow the SAME proceedure for ANY complex chip (or device) that you come across. Copying and relying on other peoples code is insufficient. It's worse than trying to decypher Egyptian without the Rosetta stone.

    And in answer to your question, you can choose to read back whatever you want in whatever sequence you want (though not nescessarilly in one I2C instruction)... the DATASHEET will explain how and reveal other Registers, features and goodies which you may be unaware of, and which the code you are copying from does not take advantage of.

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