PDA

View Full Version : chronometer



nicolasronan
- 16th June 2006, 18:43
hello
how do a simple clock and a chronometer?
thanks

BobK
- 16th June 2006, 21:21
Hi!

Huh? What do you want? Could you please be a little more explicit in your request?

BobK

nicolasronan
- 16th June 2006, 21:50
i would like a display with a clock and a chronometer (stop watch), with intermediate time display but stop-watch always moving.

BobK
- 17th June 2006, 12:48
Hi nicolasronan,

Just for starters, perhaps what may work from a simplistic mode would be to take Darrel Taylor's ELAPSED TIMER program and merge it with a Real Time Clock chip. Since I have been working with RTC's latley that's the first thing that comes to my mind. Perhaps over the next few days some of this forum's gurus might come up with a different solution. But I think this might be an easy way to get started. You could use the SQW ouput of the RTC to increment a counter on the PIC then say every 60 "ticks" (60 Seconds) read the RTC and display the time while continuing with the elapsed timer program. The elapsed timer program is interrupt based so you have to be careful of how much time you spend servicing the RTC read and display portions of the program. Also look at Paul Borgmeire's EASY CLOCK programs. They are very easy to follow and maybe the answer to what you are looking for.

I suggest you search this forum under the CODE EXAMPLES section for further information. Believe me, there's a wealth of information on this site!!!

BobK

paul borgmeier
- 17th June 2006, 14:54
As Bob mentioned, I posted some short code examples that automatically keeps time - the first of the two updates an lcd display. It works best for long term accuracy. If you do not need more that long term second to second accuracy, they might just work. The first program given keeps time in hh:MM format. The second in HH:MM:SS format. You could easily add the :SS to the first program and add your stopwatch timer function in the section marked “Do something here.”

These program are here http://www.picbasic.co.uk/forum/forumdisplay.php?f=11

Take a look. Also worth mentioning is Melanie's “Olympic Timer,” which is in the example code section of this forum as well.

Good Luck,

Paul Borgmeier
Salt Lake City, Utah
USA

nicolasronan
- 17th June 2006, 15:09
thanks for your help
i have test this code of melanie for a clock and it s ok
and i test too olypic timer it s ok too.
thanks melanie

now i do a mixt this two file.

nicolasronan
- 18th June 2006, 14:56
hello
i 've work the code and it s ok on my easypic3 (board test).
but the real time is bad. when i use the stopwath, the clock stop a small time.
i use a pic 16F877A at 8Mhz.
can you help me?
too i don't know how take some partial time on (for) the stopwatch;
an idea?
thanks

nicolasronan
- 19th June 2006, 09:02
up
help please and sorry for my english

paul borgmeier
- 19th June 2006, 09:05
What kind of time tracking and accuracy are you after? (e.g., 10ths of Seconds, Seconds, Minutes, Hours, etc.)

Paul Borgmeier
Salt Lake City, Utah
USA

nicolasronan
- 19th June 2006, 09:11
for 15min realtime, clock it s 13 min

Melanie
- 19th June 2006, 13:19
The original Olympic Timer has a Calibration Value that you could adjust.

The Clock code I posted primarily as an example of One Button usage did not, though there was provision for it.

Add in a Calibration value and you are in business.