you mentioned some correction on the cycle count according to the PPS, how exactly do you do this? I see you mention an IntervalTimer, are you using this timer to increment the 1us counter? Mine also demonstrates the...
Update: think I've discovered the problem: interference.
I'm not sure if all instances were cause by this, but I know this can at least be a very potential cause. While gathering some data, I noticed the alarm was...
UPDATE with oscilloscope. Note connections are suboptimal so additional ringing may be there.
As before, logic analyzer row 1 is 200 hz, row 2 is alarm, and row 3 is row 1 analog measured. I'm using the script from...
Update, got a hold of an oscilloscope, been trying to capture this but it's difficult keeping a sufficiently large window but also sufficient resolution. So that's a work in progress.
Otherwise: connecting with a USB...
I wrote their support team a mail yesterday so I'll hopefully be in touch with them after the weekend.
That being said I feel relatively confident this isn't aliasing in the measurement, because I've connected a...
And actually ringing in general isn't a huge problem for my rising edges. I can take another picture on monday but the analog mode captures a bit of overshoot (0.2V perhaps) and that's about it. Immediately settles to...
my logic analyzer has an analog mode which caps at 50MS/s, I'll give that a try as well, but this drastically reduces the recording time.
One additional point, I feel at some point there may have been a...
Thanks, I really appreciate the help.
The peaks for me if I measure at full speed (500MHz) will come as 5 or 6 peaks with max 8ns width, something in this range. The signal itself is relatively consistent in this...
It happens not so often, but it's quite repetitively a burst of rising edges between two normally spaces rising edges, as in https://forum.pjrc.com/attachment.php?attachmentid=30414&d=1676654125.
Honestly, I am at a...
Okay I see, thanks for the explanation. I'll try again and see what happens.
Note I attached a sensor to the output and it demonstrated weird behavior in the same region as one of these pulses. So it seems as...
I set pin 1 to LOW with digitalWriteFast(_pin_gnd_, LOW);. Is this not sufficient as a ground source?
Maybe not in the case of signal quality?
Edit: Same thing happens regardless of whether I'm connected to pin 1...
How different is my physical setup from yours?
I figure this has very limited possibility for interference as I've tried to route cables separately from one another, but at this point I really don't know.
Note,...
I haven't tried grounded the unused inputs, they're just hanging. I'll give that a try though.
Will be disappointing otherwise, I think this one is supposed to be relatively "fancy". Whatever that means. Would make...
I set my logic analyzer to 25 MS/s (I couldn't choose 24MS/s) and got this
If I zoom in it's 40ns this time, but still happening
Note this happened after recording for approximately 3s.
It continues happening...
Debugging this has been troubling me a great deal now at this point. I've written a very basic script which polls in `loop()` to create a 200Hz square wave with 10us high time.
My logic analyzer (saleae logic pro 8)...
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...
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...
My additions to the mentioned sketch were essentially
RV3028 rtc;
bool connectToRTC()
{
// RTC power and ground
pinMode(17, OUTPUT);
pinMode(21, OUTPUT);
digitalWriteFast(17, HIGH);
...
@defragster I just tried your script from #23 and I'm not seeing the same bounce, at least for this short time period:
Waiting for PPS toggle ...
us 2389086 cyc diff 1537 err= 2.56 us
us 3389086 cyc...
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...
I think this was the misunderstanding, what you quote is some silly python script I found to "estimate" the latency.
The code to demonstrate what I'm trying to troubleshoot is the first code block, which starts with...
I'm not flushing on the PC side, except for immediately after making the connection.
I can try flushing on the teensy side, but from what I read on https://www.pjrc.com/teensy/td_serial.html it sounds like it does...
The python script is a one-time dummy thing I had on me at the moment. The actual PC interface is in C++ and looks more like this code snippet from the original post
while(True){
if (serial_conn_->available()) {...
So I've done everything possible on the teensy side of things. I know it's not a general PC forum but what about on the computer side? Are there settings for usb interfaces which can be tweaked? I wish I could ask more...
When you say
do you mean the latency suffered when using an OutputFlush() on a non FTDI device, or that latency in general suffered with non FTDI devices?
Please correct me if I'm wrong, but the teensy 4.1 (and...
I am working on a sensor triggering project with a teensy and am nearing the end, but have stumbled upon some very haphazard latency in the serial communication to the computer. The code is relatively long at this point...
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
micros overflows after 71 minutes right? Or am I remembering incorrectly.
I had a couple questions to this, I know there's the systick interrupt which goes at 1 ms. So I figure millis uses this in part for...
Yeah you're right I didn't see it
This shouldn't make a difference here though right? The problem is the first iteration is too long, which means the if statement if (g_is_high && (g_falling_edge_timer >= g_width))...
Cheaper than GPT? Probably no right? Because GPT uses hardware right?
Anyway, the main question was more about understanding than fixing, I couldn't really find a reason for this to be happening so consistently,...
I'm using this teensy for a larger project, but one problem I noticed is that when I use elapsedMicro to create square pulses, the very first one is always longer. Can't really figure out why, this is for simple...
From what I've read the teensy's inbuilt RTC crystal is rated worse (20ppm I think), though I've read of people demonstrating as low as 8ppm performance, think that was a post from you actually.
Ok cool sounds,...
micros_from_second is only accessed in the callback and the ISR, but actually it's not so important because the described behavior happens when I comment it out as well, still working on the up-to-date minimal example...
i think you misunderstand me, it's less for never-ending optimization and more for learning good practices, particularly regarding ARM_DWT_CYCCNT. I feel I've seen this mentioned but without a rationale for when it...
I have a need for timing things in general, sometime particularly short durations. To this extent I have a couple of questions on best practices in this context
Suppose that I have something like the following
...
What's going on in line 463 of your csv? Formatting of the time becomes a bit interesting. Otherwise mine uses more or less the same format, so the python script should be usable.
0.997303625000000,;0;0;0...
Fair enough, I'm lucky enough mine can take measurement over a range, so it calculates all of these metrics for me. I have a python script for the same, but I'm not sure how much use it will be if our data isn't of the...
I thought I posted a response to KurtE but I see it didn't go through.
The response was that I had tried commenting out the Serial.write line and that the error was still happening after approx 100s of capturing....
My reading side is typically a c++ program which, should, read everything as it comes. At least it looks that way. But when i was capturing the data which I used for the plots above and to check the minimal test case...
Sorry for spamming this thread. I've managed to create a test case which fails the same way, first run was successful, second run resulted in 200Hz f_max over 1kHz and the 10Hz signal having a std deviation of >1ms
...
It's one of three periodic callbacks (each associated with an intervaltimer) which has these delays. It happens in larger degree to the low frequency ones, but all three suffer (almost simultaneously) as you can see...
Here are some figures I made illustrating all sampling times > 1 std deviation from the mean
Note these are all grouped, and many of them happen when all three triggers fire on the same timestamp (as observed by...
I'll try and get back to you with a simple example, as I said it's not necessarily extremely regular.
For example, for the 10Hz timer I processed the data in python and the following is the first 10 entries of...
Following
https://forum.pjrc.com/threads/71506-Time-synchronization-and-triggering-sensors
https://forum.pjrc.com/threads/71671-Augmenting-Teensy-millis-timing-with-external-RTC
I am working on a sensor timing...