Teensy 4.1 timing inconsistencies with IntervalTimers

@mnissov - will go back to the necro thread linked above if I update the PPS/intervalTimer code. It won't be any good for microsPPS() unless the PPS is reliable - or deals with misses. With an RTC versus GPS it should be - but should have detect/fallback.
> Not sure any of this helped the issue at hand ... does the problem still exist? Was PJRC's intervalTimer libraries used just in case the anomaly is with the teensytimertool?

@BriComp - filled out the RV-3028-C7 sample request form - auto reply email suggests sending ASAP. Paged through the posted materials and didn't see a typical circuit.

@manitou - Sitting in a windowsill against the fiberglass frame - with tall trees outside and a generous roof overhang - far from ideal with minimal clear view of the sky - but this third GPS also does get a decent lock it seems - mostly. Though from running data it appears the PPS does drop, and the code as written does not tolerate/account for that very well.
HVAC is a woodstove so room runs from 70 to 80+ degrees - though the half blocked window sill is at 66 degrees F. I see the adjustment timer micros going from 999,998 to 999,994 where the x98 has +1.? us err and the x94 has a -1.? us err. But when running at 0.11 us measured err it is 999,996:
Code:
us 3899795148 cyc diff   -65 	err=-0.11 us	 Mn=  -80 Mx=   59 P= 999996.56
After that apparent missed PPS pushed it up to x98 then another ended with it down to x94 - and neither correcting back to that and goes stable at the +/- 1.5 us error - until the next PPS fail?
 
regarding the original thread, after some inspection of both analog and digital channels in my logic analyzer, it seems likely that this was noise in the digital measurements. Very anticlimactic
 
@mnissov - actually a good outcome ... from Teensy and software POV :) Great to have it resolved. If you had posted a picture would before and after show where the noise came from?

