Scope trigger seems unstable?

I am using an arduino to create a simple software PWM output by flipping the pin in software (not using any library). What I find strange is the pulse shape looks ok on my scope but its horizontal location seems to be shifting a lot, like the trigger wasn't stable. See video. I fist was running the scope and in the last 2-3 second I turned it to single acquisition mode to show you the pulse looked alright. I tested the scope with a function generator and making a similar width and height pulse and the jitter was much less:

Any reason I'm seeing this jitter?

Here is a still image:

The pulse was 5V and trigger set at 3.56V.

Any reason I'm seeing this jitter?

Yes it is caused by the time taken for the interrupt service routine used to update the millis and the microseconds counts.

Mike,

I thought that the scope starts triggering at the rising edge. I've taken a number of single acquisitions and none of them showed any longer pulses than they should.

I've left work so I'll disable interrupt and try again.

The other thing to try is to turn the trigger mode from auto to normal.

Edit -: sorry I see you have done that, but I also see that your triggered edge is not the one displayed, that one is off the screen to the left. Wind back the Y shift so you are looking at the actual edge you are triggering off.

Grumpy_Mike:
The other thing to try is to turn the trigger mode from auto to normal.

Edit -: sorry I see you have done that, but I also see that your triggered edge is not the one displayed, that one is off the screen to the left. Wind back the Y shift so you are looking at the actual edge you are triggering off.

Mike,

I see. That might be the reason. The jitter is then likely due to the up to 4us inaccuracy of micros(), which seems to be the case for the still image. I'll check it out and get back to you tomorrow.

You were right on! I now remember a colleague messing around with my horizontal position to "zoom in". Now it is displaying the pulse that triggers the acquisition. No more jitter. Thanks for your help!

Just for practice, get some to mess with all the scope settings then manually get things back to where they belong (without pressing 'return to default' button).

Repeat once per week. :wink:

.

LarryD:
Just for practice, get some to mess with all the scope settings then manually get things back to where they belong (without pressing 'return to default' button).

Repeat once per week. :wink:

.

Nay. We do that already when classes are in session. That's why I find "restore settings from USB drive" useful. As a student in an intro lab, you really don't get to mess with the apparatus (although you should, within safety parameters). There is only 2 hours for each lab. You mess up, you'll not complete your labs. Sad, right? I learned my scopes mostly while I was teaching labs. A bit late but never too late.

I am sure you know this by now, but using 'Trigger Hold Off' is also something that sould be mastered.

See:

You do learn a lot when you teach. :wink:

.

Thanks. I didn't know this hold off thing before. Interesting concept never the less. Never seen it on my scope. I use Tektronix TDS 2000 series scopes. I had to download its manual and search for it. It's hidden in horizontal menu and you have to choose whether to adjust trigger level or holdoff when you turn trigger knob.

I think for what I do, a single acquisition will do and I now have a decent logic analyzer with analog channels. What's the benefit of reading digital signals (maybe from some digital interface) on a scope anyway? Unless you send the same thing over and over, you won't get overlapping traces. Is a logic analyzer not more convenient?

IMO a logic analyser is more convenient.

You do have to remind yourself (I do anyway) there is no information about amplitudes, wave shape or non logic level changes on your logic analyzer screen.

If, however, there is no problem in these areas the logic analyzer can be a very useful tool.

The hold off feature is very useful in repeating long interval waveforms.
With the storage scopes though, a snapshot of the signal is like a bit of magic :slight_smile:

.

Larry,

My logic analyzer has analog reading on every digital channel. It's not as cheap as my digital only analyzer but we had some money for it. Very nice for students to see TTL I2C SPI communication on it with bits converted into numbers or characters.

I have the cheap, older 'Logic 16' from Saleae.
Very useful to see the decoded values for: Serial, SPI, I2C and more, using their included software.

Examples:
http://support.saleae.com/hc/en-us/sections/201990583-Supported-Protocols
CAN:


Serial:

I2C

SPI

.

I taught myself the timing of these small interfaces using a saleae (clone?) 8-channel analyzer. That was before I lectured my students of course (it was something I wanted to add to my course at the end). Can't go without it. Now I have the logic 8:

It's a mixed-signal analyzer, as they put it. My only wish is that it would save the RGB LED color setting internally so that if someone were to steal mine, I can recognize it from the LED. The RGB color code has my office room number embedded in it :slight_smile: