THE EASYSCOPE II - Own a Dual Channel Digital Storage OSCILLOSCOPE For
Only $85

Most every electronic hobbyist or technician would like to have their
own oscilloscope, but in most cases it is hard to justify the cost for
such a specialized piece of expensive equipment.  Most likely you own a
general purpose PC compatible computer and now for just $85.00 you can
build the EASYSCOPE II which converts your PC into a dual channel
digital storage oscilloscope.  Like an analog scope a digital storage
scope allows you to view electrical signals on a display.  Unlike an
analog scope a digital storage scope converts the input signal into
digital values by sampling the input signal using an A/D converter. 
This gives the digital storage scope several advantages over the analog
scope such as:

The ability to view a single sampling of the input signal.

The ability to display the waveform from both before and after a trigger
event. 

The ability to save data for later viewing or manipulation.

(Of course analog scope proponents will point out that the disadvantage
of a digital storage scope is that you do not see what is happening to
the input signal between samples.)

The EASYSCOPE II is a easy to build Digital Storage Oscilloscope (DSO)
attachment for PC compatible computers.  In addition to it's low cost it
has the following features:

- attaches to a PC's printer port no slots are needed.

- easily portable - the PC board is only 1.75 by 3.55 inches and can run
off of a 9 Volt battery.  Combined with a laptop it provides a portable
test station. 

- sample rates up to 35 Khz - depending on PC speed. 

- DVM feature for static voltage measurements.

- 3 Voltages ranges +/- 2.4, 6.0 and 12 Volts with 1X scope probe.

- can use a 10X scope probe for 3 additional ranges (+/- 24, 60 and 120 Volts).

- easy to use PC software. 

- you can customize the circuit for your applications.

How can we pack so much capability into such a small inexpensive package?

The circuit contains two sections an analog portion and a digital
portion.  At the core of the project is a PIC16C71 microcontroller.  The
PIC16C71 is more advanced then the PIC16C5x series controllers used in
many projects.  In addition to the standard PIC features the 16C71
includes a built in A/D (Analog to Digital) converter.  Let us look at
how the EASYSCOPE II works. 

THEORY OF OPERATION

The A/D in the PIC16C71 operates in the range of 0 to +5 Volts.  In
order to use the A/D with various input signal ranges including negative
voltages we must do some signal conditioning before our input signal
gets to the A/D.  The EASYSCOPE II has two input channels that require
signal conditioning before reaching the A/D.  The analog signal
conditioning for channel A consists of U1 the LF347 Quad Op Amp and the
DP3T switch along with several resistors.  The signal first must pass
through a 1 Meg resistor divider network (R4 and R5).  The signal is
picked off of the resistor divider at one of three points by SW1, these
points correspond to an attenuation of 0.5, 0.2 or 0.1 from the original
signal.  The signal is then feed into pin 3 of the LF347.  The amp is
set up in a non-inverting configuration.  The gain is equal to R6/R7 +
1.  A 2.5 Volt offset is injected into the signal at this point.  The
offset voltage is generated by voltage inverter U2, negative regulator
U5 and several passive components.  U2 along with C3 and C4 provides a
-9 volt source from the +9 volt power input.  The -9 volt signal is feed
into voltage regulator U5 to produce a stable -5.0 volt reference
voltage.  This reference voltage is divided by the resistor network
consisting of R1, R2 and trimmer R3 to give a reference in the ballpark
of -2.3 volts that can be adjusted using R3.  This reference voltage is
buffered using an Op amp stage and then feed into the inverting input,
Pin 2 of U1, through resistor R7.  With a 0 volt input signal the output
of the Op Amp at pin 1 should be about 2.5 volts.  With a negative input
signal the output would be less then 2.5 volts and with a positive input
signal the output is greater then 2.5 volts.  This output is feed
through R8 into the A/D input on the PIC16C71.  Zener diode D1 provides
overvoltage protection for the A/D input, it prevents the input voltage
from going over 5.1 volts and below -0.6 volts. 

As you can see from the schematic (Figure 1) the signal conditioning
circuit for channel B is a copy of the circuit for channel A, except
that there is no switch to select the range.  Channel B is set at the
+/- 12 Volt range on the PC board.  There are provisions for a jumper
block to be installed on the PC board to allow the same range selections
as channel A. 

The A/D converter within the PIC16C71 is set up to convert the analog
voltage at pins 17 (RA0) and 18 (RA1) into the corresponding digital
values from 0 to 255.  The PIC16C71's internal timer interrupt provides
a stable time base for sampling.  On each timer interrupt the A/D
converter is read, the value stored and a new A/D conversion is started. 
If the sample rate is set for 10 Khz then an A/D conversion must be
performed every 100 microseconds.  The timer interrupt would be set up
to interrupt every 100 microseconds.  In between interrupts the data is
transferred to the PC over the printer port.  The transfer occurs 4 bits
at a time using a REQ*/ACK* handshake. 

The interface to the PC Printer Port consists of a total of 10 signals;
5 are driven by the PC (inputs to the 16C71) and 5 are driven by the
PIC16C71 (inputs to the PC).  The interface signals are defined in Fig
1.  One of the signals from the PC controls the PIC's reset pin (MCLR*),
this allows the PC to reset the PIC at any time.  Three of the signals
coming from the PC are designated as MODE control, on a reset the PIC
reads the MODE signals to determine what mode to start up in.  The modes
include standard scope mode, DVM mode channel 0, DVM mode channel 1,
status/load time constant and toggle all outputs (debug) mode.  Four of
the PIC outputs are designated for data.  The remaining two signals are
the request and acknowledge handshake signals used for data transfers. 
Figure 2 has a timing diagram showing the data transfer from the
PIC16C71 to the PC in scope mode.  The transfer of each 4 bit nibble
starts with the PC asserting the REQ* signal.  The * indicates that the
signal is active low so asserting the signal means to make it a logic
low.  When the PIC has placed the data on the data pins, it asserts the
ACK* signal.  This indicates to the PC that the data is ready.  After
the PC reads the data it releases the REQ* signal (brings it high), to
indicate that the data has been read.  Upon seeing this the PIC releases
the ACK* signal.  The second 4 bit nibble of data is transferred in the
same manner except that the MODE A signal is set low during the
transfer.  The timing diagram in Figure 1 shows the complete transfer of
two byte of data using this REQ*/ACK* handshake. 

BUILDING THE EASYSCOPE II

The EASYSCOPE II is best built on a double sided PC board with plated
through holes.  You can make one from the diagrams provided (figures 3
and 4) or purchase one from the source in the parts list.  Use the parts
layout (figure 5) as a guide for parts placement.  Note that parts C7
and C12 shown in figure 5 are not installed.  R6 should be installed
upright with the body of the resistor next to U1 pin 2.  R12 should be
installed upright with the body of the resistor next to U1 pin 14.  The
SMT Cap C6 should be installed on the solder side of the board on the
pads between pin 5 and 14 of U3.  The use of scope probes and BNC
connectors are optional.  If you do not want to use a scope probe
connect clip leads to J1, J2 and J3.  The lead from J2 is the ground
clip and the lead from J1 is the channel A input signal and J3 is the
channel B input signal.  If you install a BNC connector install a jumper
from J1 to the center contact on the BNC connector and a jumper from J2
to the ground connection on the BNC connector.  It is best to complete
and test the section of board containing U2, U4 and U5 before installing
U1 and U3.  Before installing U1 and U3 connect a power source (9 to 12
volts, a 9 volts battery is OK) to the power supply inputs on either
side of C1.  Measure the voltage at location U3 pin 14, it should be +5
volts.  Measure the voltage at U1 pin 4 it should be the same as the
power source (+9 to +12 volts).  Measure the voltage at U1 pin 11, it
should read about the same as pin 4 but the opposite polarity (-9 to -12
volts).  Measure the voltage at U1 pin 5, it should be about -2.5 volts,
adjust this voltage using R3 to about -2.3 volts. 

