Openscope MZ Workshop - Analog Parts Kit

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 72

Digilent

OpenScope MZ
Workshop
Workshop Agenda
• Introduction to OpenScope MZ
• Set up OpenScope MZ + WaveForms Live
• Take your first measurement
• Using OpenScope MZ with Arduino - measure servo PWM
• Using OpenScope MZ with Analog Circuits - measure R+C circuit
• Open source resources for OpenScope
• Where to find more information
Expectation Setting
This workshop is designed to help you understand basic usage of the
OpenScope MZ. This is ideal for beginners and first time Oscilloscope
users. We will not be doing in-depth coverage of hardware design or
the software development.
Required Materials:
• For this Workshop you will need:
• Some capacitors and resistors
• A breadboard
• Some breadboard wires or pin headers
• A micro USB cable
• An OpenScope MZ
• A servo
• An Arduino
• A USB type B cable
• The capacitors, resistors, breadboard, and breadboard wires are all found
in the Analog Parts Kit, so I’ll be using components from that kit.
What is
OpenScope
MZ?
• Multi-function oscilloscope to help
you visualize what is going on with
your circuits.
• It includes: Oscilloscope,
Waveform Generator,
Programmable Power Supply,
Digital I/O, and Data Logger.
• It has a Wi-Fi or USB interface and
connects to a browser-based user
interface called WaveForms Live.
Features: $89.00
USD
• 2 oscilloscope channels with 12 bits at 2
MHz bandwidth and 6.25 MS/s max
sampling rate
• 1 function generator output with 1 MHz
bandwidth at 10 MS/s update rate
• 10 user-programmable pins configurable
as either user-programmable GPIO or as a
10-channel logic analyzer. 
• User-programmable power supplies
supplying up to 50mA and ± 4V
• USB bus powered
• On-board Wi-Fi
• Browser-based
WaveForms Live multi-instrument software
• Re-programmable through Arduino IDE or
Microchip MPLAB X IDE
What Makes an OpenScope MZ Work?
• Hardware​
• PIC32MZ, MRF24 Wi-Fi radio, USB/serial, microSD, analog circuits, flywires​
• Firmware​
• Instrument operation, calibration, communication, Wi-Fi, storage​
• Waveforms Live (WFL)​
• Browser-based UI (local and remote internet)​
• Native iOS and Android Apps​
• Digilent Agent (DA)​
• USB/serial communication, setup, local/remote internet connectivity
• Not required once Wi-Fi is setup
Multimeter vs Oscilloscope
Multimeters are slow sampling devices that
display a single value, which is typically the
average of several samples.  

Oscilloscopes are fast sampling devices that


display many samples as a waveform. 
For example, a square wave measured on a
DMM would result in a single voltage with no
information about the actual waveform while
a square wave measured on an oscilloscope
would provide a waveform which can be used
to calculate the minimum and maximum
voltages, period, and duty cycle.
Let’s Get Started
Materials
Needed:
• OpenScope MZ
• Micro USB cable
• Analog Parts Kit
Open the Analog Parts
Kit
What’s Included In the Analog Parts Kit?
Unbox Your OpenScope
MZ
Walk Around the OpenScope MZ
PIC32MZ2048EFG124 PIC32MZ2048EFG124

MUX Select: Protocol I/O:


- 4 GPIO - 1 SPI / UART
- 1 I2C
- 5 GPIO
• The core of the OpenScope MZ is the
Channel 1 / 2:
- 2 OC/PWMs - 1 DMA
- 3 TMRs - 2 OC/PWMs
PIC32MZ processor. - 4 DMAs
- 4 Ded. ADCs
- 1 TMR
- 2 INTs

• The OpenScope MZ uses almost every PGM Button Logic Analyzer:


- 10 GPIO
Reset Button
resource available.   High Precision
- 1 TMR Shared
- 1 DMA Shared
- 1 INT
• Details on how the firmware was built and
3V Ref

DC Generators: Triggering:
what resources are used are available on - 5 OC/PWMs
- 2 TMRs
- 2 GPIO
- 1 INT
our GitHub and documentation site. 8 Feedback ADC USB via UART:
- 2 DC - 1 UART
• A detailed overview of the design is - 1 AWG
- 5 Supply/Ref
- 2 DMAs

