Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

OK, let me "PIC" your brain...

Status
Not open for further replies.
Could these so-called wonder chips (PICS) be used to generate a time-base (clock signal) of 10.0273790935 seconds? And, yes, I would need it to that level of accuracy. I've been told that this frequency is about the lowest crystal frequency that I could get. And it would have to be a custom fab at that. I really need it divided by 10, but that's not a problem. So, who's got a good place to start looking for info on PICS? And please, don't try to sell me something....until I know some of the basics, I can't justify the expense. As usual, thanks very much for the feedback. <ckd>
 
That's an accuracy of at more than 500ps...which would mean that a PIC doing clock division would need to run faster than 2GHz...which they do not.

What's this for anways?
 
Last edited:
Look at Roman's web site. His method is sort of the inverse of what you are trying to do.

Seems as though you will have to build a PLL, where the reference side comes from an atomic standard, or from GPS.
 
The PIC is not the problem ( or the solution) , it is the time base ( usually a crystal ) this is the part you need to focus on. Google should tell you lots, or I know this guy had a video on very accurate time bases: Electronics Engineering Video Blog Podcast Solutions include temperature stabalized crystals and other tricks. This is an odd requirement, seems it might be for a GPS, but they get their time from the statalites. And often that is the right way to get good time, get it from someone else. ( sorry for the spelling )
 
Good luck achieving million dollar accuracy with a five dollar chip. And when you think you've succeeded, how will you prove it?
 
Good luck achieving million dollar accuracy with a five dollar chip. And when you think you've succeeded, how will you prove it?

Good point. He needs 1 ppb accuracy. Normal electronic circuits cannot do this. Crystals rarely do better than 1ppm
 
A few more clarifications: First the 10.0273790935 number is the length between clock pulses in standard seconds; I divide it by 10 and get 1.00273790935 seconds of SOLAR time. This is equivalent to 1 second of SIDEREAL time. Thus a sidereal clock runs just a hair faster than a standard time clock. So, when a sidereal clock reaches a full 24 hours, only 23 hours, 56 minutes, and 4.1 seconds of solar time have elapsed. This extra 3 minutes, 56 seconds is why we have February 29th every four years. Notice how the sun rises just a little earlier every morning lately? Well, so do the stars. For instance, I go out in my back yard, see a beautiful star juxtaposed between a couple of mountains. I want a photo, so the next night I set up my camera and the star's not there. Without compensating for the difference between solar time and sidereal time, I missed it. It moved on 3 minutes and 56 seconds earlier.

Well, I've been told that the lowest crystal frequency that I could get with this frequency is 10.0273790935 MHz. Please notice the "MHz" there. Using a 10 Meg + crystal requires 6 stages of division. I wouldn't mind that except for the creeping error that I KNOW I would get. And that's what I need to solve. If I can get the clock frequency I need, the rest of the circuit is easy.

As far as Reader "mneary" asks "How will I prove it? Simple, I take that same camera, tripod, and azimuthal motor-drive, point it at the star when I see it, and lock it down. The next night, 3 minutes, 56 seconds earlier, I look through the camera and there it is. I do this every night (clear weather permitting) for a few weeks, months, years, whatever, and if I see the same star through the camera, I'd say that's proof enough.

I'm sorry if this comes off as being pompous or asinine, but I like astrophotography and just plain stargazing.

Any help or ideas are most welcome. Thank you all. Peace. <ckd>
 
I see what you're doing. Dividing by N is easy, but dividing by N.(x/x+y) (fractional N) is only slightly harder. You just divide by N+1 for x overflows and divide by N for y operations.

Example: If you want to divide by 10,000,000.667 you can divide by 10,000,001 twice then by 10,000,000 once. You can make any fraction.

Actually keeping track of where the factor needs to be changed between N and N+1 is done easily with a trick called a "phase accumulator". In "Direct Digital Synthesis", a chip can produce extremely accurate outputs from a base clock that's not too far from the output frequency. I suggest Analog Devices DDS chip app notes for the theory on this. Maybe you could even program a DDS chip to do everything you want and just use the PIC for housekeeping.

