Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #377128

Re: Software Controlled Crystal Oscillator

From Martin Brown <|||newspam|||@nezumi.demon.co.uk>
Newsgroups sci.electronics.design
Subject Re: Software Controlled Crystal Oscillator
Date 2015-09-16 08:47 +0100
Organization Aioe.org NNTP Server
Message-ID <mtb6q4$s8h$1@speranza.aioe.org> (permalink)
References (2 earlier) <mt8lbm$94h$1@speranza.aioe.org> <GuudnbjIJpn202XInZ2dnUVZ5sQAAAAA@giganews.com> <mt9pvo$71g$1@dont-email.me> <mt9tll$e66$1@speranza.aioe.org> <mtarm3$isi$1@dont-email.me>

Show all headers | View raw


On 16/09/2015 05:39, rickman wrote:
> On 9/15/2015 4:05 PM, Martin Brown wrote:

>> You are basically stuck with the resolution granularity of your timing
>> loops but you can create a pseudo delay that differs by one cycle
>> depending on the bit state of a free running counter (assuming here you
>> have test bit and branch instructions). Every Nth loop with N carefully
>> chosen you add in an extra cycle delay to make the pulse hit the right
>> moment to excite the crystal correctly. Phase noise will be horrid.
>>
>> Same with hitting top dead centre you can only detect the 0-1 and 1-0
>> transitions but if you measure over 1024 of them you get a pretty good
>> estimate of how many free running ticks per cycle of the crystal.
>
> It's not that bad.  What the experimenter calls the "Bresenham
> algorithm" is essentially an NCO where you use the top bit to indicate
> when to fire the pulse.  You can set any step size you want and the
> average rate will match the rate your program to a high accuracy, even
> with 1 loop cycle jitter (which is about 1.5 ns in this case).

There is usually an inc by one instruction and a conditional jump on bit 
test. It may give you finer granularity in a tighter loop.

I have used this trick to get accurate audio frequencies (with terrible 
phase jitter) out of relatively slowly clocked devices.

I guess it depends what tests are easy on the CPU if you only have sign 
and overflow then adding a suitable constant is the way to go.

-- 
Regards,
Martin Brown

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-14 23:43 -0400
  Re: Software Controlled Crystal Oscillator Tim Wescott <tim@seemywebsite.com> - 2015-09-15 02:37 -0500
    Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-15 04:31 -0400
      Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-15 11:57 -0500
        Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-15 15:24 -0400
          Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-15 15:50 -0500
            Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 00:55 -0400
              Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-16 14:05 -0500
                Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 15:21 -0400
              Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-16 14:08 -0500
                Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 15:23 -0400
        Re: Software Controlled Crystal Oscillator Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2015-09-15 14:52 -0700
          Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-15 17:50 -0500
            Re: Software Controlled Crystal Oscillator Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2015-09-15 16:12 -0700
              Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-15 22:45 -0500
                Re: Software Controlled Crystal Oscillator Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2015-09-15 22:06 -0700
              Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-15 22:24 -0700
                Re: Software Controlled Crystal Oscillator Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-09-16 09:19 +0100
                Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-16 19:44 -0700
                Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-17 00:07 -0400
                Re: Software Controlled Crystal Oscillator Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-09-17 09:41 +0100
        Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-15 22:18 -0700
    Re: Software Controlled Crystal Oscillator Jeroen Belleman <jeroen@nospam.please> - 2015-09-15 10:37 +0200
      Re: Software Controlled Crystal Oscillator Tim Wescott <seemywebsite@myfooter.really> - 2015-09-15 11:59 -0500
        Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-15 15:04 -0400
          Re: Software Controlled Crystal Oscillator Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-09-15 21:05 +0100
            Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 00:39 -0400
              Re: Software Controlled Crystal Oscillator Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-09-16 08:47 +0100
                Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 11:24 -0400
          Re: Software Controlled Crystal Oscillator whit3rd <whit3rd@gmail.com> - 2015-09-15 15:27 -0700
            Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 00:43 -0400
  Re: Software Controlled Crystal Oscillator Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-09-15 12:48 +0100
    Re: Software Controlled Crystal Oscillator John Larkin <jjlarkin@highlandtechnology.com> - 2015-09-15 13:01 -0700
      Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 00:48 -0400
        Re: Software Controlled Crystal Oscillator whit3rd <whit3rd@gmail.com> - 2015-09-16 11:41 -0700
          Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 15:07 -0400
  Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-15 22:10 -0700
    Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-16 11:28 -0400
      Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-16 19:52 -0700
        Re: Software Controlled Crystal Oscillator rickman <gnuarm@gmail.com> - 2015-09-17 01:00 -0400
          Re: Software Controlled Crystal Oscillator Robert Baer <robertbaer@localnet.com> - 2015-09-17 22:38 -0700

csiph-web