Timer in real time


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    There's a bunch of other idea that spring to mind. Is the unit will be battery powered or AC powered?

    If it's AC powered, i would prefer to use the AC as timebase, use an internal timer interrupt to get the 1 Second or 1 minute. Once in the interrupt do the math and check for Alarm or Events.

    BUT you can do it with the internal Tick FOSC/4, in this case use one of the lower Crystal frequency... let's say 4 MHZ => internal = 1MHZ => ticks every 1 uSec => internal timer interrupt every 1000 counts to have a time base of 1 Sec => you need a 16 bits Timer.

    Wich PIC Marc will use ???

    Process is almost the same than with an RTC but you'll have to deal with a bunch of more code line to take care of the days of week/month/year/Leap Year/hours/minutes... BLAH BLAH BLAH, tsé veux dire !!!

    NOT impossible, a bit tricky, i agree.

    What the unit will also do?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    martarse's Avatar
    martarse Guest


    Did you find this post helpful? Yes | No

    Default

    HEllo

    Marc make an automatic food system for Deer hunting. It's a little contract that ones of his neighboor ask for.

    Marc use a 16F84A-4MHz. Unit will be DC powered.

    He will get back to me soon. He actualy looking at some tricks mentionned here.

    I Will let you know how is going with his tests.

    thanks again!

    Martin et Marc

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Martin & Marc,

    I just posted in the “Code Examples” area two examples of how to create easy clocks that track time in an HH:MM format. The examples do not require Real Time Clock (RTC) ICs and are based on 4MHz Crystals. They are highly accurate at < 2 sec /day error with a standard 4.000MHz crystal (with +/- 20ppm tolerance.)

    Both examples use TMRO with prescalers set to 256. This method requires only about 30 lines of code to maintain accurate time.

    The programs are named EZClock1.bas and EZClock2.bas. These files are mostly comment - the code is at the end.

    Maybe these can help your friend -

    Good Luck,
    Paul Borgmeier
    Salt Lake City, Utah
    www.cruxanalysis.com

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 the right way?
    By Michael in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st March 2007, 18:38
  4. Real time clock... what a headache!
    By Eng4444 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 8th June 2006, 21:56
  5. please read it ( real time)
    By moud_man in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th September 2005, 14:38

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