digital oscilloscope

  • View
    819

  • Download
    2

Embed Size (px)

Text of digital oscilloscope

PC-BASED DIGITAL OSCILLOSCOPE

MAIN PROJECT REPORT ON

PC-BASED DIGITAL OSCILLOSCOPE USING PIC MICROCONTROLER

1|Page

Department Of Electronics and Communication Engineering

PC-BASED DIGITAL OSCILLOSCOPE

ABSTRACT

The digital oscilloscope attempts to achieve the same functionality as a traditional oscilloscope, using a PIC microcontroller for data acquisition (including appropriate analogue circuitry) which transfers the data to the PC (via USB). A Microsoft Windows based software application will then display the waveform as it would appear on a tra ditional CRT oscilloscope. This software application will have additional features not present on a traditional oscilloscope (e.g. printing / saving waveforms) with greater flexibly as additional features can be added as their developed without the need fo r new hardware. Additional function is added in the circuitry such as MULTIMETER MODE which enables the PC-scope to measure the circuit parameters like capacitance, resistance, current and voltage of the required component.

2|Page

Department Of Electronics and Communication Engineering

PC-BASED DIGITAL OSCILLOSCOPE

TABLE OF CONTENTS1. INTRODUCTION ............................................................................................ 4 2. FUNDEMENTALS ........................................................................................... 52.1 THE BASIC CRT OSCILLOSCOPE ................................ ................................ ........................... 5 2.2 DIGITAL SAMPLING OSCILLOSCOPES ................................ ................................ .................. 7 2.3 THE PIC MICROCONTROLLER................................ ................................ .............................. 82.4 UNIVERSAL SERIAL BUS INTERFACE ................................ ................................ .................

10

3. THE PIC18F2550 MICROCONTROLLER ........................................................ 113.1 OVERVIEW OF THE 8-CHANNEL 10-BIT ADC ................................ ................................ ........ 12 3.2 OVERVIEW OF THE HID USB PERIPHERAL................................ ................................ ............ 13

4. HARDWARE DEVELOPMENT ...................................................................... 145.1 SIMPLIFIED BLOCK DIAGRAM ................................ ................................ ............................. 14 5.2 DESCRIPTION ................................ ................................ ................................ ..................... 15 5.3 DIGITAL CIRCUIT DIAGRAM ................................ ................................ ............................... 18 5.4 FLOWCHART ................................ ................................ ................................ ...................... 19

5. THE SCOPE PROGRAM ................................................................................ 206.1 PIC PROGRAMME ................................ ................................ ................................ .............. 20 6.2 VISUAL BASIC PROGRAM CODE ................................ ................................ ......................... 23

6. FUTURE WORK ........................................................................................... 31 7. SUMMARY AND CONCLUSION .................................................................. 32 8. REFERENCES ............................................................................................... 34

3|Page

Department Of Electronics and Communication Engineering

PC-BASED DIGITAL OSCILLOSCOPE

INTRODUCTION