available on the Digilent YouTube channel. AWG:


uSD:
- 1 SPI
- 1 TMR Shared
- 1 DMA Shared WiFi:
- Port H - 1 SPI / INT
Detailed Hardware Guide
Available
LMV116 / Op
Amp TS3A5017 /
𝟏 𝟏 𝟑
PIC32MZ2048EFG124

MUX Select: Protocol I/O:


Port F
MUX
𝟏 𝟒 𝟖 𝟒𝟎 2 Ch
- 4 GPIO - 1 SPI / UART
- 1 I2C PIC32
MUX Channel 1 / 2: - 5 GPIO
Resource Usage
Analog - 2 OC/PWMs - 1 DMA
- 3 TMRs - 2 OC/PWMs Summary Table
Inputs
÷ - 4 DMAs - 1 TMR PWM / OC 9 of 9
Σ X - 4 Ded. ADCs - 2 INTs Timers 7 of 9
+/-20V
5
2 Ch 10 LA
2 Channels INTs 5 of 5
2 MHz BW 2 Offsets PGM Button Logic Analyzer: Inputs SPI 3 of 6
Button - 10 GPIO
Reset Button Port E
- 1 TMR Shared UART 2 of 6
5 DC Outputs from 10 MS/s

LM4040AIM3
High Precision - 1 DMA Shared I2C 1 of 5
DC PWMs 3V Ref - 1 INT DMAs 9 of 8
Outputs EXT Dedicated 4 of 5

2 Channels
- DC Generators: Triggering:
- 2 GPIO
Trigger ADCs
Shared 8 of 43
+ - 5 OC/PWMs
-4V to +4V - 1 INT ADCs
- 2 TMRs FTDI
MCP6H82 / (USB for Digital 2 of 6
LMV324IDT 5 PWM USB via UART: Compare
8 Feedback ADC Serial
- 2 DC - 1 UART COM) Digital 1 of 6
2 Ch Filters
- 1 AWG - 2 DMAs
+/-3V - 5 Supply/Ref
uSD:
+/-1.5 Offset AWG - 1 SPI uSD
1 Channel AWG:
10 MS/s R2R - 1 TMR Shared
10 bit
AWG
Σ Ladder Port H
- 1 DMA Shared WiFi:
MRF24
WiFi
- Port H - 1 SPI / INT
Output MCP6H91
Download, Install,
and Open the
Digilent Agent
• The Digilent Agent is a service that
runs in the system tray on
Windows, Mac, or Linux and
enables WaveForms Live to
communicate with Digilent
hardware. The Digilent Agent
makes it easy to update the
OpenScope MZ's firmware,
configure Wi-Fi, and calibrate the
instruments.
• It will run in your system tray (in
the background).
Go to http://digilentinc.com/digilentagent
Install the Digilent Agent

Mac Instructions: https://reference.digilentinc.com/reference/software/digilent-agent/install-mac


Windows Instructions: https://reference.digilentinc.com/reference/software/digilent-agent/install-windows
Connect your flywires to the OpenScope MZ
Connect the Micro
USB cable to the
OpenScope MZ and
to your computer
Visit www.waveformslive.com
Click “Add Device” to add your OpenScope MZ
1. Select Agent (This will setup the connection over USB)
2. Hit the Add (+) button
Select the serial port that the OpenScope is connected to and click “Open”

If multiple serial ports show up, unplug the OpenScope and see which goes away, then
plug it back in and use the COM port that disappeared then reappeared.
Firmware update may be required
Select most recent Firmware and
update.
Calibration will be required
Take out two
breadboard wires.
Begin Calibration
• Connect DCOUT1 (solid red wire)
to OSC1 (solid orange wire).
• Connect DCOUT2 (solid white
wire) to OSC2 (solid blue wire)
Save Calibration to Flash and Hit Done
Click “Done” to exit the Configuration Menu
Go back to the Device Manager

This corner
button is the
Menu. Select
Device
Manager
Take your first measurement
These dots are the
more button. This is
where you’ll open the
Configuration Menu.
Click your device tile - A new
tile appears when a new
OpenScope connection is
made

Note: If you change your