Once the voltages are all correct, power down and then you can install
U1 and U3 (sockets are recommended).  Copy the EASYSCOPE II software on
to your PC.  Connect the EASYSCOPE II to your desktop PC's printer port
using a short (3 to 6 foot) DB25 MALE to MALE cable.  Do not use the
EASYSCOPE II with your laptop until you have tested it, an assembly
error in the EASYSCOPE II could damage your laptop's printer port. 
Connect the power supply to the EASYSCOPE II and start the program
EASYSCII on the PC.  At first it may display a message indicating it
could not find the configuration file, that is OK press any key to clear
that message.  The menu should now be displayed as in Figure 6.  Select
option F8 - CONFIGURE.  Answer the question about which printer port you
are connected to (LPT1 or LPT2), with a 1 or 2 followed by an enter. 
You will then be prompted for color selections for channel A, channel B
and the grid color.  Enter the desired color values using the table in figure 7 as a
reference.  The colors can be changed at any time later.  This will
generate a new config file.  Next, select option F1 - DVM mode.  The
program should now display a heading, the A/D reading for channel B and
then the voltage range (2.4, 6 or 12), the A/D reading in hex and the
voltage reading for channel A.  Short the channel A input to ground to
give 0.0 volts as an input signal.  Switch SW3 on the EASYSCOPE II
board, the voltage range display should switch to match.  Set the
voltage range to 2.4 volts (L on the EASYSCOPE II switch).  Adjust the
trimmer R3 until the channel A A/D reading is steady at 7F and the
voltage reading is 0.0 volts.  If you short the channel B input to
ground, the A/D reading for channel B should also be 7F.  You can test
the A/D operation for each channel by connecting the inputs to a
battery.  The reading should change according to the battery voltage. 
At this point the EASYSCOPE II setup is complete. 

RUNNING THE EASYSCOPE II

During the EASYSCOPE II set up you've already used the DVM mode, so that
needs no further explanation.  The scope operation has many more
options.  F2 selects the EASYSCOPE II's mode of operation from
CONTINUOUS, SINGLE or NORMAL.  It also selects the number of active
channels (1= A only, 2 = A&B).  In CONTINUOUS mode, the easy scope will
continuously sample the input signals and update the display, the
trigger is not used.  In SINGLE sweep mode, the EASYSCOPE II will
acquire and display a single sampling of the input signals using the
trigger.  In NORMAL mode, the EASYSCOPE II will acquire and display data
using the trigger, like a sweep triggered analog scope.  F3 allows you
to set a trigger voltage level.  F4 allows you to set the trigger slope
as + or -.  F5 allows you to select the position of the trigger in the
acquired data in increments of 1/8.  A selection of 0/8 means that all
the displayed data will be from after the trigger, this is just like an
analog scope.  A selection 3/8 would mean that 3/8 of the data displayed
would be from before the trigger and 5/8 would be from after the
trigger.  Option F6 allows you to set the acquisition period in
microseconds.  Option F7 starts the scope mode, the data is displayed on
the graphics screen.  Figure 8 shows a single sweep capture of a 60 hz
sinewave on channel A and the same signal after passing through a diode
on channel B (half wave rectifier), in this case the trigger level was
-2 volts, the trigger slope was + and the trigger position was 0/8.  You
can see that at the left edge of the displayed waveform the signal
channel A has cross above the -2 volt level, this is the trigger point. 
With a little bit of practice it is easy to set up the EASYSCOPE to
acquire the waveforms of interest.  To exit from the DVM or ACQUIRE mode
just press the ESC key. 

WRAPPING UP

The EASYSCOPE II is an inexpensive and flexible test tool. It gives you
the chance to work with a Digital Storage Oscilloscope at a fraction of the
cost of a stand alone scope. If you have questions or suggestions feel
free to EMAIL or call me at ALTA ENGINEERING and to visit the ALTA
ENGINEERING web site.

Robert G. Brown
(860) 489-8003
EMAIL alta@gutbang.com
http://www.gutbang.com/alta

