Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 30th December 2007, 11:18 PM   (permalink)
Default Got an oscilloscope for Xmas!

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
UTMonkey is offline  
Old 30th December 2007, 11:59 PM   (permalink)
Default

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.
HarveyH42 is online now  
Old 31st December 2007, 12:01 AM   (permalink)
Default

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.
Salgat is offline  
Old 31st December 2007, 12:06 AM   (permalink)
Default

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.
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
Hero999 is offline  
Old 31st December 2007, 12:21 AM   (permalink)
Default

If you are using a Microchip design, the OSCCAL register can be used to adjust the internal RC frequency. See: http://ww1.microchip.com/downloads/e...Doc/31002a.pdf
John
jpanhalt is offline  
Old 31st December 2007, 12:54 AM   (permalink)
Default

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.
speakerguy79 is offline  
Old 31st December 2007, 01:58 AM   (permalink)
Default

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.
__________________
Uncle $crooge
audioguru is offline  
Old 31st December 2007, 02:36 AM   (permalink)
Default

Quote:
is my scope at fault?
What scope do you have? Is it analog or digital? Typical analog scope timebases are between 1 and 5% accurate. Your 0.5% is probably very good.
mneary is offline  
Old 31st December 2007, 03:01 AM   (permalink)
Default

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.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 31st December 2007, 04:19 AM   (permalink)
Default

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

Good ol 555 timer!
Krumlink is offline  
Old 31st December 2007, 04:35 AM   (permalink)
Default

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
__________________
All my pencils *used* to have erasers!
kjennejohn is offline  
Old 31st December 2007, 10:57 AM   (permalink)
Default

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
UTMonkey is offline  
Old 31st December 2007, 11:30 AM   (permalink)
Default

What make and model is it then?.

And if I need access to a digital scope I know where to come!
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 31st December 2007, 02:35 PM   (permalink)
Default

"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
__________________
Dean Huster, Electronics Curmudgeon
Contributing Editor emeritus, "Q & A", of the former "Poptronics" magazine (formerly "Popular Electronics" and "Electronics Now" magazines).

R.I.P.
Dean Huster is offline  
Old 31st December 2007, 02:58 PM   (permalink)
Default

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.
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
Hero999 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
The Oscilloscope ElectroMaster Electronic Theory 12 3rd February 2008 02:45 PM
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 10:49 PM
Digital and analog oscilloscope patroclus General Electronics Chat 34 12th July 2006 03:34 AM
Oscilloscope DL1620/DL1640/DL1640L tkvenki General Electronics Chat 0 10th January 2006 01:37 PM
buy DSO Oscilloscope peterpeter General Electronics Chat 4 21st November 2002 06:36 PM



All times are GMT. The time now is 01:35 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker