Teensy3.1 as a precision Frequency Standard

Status
Not open for further replies.
I stumbled on this thread ...I want to express my admiration of your project TelephoneBill. Superb.
 
@TelephoneBill,

I've just ordered parts to build this circuit. Could you recommend an ebay vendor for the 60kHz crystals?

Thanks.
 
Wasn't sure how these crystals are priced - seems about the same - but IIRC when I got more Teensy RTC crystals I pain like a buck more to get Citizen 5ppm instead of 10ppm parts - 10 for $5 at digikey.
 
Looking at the Mouser page, it says "tolerance = 30ppm". So I would expect worst case resonance at (60,000 Hz * 1.000030) = 60,001.8 Hz or 59,998.2 Hz - which is good. If you get parts with better ppm then great. There will also be some degree of "frequency pulling" from external capacitance, but my experience is that is usually small, a few ppm (and affects Q adversely).

On building, you will need to take care if using breadboard, because the inter row capacitance is quite significant. My photo shows how you can arrange this with care - and I'm sure that such inter row cap IS affecting things. That's why I built a test circuit identical to the last IC3 stage on another piece of breadboard to check out the crystal performance, but made the physical layout identical (no metal screens though). What is amazing in the test circuit is the stray capacitance coupling required (so little). My sig gen is that kit quoted previously and the ability to tune in 0.01 Hz increments was very handy. I could calibrate the sig gen using my UBlox GPS or MSF itself. The U Blox software is free download and called "u-center 8.16". You may be able to use WWVB itself as a scope reference to compare with. Keep the sig gen signal levels low to avoid damaging the crystal (1.0 v pk-pk should be OK).

The 0-60pF trimmer might be too big, so any small pF trimmer might work (even two short insulated wires twisted might actually work). But getting this into the breadboard was tricky - I flattened the crimped tags to get them to 0.1 pitch. I also had to use a metal screwdriver for adjustments (which is going to affect it) but worked on the "nudge and withdraw it" principle :). My trimmer was at minimum for max resonant peak.

You will also see the INA126 slew rate affect things. If the signal gets too big, the output becomes almost triangular shape.

When you see some "one second pulsations" in the output from the radio signal for the first time - that's when you know it has been worth the effort !! Pure joy. Whether you will be able to "tame" WWVB and its phase switching or not - that's still an open question (???).
 
Something to consider...

I note from the WWVB code format that a "0" is always transmitted on seconds 4, 14, 24, 34, 44, and 54. If the radio "gain stages" could be "synchronously gated" by an output pin from Teensy, then it may be possible to limit the signal into IC3 to just those seconds. This means that the phase will never alter - there will just be 10 seconds gaps between the periods of carrier presence. You won't have to worry about any shorter "1" periods either.

Running some tests on my own kit, I notice that if I switch control off temporarily (with a "c" toggle command), if it was locked and stable beforehand, then the rising edge of the Teensy 60 KHz sq wave hardly drifts at all for quite a number of seconds. Any accelarated drift will be due to thermal causes of the Teensy 16 MHz module. I put a small piece of cotton wool over mine, just as a thermal blanket.

You might like to do some tests on your own Teensy3.1 before building the front end receiver. If you have an accurate and stable 1 second scope trigger source (GPS, Rubidium), then you can adjust the "FreqAdjust" value accordingly to get a "stationary" Teensy 60 KHz trace and then observe the rate of drift. The "p123" manual command can preset FreqAdjust to "123", "q" and "a" give fine control up or down, and "h" or "g" give more coarse control. I should be very interested in seeing any results.

Such a receiver design would only sample the receiver output every 10 seconds, but this may be sufficient to give a reasonable accuracy. In the early days of my experimental work, I often made a manual comparison just to get a precision frequency reference. And that is better than nothing :) !!
 
Hmm. Hold everything. Snag... re-reading the WWVB coding... the code transmitted is not the same code as that used for amplitude modulation. So the 4,14,24,34,44 and 54 seconds are AM zeroes, but could be either PM zeroes or ones. Which means the data (and phase changes) differently in PM.

The good news is that it may be easier to "forecast" what the phase will be - it looks as if the coding is fixed for the minute (a large chunk is Binary Minute of the Century). Maybe gating via a CD4066 could "select" which phase to pass through to IC3. And a simple unity gain inverter stage could provide a second source for a CD4066 to select from, effectively "commutating" the output (there is even a spare amp IC2B).

