Clock Question

if you create a text file containing just a carriage return (test.txt in my example) then at the dos prompt: time < test.txt > test2.txt puts: Current time is 7:23:20.08p Enter new time: into test2.txt, so time < test.txt >com1 should output the time as ascii to the serial port.

If I have time later I might test with 2 pcs, a cable and hyperterminal.

--
Chris
-----
Spamtrap in force: to email replace 127.0.0.1 with blueyonder.co.uk
Reply to
Chris Hodges
Loading thread data ...

Hang your monitor on the wall, and go to this web page:

formatting link

Reply to
John Swenson

Chris,

Writing the time to the serial port is not the problem. You need some kind of scheduling unless you want to synchronise your clock manualy every time. Running Linux it's easy. Can be done by a three or four line script starting a background process. Windows has its own scheduler(s) although I can't imagine a simple script to run it a the moment. As DOS lacks multi tasking, writing a scheduler is not that easy. It nervertheless can be done if you make it a device driver or another resident program. Unless you're running Linux it's much easier to do the scheduling by the clock itself. Make it send a kind of a signal to the computer using the serial port. This signal activates an interrupt routine that replies by sending the system time.

petrus

--
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 27-1-2004
Reply to
petrus bitbyter

...

Make a cron job that outputs the time 12.00pm (midnight) every sunday:

crontab -e

  • * * * 0 date > /dev/ttyS0

"date" can put out many formats, so you can suit it to the format parser in the clock.

Reply to
Russell Shaw

Get a WWVB clock. Radio Shack, among many, sell them. You can get them for $25 to $80 depending on options. The WWVB clock probably has better accuracy than SNTP, especially if your using XP (XP has big problems with SNTP).

formatting link

If you really want to get silly, you can find these GPS synchronized HP boxes (e.g. model Z3801)on Ebay. They provide an accurate 10 MHz reference (less than a ppb) and very accurate time. Require a few days to settle in.

formatting link

Mark

Reply to
qrk

Use preset counters to store the time. Then every 24 hours have your computer send a single bit to trigger a reset of the counters. Works best if you do a reset a 23:59:59 hrs . Details of the clock flipflop/counter network not available at printing. ;)

Charles

Reply to
Charles W. Johnson Jr.

Use NTP to sync them together. Free, simple, built into the OS.

Set up one of the machines as the NTP master. Use one of the several available utilities to sync it to WWV via RF, dialup, or internet. Still free (assuming internet connectivity.)

Reply to
Richard Crowley

Good idea. I strongly think it will work.

--
Best Regards,
Mike
Reply to
Active8

To illustrate your obsession outside the lab, you need your own "atomic clock wristwatch":

formatting link

This is the Real Deal, not a wimpy WWVB watch!

Tim.

Reply to
Tim Shoppa

I've gotten this brand of logic from many people over the years, Jim. Don't listen. My first self-setting clock was the Heathkit Most Accurate Clock, a-way back in the 80's. Most people who saw it were not impressed: "Whaddya need that kind of accuracy for??" was the usual response. Well, I confess I _am_ a clock bigot - have been since my time in the A.F. back in the 60's when I was responsible for our H.P. cesium beam-driven world time clock - but I didn't get the Heath clock because of a necessity for split second accuracy. I got it because it was cool.

After studying the Heath clock's schema for upteen months I decided I could do it better and cheaper. I had to learn microcontrollers first, chose the Z80B because it was readily available, cheap, and a freeware assembler was available. That whetted my appetite, set me to learning an ancient Motorola NMOS chip. And that's what I used for my clock. I built it in 1994 and it's been running ever since.

No, we don't need split-second accuracy. That comes as gravy from a box that doesn't need resetting even when the bad ol' spring-ahead-fall-back disruptions occur. That's what I love, not having to reset my clocks several times/year simply because some doofus decided that the sun gets out of whack WRT the correct - read "human" - biorhythm.

Reply to
Michael

Tom Gross wrote: (snip)

WWV? Or should that have been "WWVB"?

Reply to
Michael

I've said several times, "This is for fun and pizzazz".

Of course one thing that will NEVER happen is that I would own an Impala... sheeeeesh, that's a GM product... I've haven't owned an American automobile since 1977 when I gave up on Ford ;-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

yes, I will have to set up one of the XP Pro machines as a master time server. I can't rely on any of my machines actually being connected to the web (in this application) but it's really not that important to me, as long as they think it's the same time down to about a second.

Apparently the two homebrewed machines I have with ASUS motherboards are consistently running too fast, gaining about 15 seconds per hour.

Reply to
Tom Gross

With all the "Buy American" hoopla currently extant, it would be interesting to poll how many American engineers drive American cars. I haven't owned one in decades.

Bob

Reply to
Bob Stephens

That's certainly true, I was only really replying to the specifics of DOS output. Personally as I start the pc every day I would probably just put it in the autoexec to sync once per day, or use 98's task scheduler to call a batch file. Messy though. My other approach would be to write something in Delphi (or possibly Visual C for the challenge) that would work as you suggest.

My linux skills are a long way short of scripting this sort of thing!

--
Chris
-----
Spamtrap in force: to email replace 127.0.0.1 with blueyonder.co.uk
Reply to
Chris Hodges

Or you could do the following command (at least it works on my Win98 and XP machines):

echo. |time

That's the pipe character before time, and don't leave out the period. It pipes the carriage return produced by the "echo." command into the time command.

Reply to
Carl D. Smith

Set up a job in Scheduled Tasks (the task GET_TIME executes TIME_IS.BAT hourly).

Carl D. Smith

:: TIME_IS.BAT writes the current time to the serial port. @echo. | TIME | FIND "is" > COM1: (One executable line; auto-deletes the temp file.)

Reply to
JeffM

I think that's what I was looking for when I set out to refresh myu mind on redirection! Thanks for the reminder Carl.

--
Chris
-----
Spamtrap in force: to email replace 127.0.0.1 with blueyonder.co.uk
Reply to
Chris Hodges

Reply to
K Wannamaker

That's a shameful photo - there's some clear space which could be usefully filled! :-)

Ken

Reply to
Ken Taylor

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.