Code Monkey home page Code Monkey logo

hoo-way / oscilloscope_based_on_mcu Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 1.0 1.07 MB

The Oscilloscope Simulation System base on Silabs device EFM8UB1 is intended to bring a tool to sample ADC value and display it as waveform on a computer screen, Through a combination of hardware and software, it looks like a real oscilloscope.

License: GNU General Public License v3.0

C 42.37% C++ 2.59% Assembly 2.89% Python 52.15%
oscilloscope-simulation silabs-device-efm8ub1 silabs adc pyside2 c

oscilloscope_based_on_mcu's Introduction

Oscilloscope Simulation System

1 Introduction

The Oscilloscope Simulation System base on Silabs MCU device EFM8UB1 is intended to bring a tool to sample ADC value and display it as waveform on a computer screen, Through a combination of hardware and software, it looks like a real oscilloscope.

The software architecture of system consist of firmware running on EFM8UB1 STK and application running on a computer. The GUI application running on a computer is developed by python 2.7, pyside2, Qt5, and USBxpress library.

The hardware consists of a computer host and a EFM8UB1EK device, the EFM8UB1EK is connected with the computer with USB cable. Use EFM8UB1 to sample the adc voltage value, send the collected data to the host via USB. The block is illustrated below.

hardware architecture

2 Preparation

2.1 Install Python 2.7 32-bit

There are most of library made by Silabs is developed with Python 2.7 32-bit. Please download and install Python 2.7 32-bit, the download link is below. https://www.python.org/downloads/release/python-2715/

2.2 Install Pyside2 and Qt

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.

2.3 Firmware Programming

The compiled firmware is located directory Bin/, program the Hex file to Silabs device EFM8 Universal Bee Starter Kit (SLSTK2000A) to make it as a oscilloscope device. See more info about from Silabs device EFM8 Universal Bee Starter Kit https://www.silabs.com/products/development-tools/mcu/8-bit/slstk2000a-efm8-universal-bee-starter-kit

Connection

Connect the EFM8UB1EK device and a computer with USB cable.

2.4 Execute GUI application

Download the software/ to local and run the application with command below.

python.exe main.py

3 Overview GUI

Application starts with a login widget as shown below. The component 1 is device combobox which shows the connected EFM8UB1EK device, the component 2 is a pushbutton.

login

The device shown in combobox will be open and application jump to a main widget when the pushbutton is pressed.

main widget

District 1 is a canvas which used to display the waveform, when cursor is in this district the time and ADC value of cursor position will be shown.

District 2 is display district.They are zoom in pushbutton, zoom out pushbutton, enable ADC pushbutton and single trigger button from left to right in this district.

District 3 is used to control 3 LED on EFM8UB1EK device.

District 4 is used to enable channel, there are two channel available which routed to GPIO pin1.7 and GPIO pin1.2 respectively.

District 5 is frequency district, the sample frequency will be set to the value shown in combobox when the set pushbutton is pushed.

The current information will be shown in the district 6.

4 Start sampling

Suppose have all the required environments and equipment, you can start sampling by following the steps below.

  • Connect the device and host
  • Execute GUI application
  • Choose the required device in combobox and press enter button
  • Check the required channel
  • Choose the appropriate frequency and then press set button
  • Push the enable ADC button in district 2

After that, the waveform will be display in district 1.

5 Software development and functional development

In order to facilitate the later function expansion, a flexible protocol was developed.Every operation will be a 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, the third byte followed by value is length of value. The table shown below lists the command has been taken. If one want to develop a new command, he can just start with 0x60.

protocol table

6 Conclusion

The oscilloscope simulation system is used to sample analog voltage and show it as waveform. It provides two channel to sample the voltage signal, supports zoom out and zoom and is able to display voltage and time information on mouse cursor point. which make it looks like a real oscilloscope. It is significant tool to measure analog voltage for engineer.

oscilloscope_based_on_mcu's People

Contributors

hoo-way avatar

Stargazers

 avatar

Forkers

ng-designs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.