CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Talking to a clock?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

Talking to a clock?
PostPosted: Thu May 22, 2008 6:50 am     Reply with quote

Hi, I have a funny project going on..
I would like to syncronize a crystal/electrical clock and a PIC, or a RTC and a real clock? iow an analog clock to a PIC.
Is there any clocks that have some sort of an output?
usually normal clocks works with the power frequency 50/60Hz? and just makes a stepper motor go around.
But I would like to have a clock that outputs something to work with in a PIC, or even rather an analog clock that can be adjusted by a PIC and a RTC?
Do you know something out there?

Thanks/Tagge
KU5D



Joined: 10 Feb 2008
Posts: 46
Location: Asheville, North Carolina

View user's profile Send private message

PostPosted: Thu May 22, 2008 5:12 pm     Reply with quote

What's the application? Are you trying to clock the PIC externally or are you just needing an occasional reminder of the real time? How accurate does it have to be and is that accuracy needed in a UTC / real time fashion or are you just looking for a clock signal with high accuracy? There are a few ways...

1. Get a frequency standard. Typical output is 10 MHz. I've used these in simulcast radio networks where all the transmitters need to stay on the same frequency +/- x Hz. Downside: they're not cheap.

2. If you can live with simply being reminded of what time it is, a GPS receiver will give you UTC time once a second or so. It comes in a string that you have to parse, but the time is accurate. You also have to be able to see the sky.

3. There are various RTC chips that you can find, but they depend on crystals and do have their limitations. Again, it depends on the accuracy you require.

4. Aside from that if you just need a stable clock for the PIC, get a good stable crystal.
_________________
Confidence is the feeling you have right before you fully understand the situation...
Guest








PostPosted: Fri May 23, 2008 6:04 am     Reply with quote

KU5D,

Based on the content of your reply, you must be fully confident Very Happy !

73!

The Phantom
Tagge



Joined: 23 Aug 2005
Posts: 93

View user's profile Send private message Visit poster's website

PostPosted: Mon May 26, 2008 9:28 am     Reply with quote

Hi, and thanks, no, I need to syncronize an ordinary clock with a PIC, that the clock and the PIC have the same real time. The issue is to drive a ordinary clock from a PIC application, or vice versa.. I dont know if I make my self very clear here Confused
I would need the analog clock to show the same time as internally in the PIC. And the PIC real time comes thrue a RTC IC.
What do you folks think about that?
/Tagge
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: Talking to a clock?
PostPosted: Mon May 26, 2008 9:50 am     Reply with quote

On one hand you asked for an output from an ordinary clock, apparently so you can lock your PIC time to it. But then you said the PIC real time comes through a RTC IC, implying that the RTC is the master and you would want to lock the clock to it. I'm still not sure what you are asking for.

You mention an "ordinary clock". The meaning of that has changed over the years. It used to be that an ordinary clock meant a synchonous AC motor locked to the mains frequency. Recently, most "ordinary clocks" are based on a free-running quartz oscillator that drives a digital display, or generates step pulses to drive a mechanical display. In either case, the clocks are no longer locked to the AC mains.

Assuming that you are talking about modern clocks with a quartz timebase, usually 32.768 kHz, then you will have to dig into the electronics of the ordinary clock and try to either find a place where you can pick up the clock's 32.786 kHz signal to form a timebase for the PIC, or find a place where you can inject a 32.786 kHz signal synthesized by th PIC to take the place of the clock's crystal timebase. The solution will be custom depending on the specific clock design. This will allow you to maintain a synchronization between the two devices, but it will not allow you acquire the initial synchronization. That may have to be done manually. Then once the synchonization is established, the shared 32.786 kHz timebase will maintain it.

If you want to make the initial synchronization automatic, then you will have to get more creative. If the display is an LCD or LED display, you might be able to tap the driver lines to those display devices to "read" the time being displayed by the clock. Or, you could use a few optical sensors to read the actual display. If you can tolerate a very long lock-in time, you might be able to do something with the total light level on each digit without resorting to true image processing. The sequence of total light levels for digits 0-9 in sequence can be used to unambiguously determine what digit is being displayed after a while. But none of these methods are easy.

Robert Scott
Real-Time Specialties
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group