DS1994 i-Button Real Time Clock


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Location
    Santiago, Chile
    Posts
    77


    Did you find this post helpful? Yes | No

    Default Real Time Clock

    Melanie,

    I don't think I need Muslim prayers.
    I agree, I don't think I really need such high accuracy (about a day in 6 months is OK)
    Do you think I can get that using the PAUSE or the TIMER?

    Regards
    Chris

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


    Did you find this post helpful? Yes | No

    Default

    Well, the way I did it was quite simple.

    First, I wrote the program for what the PIC had to do. For the timekeeping part it kept a tally of SECONDS in a variable, and every hour it would increment a BYTE in EEPROM. Every 24 HOURS it would reset the EEPROM HOURS counter and increment an EEPROM DAYS counter (which actually was two bytes - a WORD). Now, back in 2003/4, the EEPROM endurance was 100,000 writes... so I calculated that was about eleven years worth of hours, way more than I needed.

    Now my calibration was simple... my program loop was calculated to execute every 250mS. I simply set an I/O to toggle a LED at each HOURS write, and I simply compared it against my wrist-watch. First time, I was out by about 50 Seconds... so by adjusting my PAUSE value I eventually got it +/-5 seconds in an hour which was fine. I could have added a PAUSEUS and trimmed it even further, but I couldn't be bothered.

    The reasoning was a couple of minutes a day was only 12 hours a year... my program started to blink a 'Service Due' LED, and if the Customer didn't respond, it would shut the equipment down two weeks after that (for Safety reasons of course!). The original device used a 16F84 and a 4MHz Resonator and was as crude as you could get - but it worked a treat!

    To RESET (for the next time period), you had to hold one of the I/O's low for 20 seconds, then the LED would turn ON for 1 second only, at which point you had to release the I/O. If you didn't wait long enough, it wouldn't reset, and if you waited too long it wouldn't reset either... simple, but effective if you don't know what to do and prevents tampering.

    Now in your case I would have a RESET Button that could be used only ONCE. If the machine shuts-down and they call you, tell them to press the RESET Button which would give them 14 days grace. During that time they have to straighten-out their account with you which will entitle them to a free replacement PCB.

  3. #3
    Join Date
    Apr 2007
    Location
    Santiago, Chile
    Posts
    77


    Did you find this post helpful? Yes | No

    Smile Clock timeout

    I like your style,

    Keep it simple and functional. I think I am going to do it exactly as you say except I think to control the device I will include a iButton eeprom with a code on it which will come with the installation and another with another code telling the pic to just keep output on.
    Have you any code on reading and writing to iButton EEPROM? else I will just plough through the datasheet and work it out the long way.

    Thanks & best regards

    Chris

  4. #4
    praveedca's Avatar
    praveedca Guest


    Did you find this post helpful? Yes | No

    Default

    Hi to all I thought maybe a good solution is a small PIC, a iButton eeprom with a code with a date and another that just keeps the output on with a small realtime clock inside which I can set before sending the switchboard off. (maybe a DS1302) I will still have the ibutton exchange system but without having to set the DS1994 .

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~

Similar Threads

  1. Real Time Clock
    By in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 2nd June 2012, 04:52
  2. Real time clock ICs
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 66
    Last Post: - 20th October 2008, 16:05
  3. Real time clock... what a headache!
    By Eng4444 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 8th June 2006, 21:56
  4. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  5. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43

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