I have been looking at a site (http://www.maxmcarter.com/rubidium/2012_mod/) which uses frequency doubling as a method of overcoming the phase changes. But this does not have the benefit of the purity and sensitivity from the mini crystal. Is there another way to use the idea here, but retain the 60 KHz mini crystal ???
 
An idea for testing...

MSF was switched off recently for maintenance periods. During such times, I created an artificial continuous 60,000 Hz "induced" signal by attaching a short length of wire to the croc clip output of my UBlox sig gen. This wire was a several feet away from the ferrite loopstick and gave enough radiation (3.3 volt sq wave) to reproduce the signals in my scope picture. (Take care not to overload - bring the wire nearer slowly from a distance).

A steady signal like this is ideal for alignment, testing and checking, but the frequency has to be very good.
 
Last edited:
Just discovered a manual for an instrument called 8163-2 on the http://www.maxmcarter.com/rubidium/2012_mod/ website. See correspondance at page bottom for a copy of this manual. Has some VERY interesting reading on performance and circuit schematics. Using the freq doubler idea, this has been successfully modified for BSPK phase modulation.

Interesting comparison with my own schematic. I think mine will be much higher Q (gain/sensitivity). However, to respond to the 0.5 sec WWVB "1" data, you may have to downgrade the Q in order to have the wider bandwidth necessary to accept the shorter pulses properly. Trial and error ???
 
60 kHz oscillator circuit, issues

I thought I would start with an oscillator circuit to find out what frequency my crystals are tuned to. So far only partly successful with a LF412 dual opamp running at +/- 2.5V (power supply is 4x 1.25V NiMH AA, with ground ref from TI TLE2426 "rail splitter"). The circuit starts up at either 50 kHz or 124 kHz, then jumps to 60.0068 kHz when I briefly touch a node (opamp A noninverting input) with a finger. Hmmm. At one point I got 60.0017 kHz using a slightly different circuit, instead of the T network, the output-input feedback was just an air-spaced adjacent-wires "capacitor" that was probably 0.1 pF or so. I am also not sure my frequency counter is calibrated to better than a few ppm.

OSC-60kHz.jpg

If I change the capacitor in parallel with the crystal from 12 pF to 10 pF, then I measure 60.0129 kHz.
If I change it to 14 pF, then I measure 60.0053 kHz.
The datasheet value is 12.5 pF.
 
Last edited:
We all remember there are two resonances for a crystal (I had forgot :)) - series and parallel. Can't remember which is the lower of the two, and they are both very close. This may explain your figures at 60,006.8 and 60,012.9 Hz.

Your "air-spaced" adjacent wires result at 60,001.7 Hz sounds about right (1.7 Hz from perfect). I'm not too sure that an active oscillator is the best indicator (lots of variables involved). And this will be the parallel resonance. Far better to use a very simple passive filter (is my circuit using series resonance?) and observe the resonant peak (minimal variables). Try build the same as my IC3 circuit on breadboard with just an instrument op amp with factory preset gain (open circuit on pins 1 and 8). You will then need a good source of 60 KHz with fine tuning and a good method of frequency measurement. These latter requirements lends me to two more suggestions...

A. Teensy3.1 itself is a great 60 KHz oscillator with impecable fine tuning. Use my code in control "off" mode and the p,q,a,g,h commands. Shield the 16 MHz crystal with cotton wool to stop drafts etc.

B. A good method of measuring Teensy 60 KHz to sub Hz accuracy is a scope (using the phase drift method) on the instrument op amp output pin 6. Trigger one scope channel from a known good stable source at either 20 KHz or 10 KHz (get 20 KHz from GPS 10 MHz by freq division chips) and adjust the Teensy source until you get three static waves displayed on another channel (must then be exactly 60 KHz). You can even trigger from a 1pps. I use 1pps all the time, but its a jerky one second trace refresh. (Your Freq Counter will get you in the ball park on 1pps).

Once you are happy with three static waves displayed, then retune up or down slightly and a "phase change drift" of 1 complete cycle in one second is a 1 Hz discrepancy on 60 Khz exact. 2 cycles in one second is 2 Hz etc. Teensy is so good at fine tuning, you will be able to measure very, very accurately - much better than with a freq counter. When your Teensy channel drifts to the left compare to the 1pps/20 KHz channel, then its higher in frequency. When it drifts to the right then its lower in frequency.

