Shop OBEX P1 Docs P2 Docs Learn Events
Using the propeller to Clock other Chips — Parallax Forums

Using the propeller to Clock other Chips

rwgast_logicdesignrwgast_logicdesign Posts: 1,464
edited 2012-09-24 09:17 in Propeller 1
So I was listening to the counter episode of first spin today and Roy said the propeller can generate frequincies up to 125mhz or so using counters with a PLL, thats pretty impressive..

Anyways I was thinking about this and wondering when you use a propeller to generate a clock line is it as accurate as the crystal in the propellers PLL circuit? So for example I saw this being done in the TCP driver for the enc28j ethernet chip, Harrison Pham did an option in his driver to drive the ethernet chip with a prop line instead of a crystal with a 25mHz clock.

So I was thinking about doing this to drive a few chips I dont have crystals on hand for namely other microcontrollers or real-time clocks, both of these are fairly time important. So if im sending a 16mhz clock to an AVR chip using a propeller whos PLL is driven from a 30ppm crystal can I count on the AVRs clock being fairly close to 30ppm?

Im really intrested in doing this to test out and write drivers for a varity of Real Time Clocks, now I know these have to be fairly accurate and if I were to build something using a ds1302 or 1307 Id definately pick up the right crystal with nothing higher than 20ppm but just for testing and playing around writing drivers could a prop send out a 32.768khz clock at 30ppm?

Comments

  • jmgjmg Posts: 15,183
    edited 2012-09-23 05:05
    .. but just for testing and playing around writing drivers could a prop send out a 32.768khz clock at 30ppm?

    Sure. It just depends on what jitter you can tolerant.
    A precise divide would be 80e6/32768 = 2441.40625, (which is 13/32 as a fraction) but the NCO adds, so you get

    80e6/(2^32/round(2^32/2441.40625)) = 32768.0073678493, which is 0.22484ppm high, so easily trim-able.
    The actual frequency will be a combination of periods of
    30.5250068635us and 30.512506860702 us (ie 12.5ns difference)
    with an AVERAGE value of 32768.00Hz.
  • rwgast_logicdesignrwgast_logicdesign Posts: 1,464
    edited 2012-09-23 18:18
    ok so now that i know tgis can be done i guess now its time to figure out the details.

    so for now the application would be to use a propeller on a custom pcb to provide programmed clock sources to chips, i guess if inclined i could do up to 16 with hardware counters.

    anyways i would want to use the best clock source i could preeferably a 10x or 12mhz 20ppm or under source. you said i could trim off the extra ppm how would this be accomplished a trimming cap? how do you acually measure ppm?

    as far as pll jitter i looked into it to research it. most pappers talk about audio though. i do know that using a pll of 8x is suppose to help the props jitter. what else could i do to minimize jitter?

    im not even sure what jitter is.. if i understand right its when the chip skips a clock cycle? so how would useing a jittry clock source effect the ic your driving?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-09-23 18:52
    Most ICs will not be affected by clock jitter. Where it's most acute, and where it thus disqualifies the Prop as a signal source, is in RF generation designed for wireless propagation. This is because the jitter produces spurious sidebands that cannot be eliminated by filtering.

    -Phil
  • eldonb46eldonb46 Posts: 70
    edited 2012-09-23 18:53
    Im really intrested in doing this to test out and write drivers for a varity of Real Time Clocks, now I know these have to be fairly accurate and if I were to build something using a ds1302 or 1307 Id definately pick up the right crystal with nothing higher than 20ppm but just for testing and playing around writing drivers could a prop send out a 32.768khz clock at 30ppm?

    Here is some of my Prop TCVCXO Projects. I am using a 10MHz TCVCXO which is easy to setup and tune, either by hand, or by comparing it to a GPS receiver.

    http://wa0uwh.blogspot.com/search/label/TCVCXO

    and go here for general Prop Projects,

    http://wa0uwh.blogspot.com/search/label/Propeller

    The details are a little sketchy, but maybe you will find something that will help with your project.

    Eldon
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-09-23 19:33
    Hi rwgast_logicdesign;
    how do you actually measure ppm?
    The easiest way is to use a frequency counter with an internal frequency reference that has at least 10 times better ppm rating than what you are measuring.

    I use a nice HP frequency counter with a quality oven controlled reference. These are not to expensive on ebay.

    Sometimes when I need really good measurements I use an external 10Mhz reference on my counter. The best us mortals can get are Rubidium atomic standards. Search ebay for the FE-5680A. These are really good and not to expensive, generally less than $100us.
    You should get at least 2 parts in 10^-9 or .002ppm or so.

    Here is an article on how to use it:
    precise reference frequency

    And a program to operate it that I wrote:
    FE5680A.zip

    What accuracy in ppm do you need.

    Duane J
  • jmgjmg Posts: 15,183
    edited 2012-09-23 19:38
    anyways i would want to use the best clock source i could preeferably a 10x or 12mhz 20ppm or under source. you said i could trim off the extra ppm how would this be accomplished a trimming cap?

    Yes, with a crystal, usually a trim-cap, or if you have a VCXO/VCTCXO via a trim-pot on the Vc pin.
    how do you acually measure ppm?
    That can get complicated very quickly. :)
    Usually you buy the ppm, in the form of a Good Oscillator, or use a GPS 1pps

    I have a short list here, of some 'Good Oscillator' price points

    535-9702-1-ND 1 $5.89 ASVTX-09-20.000MHZ-T VCTCXO 20.000MHZ 3V SMD
    (5.00mm x 3.20mm) - 0.5ppm with Vtrim too.

    ASFLMB-10.000MHZ-LY-T $3.11 10ppm

    Note they tend to move up in frequency as size drives the biggest customers of these, so an external divider may be needed to shift into Prop Range.

    im not even sure what jitter is.. if i understand right its when the chip skips a clock cycle? so how would useing a jittry clock source effect the ic your driving?

    jitter is just the difference from where an ideal edge should be, and where it really is.
    In the example above, you will average 32768Hz, but any single edge might be 12.5ns from ideal

    It is hard to imagine a RTC application where that 12.5ns would matter - the average matters far more...
  • ManAtWorkManAtWork Posts: 2,178
    edited 2012-09-24 07:22
    jmg wrote: »
    In the example above, you will average 32768Hz, but any single edge might be 12.5ns from ideal

    I don't think so. If any edge could be +/-12.5ns off then it would be completely impossible to generate a 125MHz signal at all. I guess depending on the division ratio there will be more or less jitter but it should be much less than 12.5ns in most cases. But agreed, for an RTC only long term stability matters.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-09-24 09:17
    For NCO output, the edges will be off +/- 12.5ns. For PLL output, the jitter from the NCO driving the PLL will still be +/- 12.5 ns, but the output jitter can be much less, due to the VCO filtering. By using an external PLL with a longer time VCO filter time constant, the jitter can be almost eliminated.

    -Phil
Sign In or Register to comment.