Differences between revisions 1 and 26 (spanning 25 versions)
Revision 1 as of 2017-10-07 13:21:29
Size: 4013
Editor: RudolfReuter
Comment:
Revision 26 as of 2018-07-22 03:46:19
Size: 22597
Editor: RudolfReuter
Comment:
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
There is now (Sept. 2017) a low cost (18 EUR) '''Digital Storage Oscilloscope''' (DSO shell) from company [[http://www.jyetech.com/Products/LcdScope/e150.php|JYE Tech]] available, e.g. [[http://banggood.com|banggood.com, search for Product ID = 1093865]].
 * '''Pros:''' nearly complete soldered kit with housing.
There is now (Sept. 2017) a low cost (18 EUR) '''Digital Storage Oscilloscope''' (DSO shell) from company [[http://www.jyetech.com/Products/LcdScope/e150.php|JYE Tech]] available, e.g. [[https://www.banggood.com/Orignal-JYE-Tech-DS0150-15001K-DSO-SHELL-DIY-Digital-Oscilloscope-Kit-With-Housing-p-1093865.html?rmmds=search&cur_warehouse=CN|Banggood.com, product ID: 1093865]].
 * '''Pros:''' nearly complete soldered kit (SMD) with housing.
Line 9: Line 9:
  * with modded software from [[http://www.jyetech.com/forum/viewtopic.php?f=19&t=1206#p4057|toshi]] with '''data export'''.
  * '''Portable operation''' possible, with battery pack (power consumption 120mA @ 9V}
  * with extended software from [[http://www.jyetech.com/forum/viewtopic.php?f=19&t=1206#p4057|toshi]] with '''data export'''.
  * Since firmware 113-15001-110 '''data export possibility''' is also included.
  *
'''Portable operation''' possible, with battery pack (power consumption 120mA @ 9V)
  * '''Good documentation''' - manual, schematics, firmware update
  * Use as a '''time recorder''' with maximum time of '''100 minutes''' on '''screen''' and '''320 minutes''' if you download the '''waveform data'''. The '''Trigger point''' is in the '''center'''.
Line 15: Line 18:
== Specifications == /!\ Since firmware '''version 113-15001-110''' it is necessary, to ask for an '''activation code''' via Email. You need to send the '''8 character code''' (board PID = PCB IDentity) which is on a '''bar-code label''' on the main PCB via Email to jyetek@gmail.com, asking for the '''activation code''' (4 digits). After several Power-On-Resets the software asks for the '''activation code'''. If you do not enter this number, the rotary encoder will appear malfunction.

/!\ you can '''magnify the pictures''' (and download) with a '''mouse click''' on it.


||<tablestyle="float: right;">[[attachment:DSO150_DSC07450.jpg|{{attachment:DSO150_DSC07450.jpg|attachment:DSO150_DSC07450.jpg|width="400"}}]] ||
=== Specifications ===
Line 18: Line 27:
   * Analog Bandwidth: 0 - 200KHz
   * Sensitivity: 5mV/Div - 20V/Div
   * Analog Bandwidth: 0 - 200 KHz
   * Sensitivity: 5 mV/Div - 20 V/Div
Line 23: Line 32:
   * Maximum Input voltage: 50Vpk    * Maximum Input voltage: 50 Vpk
Line 26: Line 35:
  * Max Real-time Sampling Rate: 1Msps
  * Timebase: 10us/Div - 500s/Div
  * Max Real-time Sampling Rate: 1 Msps
  * Timebase: 10 us/Div - 500 s/Div
Line 32: Line 41:
  * Trigger Position: 1/2 of buffer size fixed   * Trigger Position: 1/2 of buffer size, fixed
Line 35: Line 44:
 * '''Power suppy''':  * '''Power supply''':
Line 44: Line 53:
||<tablestyle="float: right;">[[attachment:Eagle6_exp-lbrs.ulp.png|{{attachment:Eagle6_exp-lbrs.ulp.png|attachment:Eagle6_exp-lbrs.ulp.png|width="468"}}]] ||
=== Bauteile in Library kopieren ===
Bei '''speziellen Bauteilen''' (devices) kann man im Internet oft einen Schaltplan finden, der das gewünschte Bauteil enthält, aber es gibt keinen '''Bibliothek File''' (library) dazu.

Um diese Aufgabe zu lösen, gibt es von der Firma Cadsoft seit circa 2006 eine '''ULP''' (User Language Program) mit dem Namen [[http://ftp.cadsoft.de/cgi-bin/download.pl?page=/home/cadsoft/html_public/download.htm.de&dir=eagle/userfiles/ulp|exp-project-lbr.ulp]], die es ermöglicht, die Bauteile aus einem Projekt (Schaltplan) in eine Bibliothek zu kopieren.

Ab der Eagle Version 6.4 wurde diese ULP umbenannt in [[http://www.element14.com/community/thread/21425/l/eagle-version-64-released|exp-lbrs.ulp]]. Ein Erklärung mit Bildern, in Englisch, gibt es [[http://slopjong.de/2012/12/06/eagle-extract-a-symbol-from-a-project-to-a-library/|hier]].

||<tablestyle="float: right;">[[attachment:Eagle6_exp-lbrs.ulp_mask.png|{{attachment:Eagle6_exp-lbrs.ulp_mask.png|attachment:Eagle6_exp-lbrs.ulp_mask.png|width="600"}}]] ||
In der Praxis sieht das so aus:
 * Man löscht in dem kopierten Schaltplan alle nicht gewünschten Bauelemente. Dann hat man nur noch die benötigten Bauelemente im Schaltplan.
 * Dann startet man '''exp-lbrs.ulp''' entweder mit '''run exp-lbrs.ulp''' in der Komandozeile, oder das '''ULP Icon''' anklicken, und die gewünschte ULP auswählen.
 * In der Zeile '''Pfad:''' den gewünschten Ordner auswählen, und abspeichern mit OK.
 * In diesem Fall sollte man dann die neue Bibliothek nennen '''con-usb-dual.lbr'''.
=== Modifications ===
In order to make the DSO more useful, '''three modifications''' are made.

||<tablestyle="float: right;">[[attachment:DSO150_USB-UART_DSC07467.jpg|{{attachment:DSO150_USB-UART_DSC07467.jpg|attachment:DSO150_USB-UART_DSC07467.jpg|width="400"}}]] ||
==== Rechargeable Battery Pack ====
On Ebay.de you can buy a '''6 x AA battery''' housing (ID number 162434646097, 1.6 EUR) with '''15 cm wires''' and an '''ON-OFF''' sliding switch.

To '''connect''' to the DSO150 you need a '''DC plug''' 5.5/2.1 mm (e.g. ebay.de ID no. 152190640539, for about 10 pc. 2 EUR).

/!\ Because of the '''low voltage''' (>7.6 V at 50% of the capacity of NiMH batteries) you need to short the '''inverse-polarity protection diode'''. See the '''picture''' on the right for the '''wiring'''. The '''voltage regulator''' 78L05 need minimum '''6.7 - 7 V''' for the voltage regulation.

The negative voltage is made by an '''ICL7660''', where 0.6 V are lost. So, 7.6 V - 0.6 V = 7.0 V. The '''79L05 regulator''' need a typical minimum of '''-6.7 V to -7.0 V''' for the ouput voltage of -5.0 V.

So, '''be careful''' to do '''not inverse the polarity''' of the power supply wiring.



||<tablestyle="float: right;">[[attachment:DSO150_USB-UART_cutout_DSC07478.jpg|{{attachment:DSO150_USB-UART_cutout_DSC07478.jpg|attachment:DSO150_USB-UART_cutout_DSC07478.jpg|width="400"}}]] ||
==== USB - UART Converter ====
In order to allow a '''firmware update''', or to capture '''waveform data''' via '''USB connection''' (needs toshi firmware 60B), you need to adopt an '''USB-UART converter'''. Fortunately you get on ebay.de (ID no. 381765079624) a little module which just fits into the DSO150 '''housing''', and has on the data lines the necessary '''3.3 V level'''. The USB plug is '''micro USB'''.

For the '''connection''' have a look at file '''DSO150_!HowToUpgradeFirmware.pdf''' from JYE Tech.

For '''mechanical fixation''' on the '''logic board''' I used '''hot glue''', see the '''picture''' on the right.

You also need to make a '''cutout''' in the lower part of the '''housing''' for the '''Micro-USB plug'''.



==== Jumpers ====
In order to make the '''firmware update''' easier, the '''solder jumpers J1 and J2''' are routed with wires to '''2mm spacing posts''', see the '''picture''' on the right. I am using '''wire-wrap wires''', because they are thin and have a good isolation.

||<tablestyle="float: right;">[[attachment:DSO150_jumper_DSC07463.jpg|{{attachment:DSO150_jumper_DSC07463.jpg|attachment:DSO150_jumper_DSC07463.jpg|width="400"}}]] ||
I have mounted the posts with '''hot glue''' to the board.

/!\ Take care about the '''position''', if you place the posts more to the right, the '''electrolyte capacitors''' of the '''analog board''' are in the way.


I have bought several units, unfortunately one of them could '''not''' be programmed (flashed).


For programming I used the freeware program [[https://sourceforge.net/projects/stm32flash/|stm32flash]] and used it under '''Mac OS''' and '''Ubuntu 1604'''.

For '''installing''' the program, see the next chapter.


=== Firmware Mod ===
A nice guy provides an extended '''firmware 60B'''. You can download the [[http://www.jyetech.com/forum/viewtopic.php?f=19&t=1206#p4057|software from toshi]] with source code (archiv 113-15011-60B.zip). The benefits are:
 * Show the '''trigger voltage''' in the '''lower right corner''' of the screen.
 * Allow a '''waveform data''' export via '''USB port''':
  * '''UART parameters''': 38400 baud, 8N1
  * The telegram is coded in '''ASCII''' and with '''Return + Line Feed''' at the line end.
  * 1st line has the '''time interval''' in '''seconds'''.
  * 1024 lines with the '''waveform data''' in '''volt'''.

 * Since JYE firmware 113-15001-110 '''data export possibility''' is also included.


==== Re-Programming DSO150 ====
I have bought three units, unfortunately one of them could '''not''' be programmed (flashed).

The '''Re-Programming''' under '''Windows''' is described in the file '''DSO150_!HowToUpgradeFirmware.pdf''' from JYE Tech.

For programming I used the freeware program [[https://sourceforge.net/projects/stm32flash/|stm32flash]] and used it under '''Mac OS''' and '''Ubuntu 1604'''.
 * '''Install under Mac OS''': Download the source archiv [[https://sourceforge.net/projects/stm32flash/files/?source=navbar|stm32flash-0.5.tar.gz]]
{{{
# Prerequisites MacOS: Program Xcode (App Store)
# Unpack archiv with mouse double click on the file stm32flash-0.5.tar.gz
$ cd stm32flash
$ make
...
$ sudo make install
...
install -d /usr/local/bin
install -m 755 stm32flash /usr/local/bin
install -d /usr/local/share/man/man1
install -m 644 stm32flash.1 /usr/local/share/man/man1
}}}

/!\ In order to use the '''USB - UART converter''' under '''Mac OS''' you need to install a '''driver''' from the manufacturer of the chip.
For the recommended chip '''CP2102''' it can be found at this [[https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers|Link]]

 * '''Install under Ubuntu 1604''': Download the source code and compile it.
The '''CP2102 driver''' is already on board.

The '''Re-Programming''' under '''Linux''' is explained in detail: [[http://www.jyetech.com/forum/viewtopic.php?f=19&t=1224|Step by Step: How to flash firmware from Linux]]. This must be done in the '''terminal'''.

 * The '''DSO150''' is connected via '''Micro USB''' cable with the '''PC'''.
{{{
# see if USB-UART (serial) converter is online.
# Ubuntu
$ ls /dev/ttyU*
/dev/ttyUSB0

# Mac OS
$ ls /dev/cu.SL*
/dev/cu.SLAB_USBtoUART

# If you see this, you are connected

# If there is an error you will see:
stm32flash 0.5

http://stm32flash.sourceforge.net/

Interface serial_posix: 115200 8E1
Failed to init device. # look for the jumpers J1,J2 and the Serial interface wiring
}}}


 * '''Read the CPU info''' to make sure the hardware works:
{{{
# Read STM32 Info:
$ stm32flash -b 115200 /dev/cu.SLAB_USBtoUART # Mac OS
or
$ stm32flash -b 115200 /dev/ttyUSB0 # Ubuntu 1604
tm32flash 0.5
http://stm32flash.sourceforge.net/
Interface serial_posix: 115200 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (STM32F10xxx Medium-density)
- RAM : 20KiB (512b reserved by bootloader)
- Flash : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB

# If you see this, the STM32 should be programmable.
}}}

 * '''unzip''' archiv '''113-15011-60B.zip''': you need file '''113-15011-060B.hex'''. I renamed it, to better remember the origin:
{{{
$ mv 113-15011-060B.hex 113-15011-060B_toshi.hex
}}}

 * '''Check for the firmware''', if the folder is not the '''working path''', change it.
{{{
# change directory to the folder with the toshi software
$ cd <folder> # path of the unzipped archiv 113-15011-60B.zip
$ ls
113-15011-060B_toshi.hex
# The file is in the working path - OK
}}}

 * '''Remove the Read !UnProtection''', you should do it '''only once'''.
{{{
# Mac OS
$ stm32flash -b 115200 -k /dev/cu.SLAB_USBtoUART
or
# Ubuntu
$ stm32flash -b 115200 -k /dev/ttyUSB0
....
Read-UnProtecting flash
Done.

# That is OK
}}}

 * '''Program (flash) the STM32'''
{{{
# the flashing was made with:
# Ubuntu 1604
$ stm32flash -b 115200 -v -w 113-15011-060B_toshi.hex /dev/ttyUSB0
or actual JYE firmware
$ stm32flash -b 115200 -v -w 113-15001-111.hex /dev/ttyUSB0
or
# Mac OS 10.12.6
$ stm32flash -b 115200 -v -w 113-15011-060B_toshi.hex /dev/cu.SLAB_USBtoUART
or actual JYE firmware
$ stm32flash -b 115200 -v -w 113-15001-111.hex /dev/cu.SLAB_USBtoUART
....
Write to memory
Erasing memory
Wrote and verified address 0x0800c814 (100.00%) Done.

# That was OK
}}}
Next you open '''Jumper J1 and J2''' and apply power (8 - 12 V) to the '''DSO150'''. On the '''greeting screen''' you should see the '''firmware version 60B''', or '''111'''.


 * '''sigrok Pulseview protocol analysis''' (about 3 ms after trigger (falling edge)).

The '''analysis''' of the '''serial protocol''' of the '''STM32''' is made with the software '''pulseview''', see [[http://www.rudiswiki.de/wiki9/SigrokDecoder|here]] for more details.

The software [[https://sigrok.org/wiki/Main_Page|sigrok]] is a portable, cross-platform, Free/Libre/Open-Source '''signal analysis software suite''' that supports various device types (e.g. logic analyzers, oscilloscopes, and many more). The '''download page''' is [[https://sigrok.org/wiki/Downloads|here]].
{{{
TXD = PC, RXD = STM32 (DSO150), data in hexadecimal
TxD 7F 01 FE 00 FF
RxD 79 79 22 00 00 79 79 0B 22 00 01 02 11 21 31 43 63 73 82 92 79
Data
TxD 02 FD
RxD 79 01 04 10 79
Data Device ID 0x0410
}}}




||<tablestyle="float: right;">[[attachment:DSO150_gnuplot_qt.png|{{attachment:DSO150_gnuplot_qt.png|attachment:DSO150_gnuplot_qt.png|width="400"}}]] ||
=== Waveform Visualization ===
OK, you can download the '''waveform data''', but how can you '''visualize''' it (see '''screen shot''' on the right)? The necessary steps are:
 1. '''Capture''' the '''waveform data''' to a '''text file'''.
  * Start the program first, '''waiting''' for the data.
  * Push the '''ADJ''' (toshi version) or '''ADJ+V/DIV''' button for the '''start''' of the '''data transmission'''.
 1. '''Convert''' the '''waveform data''' to a '''.csv''' (Comma Separated Values) file.
  * Take care to '''localize''' the '''decimal point''' ("." or ",").
 1. '''Visualize''' the '''.csv''' file data with the freeware program '''GNUplot'''.
  * Take care to include the actual '''Date & Time''' in the plot.
I liked to use a software which is '''cross platform''' (Linux, Mac OS, Windows), so I decided for the interpreter language '''Python'''.

The five major tasks in the software are:
 1. '''Wait''' up to 60 seconds for the start of the data transmission.
 1. '''Read''' the data into a list (in real time), then write all into a text file.
 1. '''Read''' the data file, then calculate the '''time row''', localize the '''decimal point''' and write the '''.csv''' file.
 1. '''Prepare a parameter file''' for program '''GNUplot'''. Add '''Date & Time'''.
 1. '''Call GNUplot''' with the '''parameter file'''.
  * The '''terminal command line''' looks like (toshi version):
  {{{
  $ python3 dso150_p23.py -pd
  or
  $ python dso150_p23.py -pd
  # option -p means capture data and write a .csv file
  # option -d means plot data with program GNUplot
  }}}
The program '''dso150_p23.py''' can be seen and downloaded [[attachment:dso150_p23.py|here]], for '''version 60B only'''.

'''GNUplot''' shows one goody in the '''lower left corner''' of the plot. It is the X-Y position of the '''mouse pointer''' in the '''coordinate system''', in '''application values''', in this case '''X=Time''' and '''Y=Volt'''. But this does '''not''' work on '''Windows 7/10'''.

==== GNUplot cross platform ====
[[https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.0/|GNUplot]] can be installed cross platform. The best '''font quality''', which works on all platforms, can be achieved with the graphic library '''QT5'''. You get more informations about the '''terminal qt''' on the command line:
{{{
$ gnuplot
gnuplot> help terminal qt
gnuplot> quit
}}}
Unfortunately finding the '''usable fonts''' is not so easy and very '''terminal''' and '''operating system''' dependent. From GNUplot you can get one hint:
{{{
$ gnuplot
gnuplot> show fontpath
gnuplot> quit
}}}
The default '''font size''' in GNUplot '''terminal qt''' has a size of '''9 points'''. In Windows this is OK, but for '''Linux''' and '''Mac OS''' this is increased to '''12/14 points''' for a good readability.

'''Installation:'''

 * '''Mac OS''': install with [[https://brew.sh/index_de.html|Homebrew]]:
{{{
$ brew update
$ brew doctor # check for errors

$ brew install gnuplot --with-qt
or
$ brew (re)install gnuplot --with-qt # in my case gnuplot was already installed with X11
==> Summary
🍺 /usr/local/Cellar/qt/5.9.1: 9,019 files, 278.0MB
}}}

 * '''Ubuntu 1604''': In '''Terminal''' type:
{{{
$ sudo apt-get install gnuplot5-qt # version 5.0
}}}
 * '''Windows 7/10''': Download and install file: gp520-win64-mingw.exe
  * In the '''install window''' set a mark on: Anwendungsverzeichnis dem Suchpfad PATH hinzufügen
  * In the '''install window''' set a mark on: add application folder to search PATH


==== Python cross platform ====
/!\ In order to use the '''USB - UART converter''' you need to install a '''driver''' from the manufacturer of the chip.
For the recommended chip '''CP2102''' it can be found at this [[https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers|Link]]

Today I can recommend '''Python 3'''. It is more comfortable than Python 2. I have tested my program partially also with Python 2.7.
 * '''Mac OS''': Download [[https://www.python.org/ftp/python/3.6.3/python-3.6.3-macosx10.6.pkg|python-3.6.3-macosx10.6.pkg]] and install it.
  * Install '''serial port library''': in Terminal:
  {{{
  $ sudo pip3 install pyserial
  }}}
 * '''Ubuntu 1604''': in Terminal:
  {{{
  $ sudo apt-get install python3

  # Serial port library
  $ sudo pip3 install pyserial
  }}}
 * '''Windows 7/10''': [[https://www.python.org/downloads/release/python-363/|Install from here]], package: '''Windows x86 executable installer'''
  * Install '''serial port library''': in Terminal, with '''admin rights''':
  {{{
  $ pip3 install pyserial
  }}}


||<tablestyle="float: right;">[[attachment:dso150-110-plot.png|{{attachment:dso150-110-plot.png|attachment:dso150-110-plot.png|width="600"}}]] ||
==== JYE Firmware 113-15001-111 ====
Since '''firmware -110''' it is now also possible to '''send the waveform''' and '''measured data'''. Look [[https://www.jyetech.com/Products/LcdScope/Firmwares_150.php|here for the details]].

 * The '''baud rate''' of the serial port was changed to 115200bps 8N1.

Connect the DSO150 via USB cable with the PC and start the Python program in a '''Terminal program''' with:
{{{
$ dso150-110-plot.py -dp
}}}
A '''count down''' of 60 seconds will start, visible in the '''Terminal''', waiting for the '''buttons pressing'''.

To '''send waveform data''' press buttons '''ADJ and V/DIV''' simultaneously. The '''last displayed waveform''' prior to pressing the buttons will be send.

In addition to the waveform some '''measured and calculated data''' are send, see the '''screen shot''' above.
{{{
VSen,1V - Voltage sensitvity per division
Couple,DC - Coupling mode, AC, DC, GND
VPos, -3.12V - Vertical position of the zero Volt line
Timebase,0.5ms - Time base in time per division
HPos,00362 - Horizontal position offset in sample number (0..1023-320)
TriggerMode,AUTO - Trigger mode, Auto, Normal, Single
TriggerSlope,Falling - Trigger slope, Rising, Falling
TriggerLevel, 1.13V - Trigger Level in Voltage
RecordLength,01024 - Record Length in number of samples
Vmax, 3.77V - measured maximum voltage
Vmin, 0.44V - measured minimum voltage
Vavr, 2.10V - calculated average voltage
Vpp, 3.28V - calculated peak to peak voltage
Vrms, 2.67V - calculated Root-Mean-Square voltage
Freq, 1.036KHz - measured frequency
Cycl, 0.964ms - measured cycle time
PW, 0.487ms - measured pulse width
Duty, 50.5 % - measured duty cycle
SampleInterval,00020us - sample interval time
}}}


The program '''dso150-110.py''' to capture the '''waveform data''' and '''plot waveform and data''' can be seen and [[attachment:dso150-110-plot.py|downloaded here]]. The following '''command line options''' can be used:
{{{
-d # capture data from DSO150 and write a .csv file
-f <filename> # filename given, default = dso150-110-data.csv
-g <serial port name> # define serial port name, if the default does not fit
-p # write file dso150_gnuplot.par and plot curve and data with GNUplot
-t <seconds> # serial port timeout in seconds, default = 1 s
-v # verbose messages for debug
}}}


==== Windows use ====
In order to make the call of the Python program easy, you can create a '''batch file''' and place a '''link file''' on the '''Desktop'''.
 * Create a '''folder''' with the name DSO150.
 * Create a '''new Textfile''', named '''DSO150.bat''' in your DSO150 folder, and insert the following text with the '''Text Editor''':
{{{
REM DSO150 read out and plot
REM 2018-07-21
python dso150-110-plot.py -dp
}}}
 * Rename the '''file extension''' from .txt to '''.bat'''.
 * Draw the file from the '''Explorer window''' to the '''Desktop''' while holding the '''ALT key'''. That will create a '''Link file''' to the batch file. With a mouse '''double-click''' on the '''icon''' on the desktop the Python program will start.

 * The Python 3 interpreter, if not already installed, can be downloaded from [[https://www.python.org/downloads/release/python-370/|python.org]].
  * While installing take care to add the Python interpreter path to the '''Windows PATH''' environment variable.
  * After installation you need to install the '''Serial library''' for Python:
{{{
# In the terminal (cmd.exe)
$ pip install pyserial
}}}
 * GNUplot can be downloaded from [[https://www.heise.de/download/product/gnuplot-1986/download|heise.de]]. Take care to select the right version: Windows 32 or 64 bit.
  * When installing you need to select the options (see screen shot [[https://superuser.com/questions/1042480/execute-gnuplot-from-cmd|here]]):
   * Select gnuplot's default terminal: '''mark qt'''
   * '''Mark''': Select application directory to your PATH environment variable
   * '''Reboot Windows''' to make the variable PATH change active.
 * Connect the DSO150 with a '''Micro-USB''' cable to an USB Port on your Windows computer.
  * Find out with the '''Device manager''' (Geräte Manager) whitch '''Serial port''' is dedicated (e.g. COM3 or COM4)
  * If it is not '''COM3''', please edit the Python program '''dso110-plot.py''', in line 36 the '''COM''' port number.
 * Now with a mouse double click the Python program should start, you see in the terminal window a count down from 60 seconds.
  * Press buttons '''V/DIV''' and '''ADJ''' simultaneously to start the data transmission.
  * The count down stops, and after a few seconds you will see the '''data plot'''.
  * With a click on the leftmost '''icon''' (arrorw) you can export the plot in several formats.
Line 62: Line 427:
 * Nützliche ULP [[https://github.com/sonofbc/My-Stuff/blob/master/Lighting%20controller/EAGLE-5.9.0/ulp/DESCRIPTION|Beispiele]]
 * [[http://web.cadsoft.de/cgi-bin/download.pl?page=/home/cadsoft/html_public/demo.htm&dir=eagle/userfiles/ulp|Benutzer ULP's, z.B. drill-ring.ulp]]
 * [[http://eagle.support.ger.narkive.com/bQmzZpGK/library-zusammenfassen|Library zusammenfassen]]
 1. [[http://www.jyetech.com/Products/LcdScope/e150.php|JYE Tech, DSO150]]
 1. [[http://doc.qt.io/qt-5/gettingstarted.html|QT5 getting started]]
 1. [[http://doc.qt.io/qt-5/supported-platforms.html|QT5 supported platforms]]
 1. [[https://github.com/michar71/Open-DSO-150/|open source firmware for JYE Tech DSO-150 / DSO-138 Digital Storage Oscilloscope]]
 1. [[https://github.com/ardyesp/DLO-138|open source firmware for DSO-138 O-Scope]]


=== Contact Email ===
Please enter your '''Email address''', if you expect an answer.

/!\ The entered Email address will not be published, or given away.
<<AddComment>>
Line 69: Line 443:
<<FullSearch(category:CategoryTechDoku)>> <<FullSearch(category:CategoryTechDoc)>>
Line 74: Line 448:
Go back to CategoryTechDoku or StartSeite Go back to CategoryTechDoc or StartSeite

JYE Tech DSO150

There is now (Sept. 2017) a low cost (18 EUR) Digital Storage Oscilloscope (DSO shell) from company JYE Tech available, e.g. Banggood.com, product ID: 1093865.

  • Pros: nearly complete soldered kit (SMD) with housing.

    • good user interface (software)
    • with extended software from toshi with data export.

    • Since firmware 113-15001-110 data export possibility is also included.

    • Portable operation possible, with battery pack (power consumption 120mA @ 9V)

    • Good documentation - manual, schematics, firmware update

    • Use as a time recorder with maximum time of 100 minutes on screen and 320 minutes if you download the waveform data. The Trigger point is in the center.

  • Cons: Limited bandwidth of 200 KHz.

    • 1 channel only.

/!\ Since firmware version 113-15001-110 it is necessary, to ask for an activation code via Email. You need to send the 8 character code (board PID = PCB IDentity) which is on a bar-code label on the main PCB via Email to jyetek@gmail.com, asking for the activation code (4 digits). After several Power-On-Resets the software asks for the activation code. If you do not enter this number, the rotary encoder will appear malfunction.

/!\ you can magnify the pictures (and download) with a mouse click on it.

attachment:DSO150_DSC07450.jpg

Specifications

  • Vertical:

    • Number of Channel: 1
    • Analog Bandwidth: 0 - 200 KHz
    • Sensitivity: 5 mV/Div - 20 V/Div
    • Sensitivity error: < 5%

    • Resolution: 12-bit
    • Input Impedance: 1M ohm
    • Maximum Input voltage: 50 Vpk
    • Coupling: DC, AC, GND
  • Horizontal:

    • Max Real-time Sampling Rate: 1 Msps
    • Timebase: 10 us/Div - 500 s/Div
    • Record Length: 1024
  • Trigger:

    • Trigger Modes: Auto, Normal, Single
    • Trigger Types: Rising/falling edge
    • Trigger Position: 1/2 of buffer size, fixed
  • Display:

    • 2.4-inch color TFT LCD with 320 x 240 resolution
  • Power supply:

    • 9V DC (8 - 10V acceptable)
    • Supply Current: 120mA @ 9V
  • Physical:

    • Dimension: 115mm X 75mm X 22mm
    • Weight: 100 gram (not including cables and power supply)

Modifications

In order to make the DSO more useful, three modifications are made.

attachment:DSO150_USB-UART_DSC07467.jpg

Rechargeable Battery Pack

On Ebay.de you can buy a 6 x AA battery housing (ID number 162434646097, 1.6 EUR) with 15 cm wires and an ON-OFF sliding switch.

To connect to the DSO150 you need a DC plug 5.5/2.1 mm (e.g. ebay.de ID no. 152190640539, for about 10 pc. 2 EUR).

/!\ Because of the low voltage (>7.6 V at 50% of the capacity of NiMH batteries) you need to short the inverse-polarity protection diode. See the picture on the right for the wiring. The voltage regulator 78L05 need minimum 6.7 - 7 V for the voltage regulation.

The negative voltage is made by an ICL7660, where 0.6 V are lost. So, 7.6 V - 0.6 V = 7.0 V. The 79L05 regulator need a typical minimum of -6.7 V to -7.0 V for the ouput voltage of -5.0 V.

So, be careful to do not inverse the polarity of the power supply wiring.

attachment:DSO150_USB-UART_cutout_DSC07478.jpg

USB - UART Converter

In order to allow a firmware update, or to capture waveform data via USB connection (needs toshi firmware 60B), you need to adopt an USB-UART converter. Fortunately you get on ebay.de (ID no. 381765079624) a little module which just fits into the DSO150 housing, and has on the data lines the necessary 3.3 V level. The USB plug is micro USB.

For the connection have a look at file DSO150_HowToUpgradeFirmware.pdf from JYE Tech.

For mechanical fixation on the logic board I used hot glue, see the picture on the right.

You also need to make a cutout in the lower part of the housing for the Micro-USB plug.

Jumpers

In order to make the firmware update easier, the solder jumpers J1 and J2 are routed with wires to 2mm spacing posts, see the picture on the right. I am using wire-wrap wires, because they are thin and have a good isolation.

attachment:DSO150_jumper_DSC07463.jpg

I have mounted the posts with hot glue to the board.

/!\ Take care about the position, if you place the posts more to the right, the electrolyte capacitors of the analog board are in the way.

I have bought several units, unfortunately one of them could not be programmed (flashed).

For programming I used the freeware program stm32flash and used it under Mac OS and Ubuntu 1604.

For installing the program, see the next chapter.

Firmware Mod

A nice guy provides an extended firmware 60B. You can download the software from toshi with source code (archiv 113-15011-60B.zip). The benefits are:

  • Show the trigger voltage in the lower right corner of the screen.

  • Allow a waveform data export via USB port:

    • UART parameters: 38400 baud, 8N1

    • The telegram is coded in ASCII and with Return + Line Feed at the line end.

    • 1st line has the time interval in seconds.

    • 1024 lines with the waveform data in volt.

  • Since JYE firmware 113-15001-110 data export possibility is also included.

Re-Programming DSO150

I have bought three units, unfortunately one of them could not be programmed (flashed).

The Re-Programming under Windows is described in the file DSO150_HowToUpgradeFirmware.pdf from JYE Tech.

For programming I used the freeware program stm32flash and used it under Mac OS and Ubuntu 1604.

# Prerequisites MacOS: Program Xcode (App Store)
# Unpack archiv with mouse double click on the file stm32flash-0.5.tar.gz
$ cd stm32flash
$ make
...
$ sudo make install
...
install -d /usr/local/bin
install -m 755 stm32flash /usr/local/bin
install -d /usr/local/share/man/man1
install -m 644 stm32flash.1 /usr/local/share/man/man1

/!\ In order to use the USB - UART converter under Mac OS you need to install a driver from the manufacturer of the chip. For the recommended chip CP2102 it can be found at this Link

  • Install under Ubuntu 1604: Download the source code and compile it.

The CP2102 driver is already on board.

The Re-Programming under Linux is explained in detail: Step by Step: How to flash firmware from Linux. This must be done in the terminal.

  • The DSO150 is connected via Micro USB cable with the PC.

# see if USB-UART (serial) converter is online.
# Ubuntu
$ ls /dev/ttyU*    
/dev/ttyUSB0

# Mac OS
$ ls /dev/cu.SL*
/dev/cu.SLAB_USBtoUART

# If you see this, you are connected

# If there is an error you will see:
stm32flash 0.5

http://stm32flash.sourceforge.net/

Interface serial_posix: 115200 8E1
Failed to init device. # look for the jumpers J1,J2 and the Serial interface wiring
  • Read the CPU info to make sure the hardware works:

# Read STM32 Info:
$ stm32flash -b 115200 /dev/cu.SLAB_USBtoUART  # Mac OS
or
$ stm32flash -b 115200 /dev/ttyUSB0            # Ubuntu 1604
tm32flash 0.5
http://stm32flash.sourceforge.net/
Interface serial_posix: 115200 8E1
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0410 (STM32F10xxx Medium-density)
- RAM        : 20KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB

# If you see this, the STM32 should be programmable.
  • unzip archiv 113-15011-60B.zip: you need file 113-15011-060B.hex. I renamed it, to better remember the origin:

$ mv 113-15011-060B.hex 113-15011-060B_toshi.hex
  • Check for the firmware, if the folder is not the working path, change it.

# change directory to the folder with the toshi software
$ cd <folder>  # path of the unzipped archiv 113-15011-60B.zip
$ ls
113-15011-060B_toshi.hex
# The file is in the working path - OK
  • Remove the Read UnProtection, you should do it only once.

# Mac OS
$ stm32flash -b 115200 -k /dev/cu.SLAB_USBtoUART
or
# Ubuntu
$ stm32flash -b 115200 -k /dev/ttyUSB0
....
Read-UnProtecting flash
Done.

# That is OK
  • Program (flash) the STM32

# the flashing was made with:
# Ubuntu 1604
$ stm32flash -b 115200 -v -w 113-15011-060B_toshi.hex /dev/ttyUSB0
or actual JYE firmware
$ stm32flash -b 115200 -v -w 113-15001-111.hex /dev/ttyUSB0
or 
# Mac OS 10.12.6
$ stm32flash -b 115200 -v -w 113-15011-060B_toshi.hex /dev/cu.SLAB_USBtoUART
or actual JYE firmware
$ stm32flash -b 115200 -v -w 113-15001-111.hex /dev/cu.SLAB_USBtoUART
....
Write to memory
Erasing memory
Wrote and verified address 0x0800c814 (100.00%) Done.

# That was OK

Next you open Jumper J1 and J2 and apply power (8 - 12 V) to the DSO150. On the greeting screen you should see the firmware version 60B, or 111.

  • sigrok Pulseview protocol analysis (about 3 ms after trigger (falling edge)).

The analysis of the serial protocol of the STM32 is made with the software pulseview, see here for more details.

The software sigrok is a portable, cross-platform, Free/Libre/Open-Source signal analysis software suite that supports various device types (e.g. logic analyzers, oscilloscopes, and many more). The download page is here.

TXD = PC, RXD = STM32 (DSO150), data in hexadecimal
TxD 7F     01 FE                  00 FF
RxD    79         79 22 00 00 79        79 0B 22 00 01 02 11 21 31 43 63 73 82 92 79
Data                                                       
TxD 02 FD
RxD       79 01 04 10 79
Data     Device ID 0x0410

attachment:DSO150_gnuplot_qt.png

Waveform Visualization

OK, you can download the waveform data, but how can you visualize it (see screen shot on the right)? The necessary steps are:

  1. Capture the waveform data to a text file.

    • Start the program first, waiting for the data.

    • Push the ADJ (toshi version) or ADJ+V/DIV button for the start of the data transmission.

  2. Convert the waveform data to a .csv (Comma Separated Values) file.

    • Take care to localize the decimal point ("." or ",").

  3. Visualize the .csv file data with the freeware program GNUplot.

    • Take care to include the actual Date & Time in the plot.

I liked to use a software which is cross platform (Linux, Mac OS, Windows), so I decided for the interpreter language Python.

The five major tasks in the software are:

  1. Wait up to 60 seconds for the start of the data transmission.

  2. Read the data into a list (in real time), then write all into a text file.

  3. Read the data file, then calculate the time row, localize the decimal point and write the .csv file.

  4. Prepare a parameter file for program GNUplot. Add Date & Time.

  5. Call GNUplot with the parameter file.

    • The terminal command line looks like (toshi version):

        $ python3 dso150_p23.py -pd
        or
        $ python dso150_p23.py -pd 
        # option -p means capture data and write a .csv file
        # option -d means plot data with program GNUplot

The program dso150_p23.py can be seen and downloaded here, for version 60B only.

GNUplot shows one goody in the lower left corner of the plot. It is the X-Y position of the mouse pointer in the coordinate system, in application values, in this case X=Time and Y=Volt. But this does not work on Windows 7/10.

GNUplot cross platform

GNUplot can be installed cross platform. The best font quality, which works on all platforms, can be achieved with the graphic library QT5. You get more informations about the terminal qt on the command line:

$ gnuplot
gnuplot> help terminal qt
gnuplot> quit

Unfortunately finding the usable fonts is not so easy and very terminal and operating system dependent. From GNUplot you can get one hint:

$ gnuplot
gnuplot> show fontpath
gnuplot> quit

The default font size in GNUplot terminal qt has a size of 9 points. In Windows this is OK, but for Linux and Mac OS this is increased to 12/14 points for a good readability.

Installation:

$ brew update
$ brew doctor  # check for errors

$ brew install gnuplot --with-qt
or
$ brew (re)install gnuplot --with-qt  # in my case gnuplot was already installed with X11
==> Summary
🍺  /usr/local/Cellar/qt/5.9.1: 9,019 files, 278.0MB
  • Ubuntu 1604: In Terminal type:

$ sudo apt-get install gnuplot5-qt  # version 5.0
  • Windows 7/10: Download and install file: gp520-win64-mingw.exe

    • In the install window set a mark on: Anwendungsverzeichnis dem Suchpfad PATH hinzufügen

    • In the install window set a mark on: add application folder to search PATH

Python cross platform

/!\ In order to use the USB - UART converter you need to install a driver from the manufacturer of the chip. For the recommended chip CP2102 it can be found at this Link

Today I can recommend Python 3. It is more comfortable than Python 2. I have tested my program partially also with Python 2.7.

  • Mac OS: Download python-3.6.3-macosx10.6.pkg and install it.

    • Install serial port library: in Terminal:

        $ sudo pip3 install  pyserial
  • Ubuntu 1604: in Terminal:

    •   $ sudo apt-get install python3
      
        # Serial port library
        $ sudo pip3 install pyserial
  • Windows 7/10: Install from here, package: Windows x86 executable installer

    • Install serial port library: in Terminal, with admin rights:

        $ pip3 install  pyserial

attachment:dso150-110-plot.png

JYE Firmware 113-15001-111

Since firmware -110 it is now also possible to send the waveform and measured data. Look here for the details.

  • The baud rate of the serial port was changed to 115200bps 8N1.

Connect the DSO150 via USB cable with the PC and start the Python program in a Terminal program with:

$ dso150-110-plot.py -dp

A count down of 60 seconds will start, visible in the Terminal, waiting for the buttons pressing.

To send waveform data press buttons ADJ and V/DIV simultaneously. The last displayed waveform prior to pressing the buttons will be send.

In addition to the waveform some measured and calculated data are send, see the screen shot above.

VSen,1V                - Voltage sensitvity per division
Couple,DC              - Coupling mode, AC, DC, GND
VPos, -3.12V           - Vertical position of the zero Volt line
Timebase,0.5ms         - Time base in time per division
HPos,00362             - Horizontal position offset in sample number (0..1023-320)
TriggerMode,AUTO       - Trigger mode, Auto, Normal, Single
TriggerSlope,Falling   - Trigger slope, Rising, Falling
TriggerLevel,  1.13V   - Trigger Level in Voltage
RecordLength,01024     - Record  Length in number of samples
Vmax,  3.77V           - measured maximum voltage
Vmin,  0.44V           - measured minimum voltage
Vavr,  2.10V           - calculated average voltage
Vpp,  3.28V            - calculated peak to peak voltage
Vrms,  2.67V           - calculated Root-Mean-Square voltage
Freq, 1.036KHz         - measured frequency
Cycl, 0.964ms          - measured cycle time
PW, 0.487ms            - measured pulse width
Duty, 50.5 %           - measured duty cycle
SampleInterval,00020us - sample interval time

The program dso150-110.py to capture the waveform data and plot waveform and data can be seen and downloaded here. The following command line options can be used:

-d            # capture data from DSO150 and write a .csv file
-f <filename> # filename given, default = dso150-110-data.csv
-g <serial port name> # define serial port name, if the default does not fit
-p            # write file dso150_gnuplot.par and plot curve and data with GNUplot
-t <seconds>  # serial port timeout in seconds, default = 1 s
-v            # verbose messages for debug

Windows use

In order to make the call of the Python program easy, you can create a batch file and place a link file on the Desktop.

  • Create a folder with the name DSO150.

  • Create a new Textfile, named DSO150.bat in your DSO150 folder, and insert the following text with the Text Editor:

REM DSO150 read out and plot
REM 2018-07-21
python dso150-110-plot.py -dp
  • Rename the file extension from .txt to .bat.

  • Draw the file from the Explorer window to the Desktop while holding the ALT key. That will create a Link file to the batch file. With a mouse double-click on the icon on the desktop the Python program will start.

  • The Python 3 interpreter, if not already installed, can be downloaded from python.org.

    • While installing take care to add the Python interpreter path to the Windows PATH environment variable.

    • After installation you need to install the Serial library for Python:

# In the terminal (cmd.exe)
$ pip install pyserial
  • GNUplot can be downloaded from heise.de. Take care to select the right version: Windows 32 or 64 bit.

    • When installing you need to select the options (see screen shot here):

      • Select gnuplot's default terminal: mark qt

      • Mark: Select application directory to your PATH environment variable

      • Reboot Windows to make the variable PATH change active.

  • Connect the DSO150 with a Micro-USB cable to an USB Port on your Windows computer.

    • Find out with the Device manager (Geräte Manager) whitch Serial port is dedicated (e.g. COM3 or COM4)

    • If it is not COM3, please edit the Python program dso110-plot.py, in line 36 the COM port number.

  • Now with a mouse double click the Python program should start, you see in the terminal window a count down from 60 seconds.
    • Press buttons V/DIV and ADJ simultaneously to start the data transmission.

    • The count down stops, and after a few seconds you will see the data plot.

    • With a click on the leftmost icon (arrorw) you can export the plot in several formats.

  1. JYE Tech, DSO150

  2. QT5 getting started

  3. QT5 supported platforms

  4. open source firmware for JYE Tech DSO-150 / DSO-138 Digital Storage Oscilloscope

  5. open source firmware for DSO-138 O-Scope

Contact Email

Please enter your Email address, if you expect an answer.

/!\ The entered Email address will not be published, or given away.

Comment this page
Name:
Comment:
Are you human?

Liste der Seiten in dieser category:

-- RudolfReuter 2017-10-07 13:21:29


Go back to CategoryTechDoc or StartSeite

JyeTechDSO150 (last edited 2018-10-15 20:30:41 by RudolfReuter)