When you have your Teensy calibrated source working, then back to the filter and adjust the other leg trimmer cap of the instrument op amp for a peak output on scope. This will be the instant that the mini crystal reactance is "nulled" by the trimmer (Come to think of it, I think this is series resonance). You can then measure the frequency using the above method to great precision.

The great benefit of using this filter circuitry is that this is what you will be using long term anyway :) !! The benefit of an instrument op amp over other op amps is that the gain is factory preset to unity if no resistor (infinite resistance) between pins 1 and 8 - less chance that the feedback circuit is going to pickup unwanted signals, or emit them) I used mine without a resistor for a long time and only succumbed to increasing the gain by a 68K resistor when I was using the 74HCT14B sine/square converter. That's when I noticed the slew rate distortion was increasing.

And remember to keep the signal levels low when using the Teensy source. Stick a wire in the breadboard, and just the stray cap from two or even three/four holes away, will be more than enough to drive the circuit and see the peak on a scope.
 
Last edited:
Further to WWVB, been doing some research on BPSK and came across something called a "Costas Loop" (1950's - the good ol' days - remember them well), which is a fancy type of PLL. Google pictures will show you plenty circuits (and Wikipedia). The key point about a Costas Loop is that it locks to a BPSK signal and is used to recover the carrier (also used on DSBSC). It will also decode the modulation symbols for you. Now it uses a VCO set to the same frequency, but you need quadrature outputs from the VCO (sine and cos) - and three multipliers (sadly).

Now where could you get precise 60 KHz signals in perfect quadrature? Hmm... Teensy3.1 is a good start !!

Have a look at the next scope picture. I used the same code as before for main FTM1 as normal, but changed the code for FTM0 to use the same MODValue. But by setting FTM0_CV2 = 249, this then altered the FTM0 output toggle to happen half way through a half cycle, which is quad phasing w.r.t. FTM1. You can see this as Trace 2 (FTM1) and Trace 4 (FTM0) in the scope picture below.

If you did experiment with this on WWVB, then you would need to keep your tuned RF receiver well away from Teensy (as the manual for Spectroscope 8163 clearly advocates! - see above posts).

Still think/hope that my simple circuit has a small chance of working on WWVB...

SixtyKHzQuad001.jpg
 
Further to suggestion "A" in previous but one post...

In experimenting with Teensy as a sig gen for 60 KHz, the code I presented has "too fine control" for testing "unknown crystals" - it only varies a fraction of a Hz (using input commands "p000" to "p999"). But I commented out the "dither IF statement" in the ISR and replaced it with a fixed value for OSC0_CR and found I could set the frequency anywhere from 59,996 Hz (OSC0_CR = "0xFF") to 60,004 Hz (OSC0_CR = "0x00") and values in between.

The table of ppm variation can be found at https://forum.pjrc.com/threads/28098-Crystal-pull-range-on-3-1?p=102243#8, and this checks out with value "0x00" = +75.984ppm = 60,000 times 1.000075984 = 60,004.56 Hz.

The series versus parallel resonance issue is explained by the equivalent circuit. In the diagram, Fr = Freq Resonance (Series) and Fa = Freq Anti-Resonance (Parallel) and Fr occurs slightly lower than Fa. In my filter, I'm still not sure if this is series or parallel. I think its series - the impedance in IC3 "+ leg" being just R1 (C1 cancels L1), with C0 nulled by the trimmer cap in "- leg".

XtalEqCct.jpg
 