An oscilloscope is a type of electronic test instrument that allows signal voltages to be viewed, usually as a two-dimensional graph of one or more electrical potential differences (vertical(Y) axis) plotted as a function of time or of some other voltage (horizontal(x) axis). Although an oscilloscope displays voltage on its vertical axis, any other quantity that can be converted to a voltage can be displayed as well. In most instances, oscilloscopes show events that repeat with either no change, or change slowly. The oscilloscope is one of the most versatile and widely -used electronic instruments. Oscilloscopes are commonly used when it is desired to observe the exact w ave shape of an electrical signal. In addition to the amplitude of the signal, an oscilloscope can show distortion and measure frequency, time between two events (such as pulse width or pulse rise time), and relative timing of two related signals. Some mod ern digital oscilloscopes can analyze and display the spectrum of a repetitive event The digital oscilloscope attempts to achieve the same functionality as a traditional oscilloscope, using a PIC microcontroller for data acquisition (including appropriate analogue circuitry) which transfers the data to the PC (via USB). A Microsoft Windows based software application will then display the waveform as it would appear on a traditional CRT oscilloscope. This software application will have additional features no t present on a traditional oscilloscope (e.g. printing / saving waveforms) with greater flexibly as additional features can be added as their developed without the need for new hardware. Additional function is added in the circuitry such as MULTIMETER MODE which enables the PC-scope to measure the circuit parameters like capacitance, resistance, current and voltage of the required component. Digital oscilloscopes have two main advantages over traditional analogue scopes: 1. The ability to observe slow and very slow signals as a solid presentation on the screen. Slow moving signals in the 10-100 Hz range are difficult to see and measure on a normal analogue oscilloscope due to the flicker of the trace and the short persistence of the spot on the screen. 2. The ability to hold or retain a signal in memory for long periods. The PIC microcontroller has a built-in ADC (8, 10 or 12 bits) which has a voltage range of 0 to 5V. This voltage range is not ideal as most oscilloscopes have a much wider voltage range including negative voltages (e.g. -100 to 100V); hence an analogue circuit is required to reduce the voltage positivee signals so they fall between 2.5 and 5V and voltage negative signals between 0 and 2.5V (i.e. bipolar). The built-in ADC on the PIC is slow and will limit the maximum sampling frequency; hence an external Flash ADC with direct memory access will be required to produce a high -performance digital storage oscilloscope (e.g. AD9070 10Bit, 100MSPS ADC)4|Page Department Of Electronics and Communication Engineering

1 FUNDEMENTALSTHE BASIC CRT OSCILLOSCOPE

An osc oscope draws its trace with a spot of light (produced by a deflectable beam of electrons moving across the screen of its CRT. Basically an oscilloscope consists of the CRT, a time base circuit to move the spot steadily from left to right across the screen at the appropriate time and speed, and some means (usually a Y deflection amplifier) of enabling the signal to deflect the spot in the vertical or Y direction.

This type of oscilloscope is known as a real-time oscilloscope. This means that the vertical deflection of the spot on the screen at any instant is determined by the Y input voltage at that instant. The basic oscilloscope is typically divided into four sections the display, vertical controls, horizontal controls and trigger controls The display is usually a CRT or LCD panel . which is laid out with both horizontal and vertical reference lines referred to as the graticule. In addition to the screen, most display sections are e uipped with three basic controls, a focus knob, an intensity knob and a beam finder button. The vertical section controls the amplitude of the displayed signal. This section carries a Voltsper-Division (Volts Div) selector knob, an AC/DC/Ground selector switch and the vertical (primary) input for the instrument. Additionally, this section is typically e uipped with the vertical beam position knob.

5|Page

De

rtme t f le tr

i

mm

i ti

i eeri

PC-BA

DIGITAL OSCILLOSCOPE

PC-BASED DIGITAL OSCILLOSCOPE

The horizontal section controls the time base or sweep of the instrument. The primary control is the Seconds -per-Division (Sec/Div) selector switch. Also included is a horizontal input for plotting dual X -Y axis signals. The horizontal beam position knob is generally located in this section. The trigger section controls the start event of the sweep. The trigger can be set to automatically restart after each sweep or it can be configured to respond to an internal or external event. The principal controls of this section will be the source and coupling selector switches. An external trigger input (EXT Input) and level adjustment will also be included. In addition to the basic instrument, most oscilloscopes are supplied with a probe as shown. The probe will connect to any input on the instrument and typically has a resistor of ten times the 'scope's input impedance. This results in a .1 (-10X) attenuation factor, but helps to isolate the capacitive load presented by the probe cable from the signal being measured. Some probes have a switch allowing the operator to bypass the resistor when appropriate.

6|Page

Department Of Electronics and Communication Engineering

PC-BASED DIGITAL OSCILLOSCOPE

DIGITAL SAMPLING OSCILLOSCOPESDigital sampling oscilloscopes use an ADC (analogue-to-digital converter) to converter analogue voltages to binary representation. The sampling rate specifies the number of samples taken per second. Figure demonstrates clearly how an analogue wave form is digitally sampled and displayed onto the screen (LCD, Computer Monitor, et