Oh, and the sun rising at a different time each day is due to the earth's axis tilt.
 
But just a caution: If someone is trying to sell you a 10.0273790935 MHz crystal for less than a million dollars they are lying. That's accurate to better than one part per billion which just isn't reasonable at the hobby/consumer level. I would almost believe a 10.027379 MHz crystal... but it would have to be temperature stabilized with an integral oscillator, also temperature controlled.
 
Yes, Earth's axial tilt has some significance here. But, as we (Earth) move around the sun, we also move forward (westward) AROUND the sun. Because Earth's rotational period (relative to the vernal equinox) is actually 23 hours, 56 minutes, 4.1 seconds, it has to spin just a little farther around it's own axis to make up for that difference, i.e. the same star.

Again, check this link: Sidereal time - Wikipedia, the free encyclopedia

Do you know of a good tutorial on your math division thing? I'm just an old radio guy and some of the math escapes me.

Thanks. <ckd>
 
If I recall correctly, the best tutorial on this math division is in the app notes for the AD9850 series chips. If you can't find a good explanation before then, maybe I'll ransack my library on Saturday.

I really should have gone to bed many hours ago.. the sun will rise much too soon whether solar, lunar, or sidereal.
 
Last edited:
LOL! If that "sun" is "lunar", you're on the wrong planet! Thanks for the tip.
 
Wait a minute. Did Captain Kirk have a dog?
 
The only way you will see the uncertainty you are looking for would be an atomic clock. They do tend to get a little pricey though. The next option for time measurement is a GPS receiver tracking several satellites at once but not to tell you where you are on the face of the planet.

All GPS satellites have an onboard atomic clock (time standard) and trasnsmit time and frequency information, systems like this are used to get very accurate frequency information. There are others but we happen to use Spectracom at work. These systems get you the < ± 1 x 10-12 uncertainty you are looking for.

Even using a receiver for accurate frequency has a cost and that cost well exceeds what the average hobbiest can afford.

Ron

I thought Captain Kirk's dog was a dog named Spock?
 
Given your application you can get away will a less accurate clock (1ppm) provided you can resync to a Cesium clock at frequent intervals. Such clocks exist on the internet and with GPS. I do not know if you can sync with sufficient precison given communication latency.

The distinction between siderial and ordinary solar time arises from simple geometry. The earth goes around the sun in the same direction as its rotation. The sideral day is the 'true' rotation relative to the distant stars. Earth orbit 'cancels' one day from solar time per year. This is simple geometry and has nothing to due with the axis tilt or anything else. Of course other factors effect short term fluctuation and long term drift.

Leap year arises from the fact that the the earth orbits the sun in 365.25 solar days. We have to account for the extra 1/4 day in the calendar. Julius Caesar decreed the 365 day calendar to replace less sphosticated lunar calendars. His astronomers were not aware of the xtra 1/4.

In the middle ages Pope Gregory came out with a new more accurate calendar which included leap years. Europe was slow to adopt Gregory's invention. When England adopted the new calendar about 1700, people rioted in the streets. They accused the king ministers of 'stealing' 11 days from them :)
 
If you can tolerate 50-usecs or so of 'jitter' on the 'sidereal' millisecond output pulses and typical crystal accuracy and drift of about 1 second per month then you could use something as simple as the 24-bit phase accumulator driver below. If you're just driving a "sidereal" clock display you'll never notice the ±50 usec jitter on the "sidereal" millisecond pulses and you could reset the clock once per week or so to account for drift.

Regards, Mike

Code:
//
//  K8LH 1002.738-Hz (0.9972695 msec) pulse generator will
//  generate 86,400,000 'sidereal' msec pulses in the span
//  of 86,164.1 seconds (approx ±50-usec pulse "jitter")
//
void interrupt()            // Fs = 49-usecs
{ pir1.TMR2IF = 0;          // clear timer 2 interrupt flag
  phase += 824334;          // add phase offset
  if(phase.23)              // if hi portion of cycle
    gpio.2 = 1;             // set pulse output pin hi
  else                      // else
    gpio.2 = 0;             // set pulse output pin lo
}
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top