The Oscilloscope Simulation System based on EFM8UB1 works as a tool to sample an ADC value and display it as waveform on a computer screen. Although it is a combination of hardware and software, it looks like a real oscilloscope.
The software architecture of this system consists of firmware running on EFM8UB1 STK and an application running on a computer. The GUI application running on the computer was developed using python 2.7, pyside2, Qt5, and the USBxpress library.
The hardware consists of a computer host and an EFM8UB1EK device. The EFM8UB1EK is connected to the computer with a USB cable. You can use EFM8UB1 to sample the ADC voltage value and, send the collected data to the host via USB. The block is illustrated below.
Most of library made by Silicon Labs was developed with Python 2.7 32-bit. Please download and install Python 2.7 32-bit. Here is the download link: https://www.python.org/downloads/release/python-2715/
Official release wheels of Qt for Python can be installed regularly via pip:
pip install pyside2
Pre-release (snapshot) wheels containing the latest code changes are available at http://download.qt.io/snapshots/ci/pyside/
For example you can install the latest 5.11 snapshot wheel using:
pip install --index-url=http://download.qt.io/snapshots/ci/pyside/5.11/latest/ pyside2 --trusted-host download.qt.io
See more info from http://wiki.qt.io/Qt_for_Python/GettingStarted.
The compiled firmware is located in the directory Bin/. Program the Hex file to EFM8 Universal Bee Starter Kit (SLSTK2000A) to make it as an oscilloscope device.
Connect the EFM8UB1EK device and a computer with a USB cable.
Download the software/ to your local device and run the application with the command below.
The application will start with a login widget as shown below. The component 1 is a device combobox that shows the connected EFM8UB1EK device, and the component 2 is a pushbutton.
The device shown in the combobox will be open, and the application will jump to a main widget when the pushbutton is pressed.
District 1 is a canvas which can be used to display the waveform. When the cursor is in this district, the time and ADC value of cursor position will be shown.
District 2 is the display district. The buttons in this district are the zoom in pushbutton, the zoom out pushbutton, the enable ADC pushbutton, and the single trigger button from left to right.
District 3 is used to control 3 LED on the EFM8UB1EK device.
District 4 is used to enable channels. There are two channels available: the routed to the GPIO pin1.7 and the GPIO pin1.2 respectively.
District 5 is the frequency district. The sample frequency will be set to the value shown in the combobox when the set pushbutton is pushed.
The current information will be shown in district 6.
Once you have all the required environments and equipment, you can start sampling by following the steps.
After that, the waveform will now display in district 1.
In order to facilitate continued function expansion, a flexible protocol was developed. Every operation is an item of command which consists of preamble byte, command byte, value length and value. The preamble byte is a fixed value 0xAA, the command byte shows the specific operation, and the third byte followed by a value is the length of the value. The table shown below lists the command that have been taken. If you want to develop a new command, you can start with 0x60.
The oscilloscope simulation system is used to sample analog voltage and show it as waveform. It provides two channels to sample the voltage signal, supports zoom out and zoom in, and can display voltage and time information on the mouse cursor point, making it look like a real oscilloscope. It is an important tool for measuring analog voltages for engineers.
The source code of the GUI tool and firmware is attached for reference.