Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Got an oscilloscope for Xmas!

Status
Not open for further replies.

UTMonkey

New Member
Hi All,

Really pleased, I got a digital oscilloscope for xmas.

Today was the first day I got round to actually using it, and I wanted to test that it was working ok.

The first test I thought of was to write a little program for my microcontroller that toggles a port (high\low) and measure the frequency of it.

The MicroController in question uses the internal oscillator at 8Mhz, which equates to 2MIPS.

The program which loops constantly uses 6 cycles on each iteration.

2,000,000 (MIPS) divided by 6 cycles = 333.33Khz.

My scope measures a frequency of 335.2Khz, just under 1.9Khz higher than the calculated value (over .5 percent higher).

Is this an acceptable difference? is my scope at fault? or the internal oscillator of the PIC?

Thanks in advance.

Mark
 
I always blame the PIC... :) I use AVR, but understand that the internal oscillators can be off by quite a bit. Should test some other signals. Here in the U.S., our outlets are a stable 60 Hz. Never did much that required precise measurements, but have read the manuals and they usually suggest calibration, which means sending off some place. I know that reading the instruction is a mandatory last resort, but might not be so bad.
 
At least for AVR, the internal oscillator is from an RC oscillator, and as such is somewhat temperature dependent. In the datasheets it states that you can expect a range of 7.7-8.1MHz clock source for an 8MHz internal clock. Completely normal. Use Crystals if you ever need a perfect clock source.
 
The tolerance if fine.

The error is probably a mixture of the scope's tolerance and the PIC's.

Does your scope have a frequency counter function?

A frequency counter is a lot more accurate than counting the squares on the scope.
 
Totally within the spec range for on-chip uC oscillators. Your scope sounds fine. Enjoy it! I have to buy myself one as a belated giftmas present this year since Santa didn't bring one.
 
My 'scope is about 44 years old. I made it as a kit and it still works fine today. I souped it up a little over the years.
 
UTMonkey your Junebug has a 30KHz test mode, it's fairly accurate as the Junebug (PICkit2) is crystal controlled.
Access the troubleshoot mode from the standalone software.
 
A 555 timer is always a trusty way to generate the target frequency. My flyback transformer 555 timer generates a waveform of 25kHZ, but it looks really bad :D

Good ol 555 timer!
 
Enjoy your o-scope. It is a real necessity for serious study and repair.
Most modern scopes need to run a calibration routine when first out of the box. Mine does it with all probes removed. It takes a minute or more, depending on the make and model. Mine warns that this needs to be done if the temeperature changes by 5deg Centigrade. And, of course, the probes must be adjusted for each channel.

Happy holidays!
kenjj
 
Thanks Guys, the scope is a digital one. I did ask in a previous thread which ones to look for and got some good feedback.

At the end of the day, I let my wife choose the model (its true!) - let's just say she went for the "practical" option, i'll let you decide what that means....

Anyway it looks great, and I am sort of getting the hang of it, you are all correct however - it definitely opens everything up - should have had one of these years ago instead of picking up (and putting down) electronics books.


BlueRoom - What software for PicKit2 are you referring to?


Thanks All

Mark
 
"A 555 timer is always a trusty way to generate the target frequency."

Just like an airplane is always a trusty way to travel .... unless your pilot is a bus driver who's never seen the inside of a cockpit before! (No intentional insult to bus drivers here.)

The 555 has very little to with the accuracy and precision of the "target frequency". The weakest link in a 555 circuit is the timing capacitor, not only the value, but the tolerance and temperature coefficient. The timing resistor(s) are almost secondary to that even.

If I want an accurate frequency, the 555 is one of my last choices. I'd use the output of a crappy analog signal generator or function generator before that! A simple crystal oscillator has accuracy that is magnitudes more accurate that any RC-based generator such as one based upon a 555.

Dean
 
A CMOS watch crystal oscillator running at 32.768kHz is often the best way of calubrating a scope.

In fact, what I normally do is set my function generator to a know frequency using my frequency counter which I hopt uses a quatz crystal for timing, then use it to test the scope.
 
UTMonkey said:
BlueRoom - What software for PicKit2 are you referring to?

Microchip has PICkit2 standalone software, it allows you to name, diagnose and more your PICkit 2 (or Junebug). The excellent "UART tool" is there too which turns the programmer into a USB to TTL Serial terminal.
Download it from Microchip PICkit 2 v2.40
**broken link removed**
**broken link removed**
 
UTMonkey said:
Hi All,

Really pleased, I got a digital oscilloscope for xmas.

Today was the first day I got round to actually using it, and I wanted to test that it was working ok.

The first test I thought of was to write a little program for my microcontroller that toggles a port (high\low) and measure the frequency of it.

The MicroController in question uses the internal oscillator at 8Mhz, which equates to 2MIPS.

The program which loops constantly uses 6 cycles on each iteration.

2,000,000 (MIPS) divided by 6 cycles = 333.33Khz.

My scope measures a frequency of 335.2Khz, just under 1.9Khz higher than the calculated value (over .5 percent higher).

Is this an acceptable difference? is my scope at fault? or the internal oscillator of the PIC?

Thanks in advance.

Mark

SWEET!

What model is it? I want to get one for myself in the near future. I found an old but working spectrum analyzer at a Hamfest for $30 bucks. But i skipped it, much regret.

Oh yeah, make sure you get one hell of a pair of scope probes. One time I was designing a class A amplifier and adjusting its outut gain, I was getting garbage on the end, you know rf pickup and unstable waveform. I though it was my theory that was wrong, but I got a few other airs and found out it was my probes. When I checked my waveform with good probes, I got a nice clean sine wave with my predicted voltage swing.
 
quixotron said:
What model is it?
Ya UTMonkey, tell us! :D I've always wanted to buy one, but have zero idea where to start.

I've looked at all the old scopes on Ebay over the years. Don't want to spend too much on that first one (the one you get to learn what you really needed), but I'm still lost.
 
futz said:
Ya UTMonkey, tell us! :D I've always wanted to buy one, but have zero idea where to start.

I've looked at all the old scopes on Ebay over the years. Don't want to spend too much on that first one (the one you get to learn what you really needed), but I'm still lost.

My advice if you're looking a decent, cost-effective(cheap), rugged o-scope would be to try a local hamfest. Alot of hamsters have good equipment for sale at bargain prices.

The new stuff, has all the latest dsp software and stuff and is really nice, but costs you your first born!

So that would be my game plan.
 
UTMonkey,
Sounds like you choose a good woman for a wife!!

I don't think there is too much to worry about with that small error. For now, just enjoy learning to play with your new toy!!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top