OpenScope USB port, you will
need to re-numerate by using
the configuration menu.
Clicking the device tile will open the Instrument Panel.
Note that the pinout diagram is accessible from the Instrument Panel
This corresponds to the flywire colors, you can access it at any time.
Use a breadboard wire and connect OSC1 to AWG1
(Oscilloscope Channel 1 to Arbitrary Waveform Generator Channel 1)
Turn on the Waveform Generator

The buttons turn


from grey to a
color when turned
on.

(Oscilloscope Ch 1
is turned on by
default)
Click “Run”
Take a Moment to test out the Plot Settings

Click the + or – to change


the time per division

Click the + or – to change


the volts per division

Click the + or – to change


the offset
WaveForms Live and OpenScope MZ Tips
• You will need to stop the acquisition before changing some of the settings.
• Make sure to turn ”on” instruments you want to use and “off” instruments that are not being
used. Some Instruments cannot be used concurrently. For example, the Logic Analyzer and
Waveform Generator, the Logic Analyzer and Data Logger, and the Oscilloscope and Data Logger.
• The LEDs indicate the status of the OpenScope
• Blue Off - Device is booting and not ready to use.
• Blue Flashing - Device is booted and ready to use but Wi-Fi is not connected.
• Blue Solid - Device is booted and ready to use and Wi-Fi is connected.
• The three other LEDs blink the last octet of the OpenScope MZ's IP Address.
• Red Solid - Calibration or acquisition in progress.
• All user LEDs Solid - An error has occurred. Reboot the OpenScope MZ.
• When connected to a Wi-Fi network, the 3 user LEDs display the last octet of the OpenScope MZ's IP address
by blinking the number of times corresponding to that digit of the last octet in decimal. For example,
an OpenScope MZ with an IP address ending in '123' would blink LD1 once, LD2 twice, and LD3 three times. 
Measuring an
Arduino Servo Signal
Triggers and Cursors
Materials
Needed:
• Everything from Setup
(OpenScope, micro USB, wires)
• Breadboard (from Parts Kit)
• Servo
• Arduino
• USB-B Cable
• Mini Grabbers (Optional)
Unbox and • Connect the Arduino to your Computer.
Your Arduino will need to be programmed with the
Plug In Your Servo-Sweep Example

Arduino
Verifying Your
Servo Signal
• This exercise will let you verify
what the signal looks like from an
Arduino PWM pin.
• Connect your Servo to your
Arduino using breadboard wires.
• Orange servo wire – Pin 9
• Red servo wire – Power 5V
• Black/Brown servo wire –
GND
• The servo should be in SWEEP
mode
PWM
• The Arduino implements a PWM signal, which is a square wave with a
duty cycle that can range from 0% to 100%
• We will use WaveForms Live and the OpenScope MZ to see exactly
how long the duty cycle is on, what voltage, and duration.
Connect the
OpenScope MZ
to the Arduino
• Disconnect the Servo
• Remember, the PWM Signal for
the Servo is on Pin 9 of the
Arduino.
• Use a breadboard wire, connect
OSC1 (Orange Wire) to Pin 9
Grounding the
Oscilloscope Channel
Anytime you use your Oscilloscope channel, you need to have
an analog ground connected. In the previous exercise when we
tied AWG1 to OSC1, the signal and the scope have the common
ground (the OpenScope ground). Since the Arduino is on a
different circuit, the OpenScope MZ needs to know its ground in
order to correctly measure the signal. Let’s demonstrate this:
• Plug a breadboard wire into the OpenScope analog ground
(orange or blue with white stripe) and plug it into one of the
Arduino ground pins.
• Click the button below the pinout button to reset the device
to the default settings.
• Hit “Run”.
What happens if the circuit is not grounded correctly?
Unplug the ground wire

If you unplug
your ground wire
you might see a
variety of
behavior. For my
servo, the 0 is not
displayed
correctly because
the Arduino
ground is
different than the
OpenScope
ground.
Adjust the signal on the screen
• The Arduino outputs 5V signals. We suggest “zooming out” so you
have the signal cleanly on your screen.

“Volts/” will allow you to change the Y Scale of the graph.


Offset will allow you to move where 0 is.