@manitou - these GPS not ready for external antenna that isn't here to use. and with three 1062's on ~10 ft of total usb cable through a cheap unpowered hub each with a GPS drawing current and sitting side by side on breadboard it was probably near worst case with no clear view of much sky. Powered old two down - with just the latest SFun and some tweaks to the control values it is correcting better and faster:
Code:
us 1918522127 cyc diff   -63 	[B]err=-0.11 us	 Mn=-1983 Mx=  256 P= 999996.25[/B] [#isr P:I 492?=492 !=6] !PPS=3

It is still missing PPS's, or something, apparently 6 times in past days. Here is one RESET when the _isr counts mismatch:
Code:
us 2332300874 cyc diff   -11 	[B]err=-0.02 us	 Mn=-258849335 Mx=  112 P= 999995.56[/B] [#isr P:I 178?=178 !=0] !PPS=0

ERROR RESET	  P= 999995.56 [#isr's 131180?=131179 !=1]

Those two show the interval timer measures at negative 0.11 and 0.02 us diff when it was running the timers at 999996.25 and earlier 999995.56 us per GPS PPS tick. The Min and Max ticks are crazy (with missing PPS) at times - but the first shows it saw them run 1983 short to 256 ticks long (against intervalTimer) over that interval so a range of 2239 cycles as measured.

Received SHIP notice on those chips and Proto RV-3028-C7! If anyone can make use of the RV-3028-C7 chips. I see this github.com/constiko/RV-3028_C7-Arduino_Library {ref'd by Arduino.cc} while looking for a buildable board to use the chips. This sparkfun.com/products/15486 has drawings for their product - but doesn't expose the PPS pin. This sparkfun.com/products/19802 board is simple and better - but schematic only, no eagle.

While doing above post the output adjusted to:
Code:
us 4263513720 cyc diff    -5 	[B]err=-0.01 us	 Mn=-1983 Mx=  256 P= 999996.31[/B] [#isr P:I 837?=837 !=6] !PPS=3
 
@mnissov - FedEx delivered the RV-3028 Demo board today { thank @BriComp }
- out of the box the chip was running clock output pin at 32769. Keyed that into the code {1,000,000.0/32,769.0 us) and it looked good - but was scrolling like 32K faster :)
Used linked p#29 lib and set it to 1 Hz - now it is bouncy? And the adjusted intervalTimer is showing 999987.75 instead of 999996.31 matching the GPS on this DIFFERENT T_4.1
> but unlike the GPS unit being stable at 999996.31 for long periods the RV-3028 is adjusting over 999977.12-999991.25 in short order.

Moved to another T_4.1 and it too is bouncing with the code that like the GPS (when it stays SAT synced). Here it is bounding 10 us in adjustments with ERR going all over to keep up with 'cyc diff' in cycle count?
Code:
us  152562223 cyc diff   863 	err= 1.43833 us	 Mn=-36673 Mx=16744 P= 999989.75 [#isr P:I 151?=151 !=0] !PPS=0
us  153562262 cyc diff -35964 	err=-59.94000 us	 Mn=-36673 Mx=16744 P=1000000.56 [#isr P:I 152?=152 !=0] !PPS=0
us  154562251 cyc diff   565 	err= 0.94167 us	 Mn=-36673 Mx=16744 P=1000000.38 [#isr P:I 153?=153 !=0] !PPS=0
us  155562239 cyc diff 16624 	err= 27.70667 us	 Mn=-36673 Mx=16744 P= 999995.38 [#isr P:I 154?=154 !=0] !PPS=0
Maybe I need to setup the 1 second INT pin instead of CLKOUT?

The T_4.1 with GPS was off for a bit has this in a long string of over 720 seconds:
Code:
us  601457938 cyc diff    73 	err= 0.12 us	 Mn= -362 Mx=  254 P= 999996.56 [#isr P:I 600?=600 !=0] !PPS=0
us  602457935 cyc diff    76 	err= 0.13 us	 Mn= -362 Mx=  254 P= 999996.56 [#isr P:I 601?=601 !=0] !PPS=0
us  603457931 cyc diff    73 	err= 0.12 us	 Mn= -362 Mx=  254 P= 999996.56 [#isr P:I 602?=602 !=0] !PPS=0
us  604457928 cyc diff    73 	err= 0.12 us	 Mn= -362 Mx=  254 P= 999996.56 [#isr P:I 603?=603 !=0] !PPS=0
... 
us  962456677 cyc diff    67 	err= 0.11 us	 Mn= -362 Mx=  254 P= 999996.44 [#isr P:I 961?=961 !=0] !PPS=0 // over 10 minutes with 960 seconds with that MIN and MAX set in first 65 seconds
 
@mnissov - actually a good outcome ... from Teensy and software POV Great to have it resolved. If you had posted a picture would before and after show where the noise came from?
At least I think that's the case, hard to say whether the logic analyzer is wrong when I base my "correct-ness" on the logic analyzer output :)

I'm not sure before/after would show much, my cable length isn't extreme anyway. The main debugging came from gathering analog simultaneously and inspecting the false rising edges. They showed nothing in the analog view even with relatively high sampling time.
 
@defragster I just tried your script from #23 and I'm not seeing the same bounce, at least for this short time period:
Code:
 Waiting for PPS toggle ...

us    2389086 cyc diff  1537    err= 2.56 us
us    3389086 cyc diff   950    err= 1.58 us
us    4389084 cyc diff  -626    err=-1.04 us
us    5389081 cyc diff  -539    err=-0.90 us
us    6389079 cyc diff  -122    err=-0.20 us
us    7389077 cyc diff  -136    err=-0.23 us
us    8389075 cyc diff  -230    err=-0.38 us
us    9389074 cyc diff  -214    err=-0.36 us
us   10389072 cyc diff  -218    err=-0.36 us
us   11389070 cyc diff  -187    err=-0.31 us     Mn= -187 Mx=   -1 P= 999997.94
us   12389068 cyc diff  -107    err=-0.18 us     Mn= -187 Mx=   -1 P= 999997.94
us   13389066 cyc diff  -352    err=-0.59 us     Mn= -352 Mx=   -1 P= 999997.94
us   14389064 cyc diff  -205    err=-0.34 us     Mn= -352 Mx=   -1 P= 999997.94
us   15389063 cyc diff  -210    err=-0.35 us     Mn= -352 Mx=   -1 P= 999997.94
us   16389061 cyc diff  -220    err=-0.37 us     Mn= -352 Mx=   -1 P= 999997.94
us   17389060 cyc diff  -210    err=-0.35 us     Mn= -352 Mx=   -1 P= 999997.94
us   18389058 cyc diff  -196    err=-0.33 us     Mn= -352 Mx=   -1 P= 999997.94
us   19389056 cyc diff  -185    err=-0.31 us     Mn= -352 Mx=   -1 P= 999997.94
us   20389055 cyc diff  -205    err=-0.34 us     Mn= -352 Mx=   -1 P= 999997.94
us   21389053 cyc diff  -188    err=-0.31 us     Mn= -352 Mx=   -1 P= 999997.94
us   22389051 cyc diff  -197    err=-0.33 us     Mn= -352 Mx=   -1 P= 999997.94
us   23389050 cyc diff  -173    err=-0.29 us     Mn= -352 Mx=   -1 P= 999997.94
us   24389048 cyc diff  -182    err=-0.30 us     Mn= -352 Mx=   -1 P= 999997.94
us   25389046 cyc diff  -199    err=-0.33 us     Mn= -352 Mx=   -1 P= 999997.94
us   26389045 cyc diff  -206    err=-0.34 us     Mn= -352 Mx=   -1 P= 999997.94
us   27389043 cyc diff  -175    err=-0.29 us     Mn= -352 Mx=   -1 P= 999997.94
us   28389041 cyc diff  -188    err=-0.31 us     Mn= -352 Mx=   -1 P= 999997.94

though the error definitely doesn't converge as low as with your GPS example. Maybe integral gain should be higher in my case?
 
At least I think that's the case, hard to say whether the logic analyzer is wrong when I base my "correct-ness" on the logic analyzer output :)

I'm not sure before/after would show much, my cable length isn't extreme anyway. The main debugging came from gathering analog simultaneously and inspecting the false rising edges. They showed nothing in the analog view even with relatively high sampling time.

I'll look more tomorrow and see if there is a more stable result using the other pin if that is an option.

What RV-3028 board do you have? Their DEMO board is what I got. What i2c setup did you do? And what pin is your 'PPS" on?

NOTE: as noted the SFUN 'Quiic RTC' board already noted where very hit and miss counting a second - like by over 100 ms in repeat timing on the pin they expose. I got two and only tried one and may not have it properly prepared. It was once per second - just not a uniform second interval.

The GPD T_4.1 hasn't strayed over 0.15 us error in 3044 seconds. Min Max is the same as p#30. {output abbreviated to fit screen P:I 44?=44 has the thousands clipped on both}.
As the unit has warmed up the 'p=PERIOD' has dropped 1us to keep up from 999997.38.
Code:
us 3044449162 cyc diff    53 	err= 0.09 us	 Mn= -362 Mx=  254 P= 999996.25 [#isr P:I 43?=43 !=0] !PPS=0
us 3045449159 cyc diff    50 	err= 0.08 us	 Mn= -362 Mx=  254 P= 999996.25 [#isr P:I 44?=44 !=0] !PPS=0

	  P= 999996.25 [#isr's 3044?=3044 !=0]
	 errInP=0 errInI=0 
us 3046449155 cyc diff    53 	err= 0.09 us	 Mn= -362 Mx=  254 P= 999996.25 [#isr P:I 45?=45 !=0] !PPS=0
us 3047449151 cyc diff    53 	err= 0.09 us	 Mn= -362 Mx=  254 P= 999996.25 [#isr P:I 46?=46 !=0] !PPS=0
But slow steady shift the PID loop from PJRC is tracking - though with diff multipliers.

Uploaded same current code with edits to alter expected period and it is running well on the GPS unit - had to make sure I didn't introduce the error the RV-3028 is showing:
Code:
us  166248119 cyc diff    -7 	err=-0.01167 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 159?=159 !=0] !PPS=0
us  167248116 cyc diff    -3 	err=-0.00500 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 160?=160 !=0] !PPS=0
us  168248112 cyc diff    -8 	err=-0.01333 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 161?=161 !=0] !PPS=0
us  169248108 cyc diff    -7 	err=-0.01167 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 162?=162 !=0] !PPS=0
us  170248104 cyc diff    -7 	err=-0.01167 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 163?=163 !=0] !PPS=0
us  171248101 cyc diff    -3 	err=-0.00500 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 164?=164 !=0] !PPS=0
us  172248097 cyc diff    -7 	err=-0.01167 us	 Mn= -340 Mx=  234 P= 999996.19 [#isr P:I 165?=165 !=0] !PPS=0
 
@defragster I just tried your script from #23 and I'm not seeing the same bounce, at least for this short time period:
Code:
 Waiting for PPS toggle ...
...
though the error definitely doesn't converge as low as with your GPS example. Maybe integral gain should be higher in my case?[/QUOTE]

Can't post whole sketch ... is it unsightly.
I did make these adjustments to get my numbers down:
[CODE]
...
		if (0 == firstAdjust) {
			period = period - err * 0.75;
		}
		// period = period - err * 0.02;         // integral control
[B]		period = period - err * 0.18;         // integral control
		mytimer.update(period - err * 0.26);  // proportional control
[/B]		gotRisingEdge = false;
		gotPulse = false;
...

Can you show what commands were sent over i2c to set the RV-3028 and what pin is in use? Same library as above?
 
Can you show what commands were sent over i2c to set the RV-3028 and what pin is in use? Same library as above?

My additions to the mentioned sketch were essentially
Code:
[B]
RV3028 rtc;
bool connectToRTC()
{
  // RTC power and ground
  pinMode(17, OUTPUT);
  pinMode(21, OUTPUT);
  digitalWriteFast(17, HIGH);
  digitalWriteFast(21, LOW);

  bool success;
  Wire.begin();
  const bool set_24_hour = false;
  const bool disable_trickle_charge = true;
  const bool set_level_switching_mode = false;
  const bool reset_status = true;

  success =
    rtc.begin(Wire, set_24_hour, disable_trickle_charge, set_level_switching_mode, reset_status);

  return success;
}[/B]

void setup()
{
  while (!Serial && millis() < 4000)
    ;
  Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);
  pinMode([B]20[/B], [B]INPUT_PULLUP[/B]);
  pinMode(1, OUTPUT);
  if (ARM_DWT_CYCCNT == ARM_DWT_CYCCNT) {  // start Cyc Cnt if IDLE, i.e. T_3.x's
    ARM_DEMCR |= ARM_DEMCR_TRCENA;
    ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;
  }

[B]  if (!connectToRTC()) {
    Serial.println("problems with RTC");
  } else {
    rtc.enablePeriodicUpdateInterrupt(true, false);
  }[/B]

  Serial.println("\n Waiting for PPS toggle ...\n");
  while (digitalReadFast([B]20[/B]) == LOW)
    ;
  while (digitalReadFast([B]20[/B]) == HIGH)
    ;
  mytimer.begin(pulse, period);
  mytimer.priority(192);
  attachInterrupt(digitalPinToInterrupt([B]20[/B]), gps, [B]FALLING[/B]);
}

using this lib: https://github.com/constiko/RV-3028_C7-Arduino_Library

Edit: Sorry didn't notice the other questions
What RV-3028 board do you have? Their DEMO board is what I got. What i2c setup did you do? And what pin is your 'PPS" on?
I'm using this RTC, suboptimal thought as CLKOUT isn't exposed

Regarding i2c, I'm using pin 18 and 19 on the teensy 4.1 (I guess this is the standard SDA/SCL), with the mentioned library. And the pps is on pin 20, note the RTC INT is a falling edge trigger from what I recall. I just picked the pins such that I can directly insert the RTC breakout into the teensy pins.
 
Last edited:
@mnissov: thanks, I just got busy here ... so not reading prior notes well enough ... will look into what I can do here to see the RTC improve.
Since the RV-3028 there is 'suboptimal' with no CLKOUT - how did you pick up the PPS signal to a pin? Was there a place to add a wire?

T_4.1 fed by GPS PPS running 32,552 seconds and NO ERRORS:
Code:
us 2492361606 cyc diff    35 	err= 0.05833 us	 Mn= -340 Mx=  340 P= 999996.50 [#isr P:I 550?=550 !=0] !PPS=0
us 2493361603 cyc diff    29 	err= 0.04833 us	 Mn= -340 Mx=  340 P= 999996.50 [#isr P:I 551?=551 !=0] !PPS=0
us 2494361599 cyc diff    39 	err= 0.06500 us	 Mn= -340 Mx=  340 P= 999996.50 [#isr P:I 552?=552 !=0] !PPS=0

	  P= 999996.50 [#isr's 32552?=32552 !=0]
	 errInP=0 errInI=0 
us 2495361596 cyc diff    34 	err= 0.05667 us	 Mn= -340 Mx=  340 P= 999996.50 [#isr P:I 553?=553 !=0] !PPS=0
us 2496361592 cyc diff    29 	err= 0.04833 us	 Mn= -340 Mx=  340 P= 999996.50 [#isr P:I 554?=554 !=0] !PPS=0

Error mismatch on that T_4.1 is now at 3.5 us retarded [999996.50 per second] and missing by 0.05 us DIFF!
The Crystal clock DIFF over that time {as measured between twin _isr's} is -340 to +340 CPU Cycles - so only 680 max swing in 9.0422222222222222222222222222222 hours

Same code on the DEMO RV-3028 here is jittering all over the place - but NO ERRORS:
Code:
us 1463223321 cyc diff  1025 	err= 1.70833 us	 Mn=-36115 Mx=16763 P= 999989.69 [#isr P:I 821?=821 !=0] !PPS=0
us 1464223309 cyc diff   794 	err= 1.32333 us	 Mn=-36115 Mx=16763 P= 999989.44 [#isr P:I 822?=822 !=0] !PPS=0
us 1465223358 cyc diff -35943 	err=-59.90500 us	 Mn=-36115 Mx=16763 P=1000000.25 [#isr P:I 823?=823 !=0] !PPS=0
us 1466223346 cyc diff   507 	err= 0.84500 us	 Mn=-36115 Mx=16763 P=1000000.12 [#isr P:I 824?=824 !=0] !PPS=0
us 1467223334 cyc diff 16631 	err= 27.71833 us	 Mn=-36115 Mx=16763 P= 999995.12 [#isr P:I 825?=825 !=0] !PPS=0
us 1468223323 cyc diff  7004 	err= 11.67333 us	 Mn=-36115 Mx=16763 P= 999993.00 [#isr P:I 826?=826 !=0] !PPS=0
us 1469223311 cyc diff  -115 	err=-0.19167 us	 Mn=-36115 Mx=16763 P= 999993.06 [#isr P:I 827?=827 !=0] !PPS=0
us 1470223299 cyc diff  1071 	err= 1.78500 us	 Mn=-36115 Mx=16763 P= 999992.75 [#isr P:I 828?=828 !=0] !PPS=0
us 1471223287 cyc diff  2946 	err= 4.91000 us	 Mn=-36115 Mx=16763 P= 999991.88 [#isr P:I 829?=829 !=0] !PPS=0
us 1472223275 cyc diff  2560 	err= 4.26667 us	 Mn=-36115 Mx=16763 P= 999991.12 [#isr P:I 830?=830 !=0] !PPS=0
us 1473223264 cyc diff  1475 	err= 2.45833 us	 Mn=-36115 Mx=16763 P= 999990.69 [#isr P:I 831?=831 !=0] !PPS=0
us 1474223252 cyc diff  1100 	err= 1.83333 us	 Mn=-36115 Mx=16763 P= 999990.38 [#isr P:I 832?=832 !=0] !PPS=0
us 1475223240 cyc diff  1122 	err= 1.87000 us	 Mn=-36115 Mx=16763 P= 999990.06 [#isr P:I 833?=833 !=0] !PPS=0
us 1476223228 cyc diff  1006 	err= 1.67667 us	 Mn=-36115 Mx=16763 P= 999989.75 [#isr P:I 834?=834 !=0] !PPS=0
us 1477223216 cyc diff   798 	err= 1.33000 us	 Mn=-36115 Mx=16763 P= 999989.50 [#isr P:I 835?=835 !=0] !PPS=0
us 1478223265 cyc diff -35880 	err=-59.80000 us	 Mn=-36115 Mx=16763 P=1000000.25 [#isr P:I 836?=836 !=0] !PPS=0
us 1479223254 cyc diff   578 	err= 0.96333 us	 Mn=-36115 Mx=16763 P=1000000.06 [#isr P:I 837?=837 !=0] !PPS=0
us 1480223242 cyc diff 16601 	err= 27.66833 us	 Mn=-36115 Mx=16763 P= 999995.06 [#isr P:I 838?=838 !=0] !PPS=0
us 1481223230 cyc diff  7025 	err= 11.70833 us	 Mn=-36115 Mx=16763 P= 999992.94 [#isr P:I 839?=839 !=0] !PPS=0
us 1482223218 cyc diff  -179 	err=-0.29833 us	 Mn=-36115 Mx=16763 P= 999993.00 [#isr P:I 840?=840 !=0] !PPS=0

That is the same code running on the RV-3028 unit for about the same time - and resetting the STATS and logic quickly shows the same pattern just now .... ???
 
sending rtc.enablePeriodicUpdateInterrupt(true, false); causes the rtc to make a 1hz interrupt on the INT pin.

Not sure why yours does this, weak signal so suffering from long cables perhaps? I know the INT pin triggers a falling edge, not rising. Maybe CLKOUT is the same?
 
sending rtc.enablePeriodicUpdateInterrupt(true, false); causes the rtc to make a 1hz interrupt on the INT pin.

Not sure why yours does this, weak signal so suffering from long cables perhaps? I know the INT pin triggers a falling edge, not rising. Maybe CLKOUT is the same?

I saw the INT pin setup - but went with CLKOUT as it was working at 32K on startup. It may be the CLKOUT isn't meant to be used this way. Will use that code line and move to INT pin.
 
Changed to the INT pin - RISING or FALLING the same ...

Moved the T_4.1 from my desk - to a new hub and then a cable farther away. Wires are the 6" jumpers to pins on the T_4.1 and the DEMO board.
There is a recurring spasm pattern in the cycle DIFF and response change in the PID oeriod. Changed back to the original PJRC values and no diff:
Code:
us 2958192232 cyc diff   992 	err= 1.65333 us	 Mn=-36002 Mx=18919 P= 999989.19 [#isr P:I 956?=956 !=0] !PPS=0
us 2959192221 cyc diff   805 	err= 1.34167 us	 Mn=-36002 Mx=18919 P= 999988.94 [#isr P:I 957?=957 !=0] !PPS=0
us 2960192210 cyc diff -36005 	err=-60.00834 us	 Mn=-36005 Mx=18919 P= 999999.75 [#isr P:I 958?=958 !=0] !PPS=0
us 2961192198 cyc diff   496 	err= 0.82667 us	 Mn=-36005 Mx=18919 P= 999999.62 [#isr P:I 959?=959 !=0] !PPS=0
us 2962192214 cyc diff 16568 	err= 27.61333 us	 Mn=-36005 Mx=18919 P= 999994.62 [#isr P:I 960?=960 !=0] !PPS=0
us 2963192213 cyc diff  7048 	err= 11.74667 us	 Mn=-36005 Mx=18919 P= 999992.50 [#isr P:I 961?=961 !=0] !PPS=0
us 2964192200 cyc diff  -162 	err=-0.27000 us	 Mn=-36005 Mx=18919 P= 999992.56 [#isr P:I 962?=962 !=0] !PPS=0
us 2965192190 cyc diff  1052 	err= 1.75333 us	 Mn=-36005 Mx=18919 P= 999992.25 [#isr P:I 963?=963 !=0] !PPS=0
us 2966192183 cyc diff  2951 	err= 4.91833 us	 Mn=-36005 Mx=18919 P= 999991.38 [#isr P:I 964?=964 !=0] !PPS=0
us 2967192174 cyc diff  2521 	err= 4.20167 us	 Mn=-36005 Mx=18919 P= 999990.62 [#isr P:I 965?=965 !=0] !PPS=0
us 2968192165 cyc diff  1403 	err= 2.33833 us	 Mn=-36005 Mx=18919 P= 999990.19 [#isr P:I 966?=966 !=0] !PPS=0
us 2969192154 cyc diff  1097 	err= 1.82833 us	 Mn=-36005 Mx=18919 P= 999989.88 [#isr P:I 967?=967 !=0] !PPS=0
us 2970192144 cyc diff  1099 	err= 1.83167 us	 Mn=-36005 Mx=18919 P= 999989.56 [#isr P:I 968?=968 !=0] !PPS=0
us 2971192133 cyc diff   988 	err= 1.64667 us	 Mn=-36005 Mx=18919 P= 999989.25 [#isr P:I 969?=969 !=0] !PPS=0
us 2972192122 cyc diff   805 	err= 1.34167 us	 Mn=-36005 Mx=18919 P= 999989.00 [#isr P:I 970?=970 !=0] !PPS=0
[B]us 2973192111 cyc diff -35940 	err=-59.90000 us	 Mn=-36005 Mx=18919 P= 999999.81 [#isr P:I 971?=971 !=0] !PPS=0
us 2974192100 cyc diff   572 	err= 0.95333 us	 Mn=-36005 Mx=18919 P= 999999.62 [#isr P:I 972?=972 !=0] !PPS=0
us 2975192115 cyc diff 16563 	err= 27.60500 us	 Mn=-36005 Mx=18919 P= 999994.62 [#isr P:I 973?=973 !=0] !PPS=0[/B]
us 2976192114 cyc diff  7011 	err= 11.68500 us	 Mn=-36005 Mx=18919 P= 999992.50 [#isr P:I 974?=974 !=0] !PPS=0
us 2977192102 cyc diff  -158 	err=-0.26333 us	 Mn=-36005 Mx=18919 P= 999992.56 [#isr P:I 975?=975 !=0] !PPS=0
us 2978192091 cyc diff  1053 	err= 1.75500 us	 Mn=-36005 Mx=18919 P= 999992.25 [#isr P:I 976?=976 !=0] !PPS=0
us 2979192084 cyc diff  2943 	err= 4.90500 us	 Mn=-36005 Mx=18919 P= 999991.38 [#isr P:I 977?=977 !=0] !PPS=0
us 2980192076 cyc diff  2461 	err= 4.10167 us	 Mn=-36005 Mx=18919 P= 999990.62 [#isr P:I 978?=978 !=0] !PPS=0
us 2981192066 cyc diff  1430 	err= 2.38333 us	 Mn=-36005 Mx=18919 P= 999990.19 [#isr P:I 979?=979 !=0] !PPS=0
us 2982192055 cyc diff  1100 	err= 1.83333 us	 Mn=-36005 Mx=18919 P= 999989.88 [#isr P:I 980?=980 !=0] !PPS=0
us 2983192045 cyc diff  1085 	err= 1.80833 us	 Mn=-36005 Mx=18919 P= 999989.56 [#isr P:I 981?=981 !=0] !PPS=0
us 2984192034 cyc diff   992 	err= 1.65333 us	 Mn=-36005 Mx=18919 P= 999989.25 [#isr P:I 982?=982 !=0] !PPS=0
[B]us 2985192023 cyc diff -35868 	err=-59.78000 us	 Mn=-36005 Mx=18919 P=1000000.00 [#isr P:I 983?=983 !=0] !PPS=0
us 2986192012 cyc diff   724 	err= 1.20667 us	 Mn=-36005 Mx=18919 P= 999999.81 [#isr P:I 984?=984 !=0] !PPS=0
us 2987192028 cyc diff 16666 	err= 27.77667 us	 Mn=-36005 Mx=18919 P= 999994.81 [#isr P:I 985?=985 !=0] !PPS=0
[/B]us 2988192027 cyc diff  7089 	err= 11.81500 us	 Mn=-36005 Mx=18919 P= 999992.69 [#isr P:I 986?=986 !=0] !PPS=0
us 2989192015 cyc diff  -122 	err=-0.20333 us	 Mn=-36005 Mx=18919 P= 999992.75 [#isr P:I 987?=987 !=0] !PPS=0
us 2990192004 cyc diff  1116 	err= 1.86000 us	 Mn=-36005 Mx=18919 P= 999992.44 [#isr P:I 988?=988 !=0] !PPS=0
us 2991191997 cyc diff  3097 	err= 5.16167 us	 Mn=-36005 Mx=18919 P= 999991.50 [#isr P:I 989?=989 !=0] !PPS=0
us 2992191989 cyc diff  2527 	err= 4.21167 us	 Mn=-36005 Mx=18919 P= 999990.75 [#isr P:I 990?=990 !=0] !PPS=0
us 2993191979 cyc diff  1473 	err= 2.45500 us	 Mn=-36005 Mx=18919 P= 999990.31 [#isr P:I 991?=991 !=0] !PPS=0
us 2994191969 cyc diff  1143 	err= 1.90500 us	 Mn=-36005 Mx=18919 P= 999990.00 [#isr P:I 992?=992 !=0] !PPS=0
us 2995191959 cyc diff  1177 	err= 1.96167 us	 Mn=-36005 Mx=18919 P= 999989.62 [#isr P:I 993?=993 !=0] !PPS=0
us 2996191948 cyc diff  1090 	err= 1.81667 us	 Mn=-36005 Mx=18919 P= 999989.31 [#isr P:I 994?=994 !=0] !PPS=0
us 2997191937 cyc diff   825 	err= 1.37500 us	 Mn=-36005 Mx=18919 P= 999989.06 [#isr P:I 995?=995 !=0] !PPS=0
[B]us 2998191926 cyc diff -35954 	err=-59.92333 us	 Mn=-36005 Mx=18919 P= 999999.88 [#isr P:I 996?=996 !=0] !PPS=0
us 2999191915 cyc diff   599 	err= 0.99833 us	 Mn=-36005 Mx=18919 P= 999999.69 [#isr P:I 997?=997 !=0] !PPS=0
us 3000191930 cyc diff 16633 	err= 27.72167 us	 Mn=-36005 Mx=18919 P= 999994.69 [#isr P:I 998?=998 !=0] !PPS=0[/B]
 
To be honest, not sure if it's actually fixed, I'm still seeing some occasional rippling on the digital output from the teensy. I'm not 100% convinced it's the logic analyzer, this ripple is happening here in the middle
pic1.png
pic2.png
where the widest HIGH is 6ns. Logic analyzer is set to 3.3V logic level w/ 500MS/s digital and 50Ms/s analog sampling rates. I'm basically maxing out the sampling rates so I can't really get any more precise on the analog side. But I'm having a hard time understanding whats going on here.

Note this is with pin 2 as the signal, and I set pin 1 as LOW in the setup, so grounding is spatially close to signal, and the cables are pretty short.
 
Back
Top