Last edited:
On signal strength/coverage of WWVB, there is a map shown as Fig 4.5, page 113, of this publication (http://tf.nist.gov/general/pdf/1969.pdf). The document generally is a very interesting read.

I also had a look at the wikipedia page for DCF77 which transmits in Europe on 77.5 KHz and is a similar power to WWVB at 50 Kw. It indicates a signal strength of 1mV/metre at 500 Km, and around 100uV/metre at 2000 Km. I'm guessing my MSF signal at 180 Km then as being circa 3mV/metre (lower power at 17 Kw). This suggests that at 2000 Km, the receiver is going to need a lot more drive to the IC3 filter stage - likely much more than my simple stray capacitance.

If you can get any sort of WWVB signal displayed on a scope, then a visual/manual tuning of Teensy output for zero phase drift would in itself be a useful reference standard. I found on manual control that when the Teensy crystal module is covered with a cotton wool blanket of 1cm thickness, and when warmed up for 1 hour, the random drift was about 100 nS over 10 seconds.
 
I have just received delivery of 50 pieces of the 60 KHz crystal from Mouser (part no. Citizen CFV206-60.000KAZF-UB). These are very cheap so its not any great expense.

My objective is to discover how useful these may be in this project - and also to check the distribution of ppm values with the 30 ppm quoted. I will advise on my results shortly.
 
Resonance test results - Mouser crystals

So far, have had a quick look through 25 of the 50 crystals. They all appear similar in performance and within the 30 ppm spec. I have tested 4 pieces directly in the radio receiver (when synched with the Teensy sq wave) and they all worked with a little adjustment (4.7pF capacitor in parallel with crystal itself, and tweaking of the 60pF trimmer).

I also conducted some precise crystal resonance tests. These tests have provided some very interesting information - and thrown up some good questions. In the tests, I used an exact copy of the IC3 stage filter, and the input was 1.8 volts pk-pk from my Signal Generator (http://www.ebay.co.uk/itm/MHS-5200A...tor-Source-Frequency-Meter-12S6-/351479922752). I calibrated the Sig Gen by setting its frequency such that the filter output had ZERO SCREEN DRIFT when displaying 6 full cycles on a scope against a GPS locked 10 KHz signal as the scope trigger. The Sig Gen displayed 60.00028 KHz, so that told me that the display offset was 0.00028 KHz (when the output was a true exact value of 60.00000 KHz).

Here are the results:

ResonanceTests001.jpg

Remember that the breadboard has significant inherent capacitance between the 6 hole rows. The results in test A are with the crystal simply plugged in and without any attempt at providing a parallel loading capacitance (which the spec says should be 12.5 pF to expect resonance at precisely 60.0000 KHz). However, there will be some capacitance contribution from the breadboard.

The "Mid" true frequency value for test A of 60.00130 KHz indicates that the breadboard capacitance is somewhere between 0 and 12.5pF. The Mid frequency is a little on the high side, so the breadboard has not managed to provide enough additional parallel capacitance to pull it down to precisely 60.00000 KHz.

Test B shows what happened when I put a 12pF capacitor in parallel with the citizen crystal. Now you can see that peak resonance occured below 60 KHz at 59.99850 KHz. So the breadboard plus the 12pF has pulled the frequency down under the specified value.

Test C shows what happened when I put a 4.7pF capacitor in parallel. Now the Mid freq peak resonance is 59.99970 Khz. This is only 0.00030 KHz below the spec'd requirement, so I then used this back in the radio receiver (replacing my original crystal) as shown below:

CitizenCrystalInRadio001.jpg

And here is a corresponding scope display when used in the radio with Teensy synchronised to the sine wave down the twisted pair:

Citizen 60 KHz Teensy synchd 001.jpg

When comparing this to the picture in post #14, you can see that the amplitude of the radio output sine wave is slightly smaller. I did tweak the 60pF trimmer for maximum amplitude.

Another interesting point to note is the frequency value display in the top right corner of the scope picture. This shows "60.0004 kHz", which also tells me that the independant frequency counter inside the Rigol scope is offset by 0.0004 kHz too high.

Not only has this resonance test exercise calibrated my Sig Gen, it has also calibrated my scope's counter display too :) !! This really shows the power of this MSF radio signal and the power of Teensy synchronised to it. If anyone can display the WWVB signal, then they can manually use the ZERO PHASE DRIFT principle to calibrate the Teensy output - even if the BPSK update of 2012 prevents automatic synchronisation.

If you have any other medium or long wave transmitter signal locally, which is synchronised to a GPS reference, then provided the "numbers" are favourable, you might be able to use that transmitter rather than WWVB.

In respect of the other questions that these results has thrown up, I'll make comment in a later post.
 
Last edited:
Comments thrown up by the results…

Tests B and C show that parallel capacitance is essential to get the resonance curve centred over the MSF frequency of 60.00000 KHz. The bandwidth is so narrow (around 1.00 Hz – test C) that freq values of test A and test B would not work in the radio. Indeed, with a first attempt to simply swap my original crystal for a new Citizen one (no cap), I found that the sine wave output was both noisy and “unstable”. It did perform well with added 4.7pF parallel capacitance and trimmer tweaking.

This throws some further light on HOW this design is actually working. I thought it was series resonance, but am now sure this was wrong – it only works when parallel resonance is centred over 60.00000 KHz.

This fact also answers two questions which I had long puzzled over… (i) Why is the output sine wave signal so “clean”? (ii) Why is this design so sensitive with such a small ferrite?

I think the key answer to both questions is that the IC3 stage is behaving like an oscillator with insufficient positive feedback. The crystal equivalent circuit must be in the parallel (“anti-resonance”) operating region, and the stage is “teetering on the edge” of self-oscillation. When some energy with just the right repetition rate is injected into the crystal, then this is sufficient to replace the “normal positive feedback”, and the crystal oscillations build up from zero with a time constant of around 1 second. Equally so, when that incoming energy is removed, then the crystal oscillations decay over that same time constant period.

In truth, this is what a filter actually does. But it is unusual to see a filter with such high Q values – 60,000 is out of the ordinary for a “tank circuit”. It can only maintain that “SuperQ” status if the bandwidth is kept narrow, and this requires the loading to be small – hence the coupling to the previous stage by stray capacitance, and the use of a very high input impedance provided by the INA126 instrument amp. This amp too has a finite gain/bandwidth product which limits when the amplitude reaches about 1 volt peak output.

When I first began this experiment with a handful of eBay crystals, it must have been just co-incidence that 3 of those could “anti-resonate” at precisely 60.00000 KHz when loaded with the inherent capacitance between two six hole rows of the breadboard. Some other construction might never have worked :eek: !!

This poses two further questions for use with WWVB… (a) Is the sensitivity good enough to allow the use of 100 uV/m field strength signals, and (b) Is the bandwidth two narrow to allow the reception of BPSK modulation? What in fact does the spectrum of WWVB modulation look like and how wide is it? Any takers?
 
Last edited:
So it looks as if IC3 is functioning as a regenerative detector or a Q-multiplier from days of yore? BTW, a Heathkit Q-multiplier was my first electronic kit as a kid.

Best regards,
Michael
 
Ah... Heathkit. Those were the days.

Just to update the Mouser/Citizen crystal information - I have now tested all 50 crystals. The spread in ppm was quite low. I found that a parallel 4.7pF capacitor was required, in addition to the stray capacitance of the breadboard, to bring the majority to resonance at 60,000.00 Hz. The other trimmer cap was set around 30pF. I tested all 50 crystals with this fixed configuration and found that the lowest resonance was 59,999.80 Hz and the highest was 60,000.20 Hz. Looks like many were manufactured at the same time or jig settings.
 
A movie showing the dynamic behaviour of the IC3 crystal filter stage output over several seconds...


Trace 1 (60 KHz sine wave) dips in amplitude each second as the interruption happens in the MSF carrier. All traces are the same as in the picture in post #42. Notice the larger dip in sine wave amplitude on the first dip = the minute marker of 500 milliSecs (equals 0 seconds). You can count further seconds on each dip. Notice also the "double-dip" on seconds 9 and 10. This is a double interruption of 100 milliSecs giving the "DUT1 data" encoding.

This movie was taken using a Mouser/Citizen crystal. Because the Q of the crystal is very high, the amplitude only falls a small amount during the carrier interruption. These dips are a good confirmation indicator that the radio is tuned to MSF and not some other signal. I think this crystal performance is actually better than my original one.
 
Project Update:

(1) I've been doing some work on this project with a board using a different 16 MHz crystal module. My original board uses an NDK module and this latest uses the Epson (marked "6360"). I knew the control algorithm employed was fairly basic, but variations in 16 MHz modules has shown some important weaknesses. You make find that if the start up 60 KHz Teensy sq wave is too far away from an exact 60 KHz value that the control loop fails to engage properly and the FreqAdjust value just "quivers" about its starting value. This is most likely due to "aliasing" of the FTM1_C1V value - that value read by FTM1 Channel1 on the positive rising edge of the "squared off" input signal (from 4046 chip). My control algorithm in FreqControl routine is trying to detect if the Teensy generated wave is too fast or too slow and it calculates the change in FTM1_C1V (as dCh1Differential). If the initial sq wave is too fast, it may not get enough readings within one half cycle to correctly interpret if the generated wave is too fast or too slow. A workaround is to switch from auto to manual control, and manually adjust the generated frequency until it is in the right ball park (taking a few seconds to drift one half cycle). You can then read the corresponding FreqAdjust value on the Arduino serial display and alter the startup value for this variable accordingly (FreqNominal on LINE 40).

(2) If the value of FreqAdjust gets too low (near zero) or too high (near 1000), there is no "bounds" checking in code and this can then auto increment/decrement to take on "illegal values". This indicates that the two digital capacitor values used in the "dithering process" are not sufficient to keep the "averaged ppm value" of the 16 MHz module at its "sweet spot" frequency of exactly 16,000,000 Hz. I found with this new board that I had to choose a different value of "0x0A" (=-10ppm) for use in the OSC0_CR register, rather than my original "0x02" (=-3ppm) in code LINE 59 and LINE 131. This widened the range for the "dithering process" to put the starting value back near the range centre at 400 (when it had dropped as low as 0). You may find (???) that your crystal is such that you need to dither between two different values of digital capacitor, in order to find that sweet spot where you can manually match the frequency of Teensy's generated sq wave precisely with that of the Radio Sine Wave/Squared Off input signal (yellow/dark blue traces in the scope pictures). Once you have found two capacitor values that work, then employ these instead. (see the table at post #8 on page https://forum.pjrc.com/threads/28098-Crystal-pull-range-on-3-1?p=102243 for guidance on choosing values).

(3) I now have a new method (does NOT require the GPS "cheat" technique) for adjusting the timing of the correct instant to measure the incoming signal, in order to minimise the jitter caused by sine wave amplitude variations (which affects the squared off signal). Using two scope channels, set one probe to monitor the "One Second Signal" that is output on Teensy board pin 22 (in code LINES 161 and 164). Set the other probe to display the input SINE WAVE on the twisted pair cable. By using the "nXXXXXX" serial command, you should be able to find a six digit value of XXXXXX (from 000000 to 119999) that slides the timing along the input wave, such that the "One Second Signal" is then co-incident with the maximum amplitude of the SINE WAVE. This point should be just before the amplitude starts to drop (when the radio carrier is interrupted). Note - see points A,C,E & G in picture of post #24 of this thread (previous page). This instant will be the most stable for measuring the positive rising edge (i.e. the instant for the FTM1_C1V value to be measured). Remember that the in normal use, the auto control loop will try to maintain the relative phase of the squared off "rising edge" and the Teensy generated wave to a clock value of 250 (the SYNCH POINT), which is midpoint along one half cycle of the Teensy sq wave.

(4) Be aware that when the auto control code is searching for "phase lock", it does not discriminate if the SYNCH POINT (just mentioned) is on the positive or negative half cycles of the Teensy sq wave. It will be a random event which of these two occurs. If you have a preference and wish to switch from one to the other, then type "c" <CR> in the Arduino serial input textbox to go into manual control, and then type "ggggg" <CR>. The scope display will now show the Teensy sq wave slipping behind (to the right). When the squared off "rising edge" is concurrent with the other Teensy half cycle, then quickly type "hhhhh" <CR>. The Teensy wave should stop sliding. You can now switch back into auto control by typing "c" <CR> again.

(5) I recently bought a pack of ceramic capacitors having values 2pF, 3pF and 5pF so I tested some of these in place of the 4.7pF across the Mouser/Citizen 60 KHz crystal in the radio. Surprisingly, it seems that 4.7pF was my ideal value for this specific crystal (which will be added to the stray value of 2.38pF - see post https://forum.pjrc.com/threads/36107-Solderless-Breadboard-Stray-Capacitance?highlight=stray+cap). The crystal is obviously sensitive to very small capacitance variations.

(6) One code change to recommend - change the place of the call to "CalcAverageCV" from LINE 179 to be before the call to "CopyData" on LINE 176. This change calculates the average now before it is used (in the original code, it would not be used until the next loop time).

(7) One question I was keen to answer was "How stable is the Teensy sq wave?" once "phase lock" has be gained and things have settled over an hour. My finding is that the Teensy generated sq wave has "fast" jitter of somewhere around 25 to 40 nSecs (using GPS as reference and scope trigger, but this too will have its own jitter that may add). It also has a "slow wander" of about +/- 200 nSecs that can take place over several seconds. Mostly this is less at about +/- 100 nSecs (or often lower), but can without cause reached the higher figure.

(8) I was also interested in the amount of CPU time that the control code takes. I measured the number of ISR calls (FTM1CountOVFlow) against the total number of program main loops (LoopCount). The ratio was consistent at about 3 LoopCounts to every FTM1CountOVFlow count. So it looks like about 33% of CPU time is taken up by the controlling code, leaving the other CPU time available for any other jobs.
 
Last edited:
Status
Not open for further replies.
Back
Top