Offset Volts
changed changed
only only
Best Fit
• It’s important to make sure
that the screen is “focused” on
the part of the waveform with
the information we need.
• For this exercise we are
interested in what happens
when the signal goes high, so
the top of the waveform needs
to be seen.
• Change your Volts/ Division to
1.00 V and Offset to 1.5 V (you
can scroll or type it in). You can
also type in mV instead of V.
Trigger
• Waveforms that vary with time will
look unstable (bouncing around)
on an Oscilloscope. Triggers
stabilize the signal and hold it in
one place on the screen.
• By default, WaveForms Live has a
rising edge trigger in place. Let’s
see what the signal looks like if
you take the trigger off.
• Stop the Signal acquisition
• Click OFF for Triggers
• Then Hit RUN
That was wild,
turn the Trigger Back On!
Cursors
• Cursors are a way in which you can set points
of interest on a screen and display the exact
value.
• WaveForms Live allows you to put single
cursors on Time, Voltage, or Track.
• We will be using Time and Voltage.

Time – We’ll use this to see if the PWM signal


has a consistent duty cycle
Voltage – We’ll use this to see what Voltage the
PWM signal peaks at.
Test out
cursors
• Hit SINGLE to capture a single
acquisition of the waveform
• Turn on Cursors, select Time
• Line the cursors up with the edges
of the signal by moving the dotted
lines at the top of the graph
• Pay attention to the calculations to
the right of the cursors button
• Follow the same procedure for
Voltage
Math Functions
• Math Functions are
built into WaveForms
Live. These allow you to
see the Frequency, Peak
to Peak Voltage and
more. Put the scope in
RUN mode and watch
the values change.
Play around, ask
questions. If you have the
Arduino IDE, reprogram
the sketch and try new
things!
A note on programming:
Your Arduino should be pre-programmed with the default SERVO
Sweep example.
To do this, please go to the Arduino IDEExamples Servo
Sweep

When selecting your board, MAKE SURE it is on a different COM


Port than your OpenScope MZ.

If you get an error in programming the Arduino – unplug the


OpenScope MZ, put the Arduino in that USB Port. Program the
Arduino, then, plug the OpenScope MZ back into a different USB
Port Configure  Re-enumerate
This should resolve the conflict.
Analog Circuits
Measure RC Circuit
Materials Needed

• One 1 k-Ohm resistor


• One 10 nF capacitor
• One breadboard
• Breadboard wires
The Circuit The Circuit Schematic
The Setup
Set up your circuit with the OpenScope MZ
Software Settings
You may need to adjust the Settings
• Time 35 us/div
• Trigger
• Rising edge
• Osc Ch 1
• 500mV
• Osc Ch 1
• Volts 500mV
• Offset 0V
• Wavegen
• Square wave
• Frequency 3 kHz
• Amplitude 3 Vpp
• DC Offset 0V
Turn on the AWG and hit “Run”, you should see the following:
Theory
• The circuit we built in this exercise is a first order RC circuit. The Square wave
simulates turning on and off power, and what you see is the charging and
discharging of the capacitor. In technical terms, we are seeing the Natural and
Forced Responses of the circuit. If you are interested in more theory and
equations, go to Real Analog Chapter 7.
Forced Response Natural Response

Discharging
Charging the Capacitor the Capacitor
A note on the OpenScope MZ Grounds
All circuits need to be completed to work. When using an oscilloscope
with differential probes, both probes must be connected to complete
the circuit. The oscilloscope channels on OpenScope MZ are single-
ended, therefore an OpenScope MZ ground wire must be used to
complete the circuit. OpenScope MZ was designed so that the ground
wire closest to each oscilloscope channel will provide the best results.
Resources
OpenScope MZ was made as Open Source
as possible!
• Hardware​
• Schematic
• Mechanical files
• Firmware​
• Arduino IDE and MPLAB X
• WaveForms Live (WFL)​
• Browser-based UI (local and remote internet)​
• Native iOS and Android Apps​
On GitHub
• Digilent Agent (DA)​
• USB/serial communication, setup, local/remote internet connectivity
Visit OpenScope MZ
and WaveForms Live
Resource Center
• Visit http://digilentinc.com/openscope
• Scroll to “Resource Center”
• This will be your central location for all
OpenScope MZ related references.

• Alternatively, you can go to


waveformslive.com
• Hit the Home Button
• Select “Documentation”
Questions?
Post on Forum.digilentinc.com

You might also like