Adding Digital Channels to the DSO-150 Oscilloscope And Flashing New Firmware

For some time I have been aware of the little portable oscilloscopes (DSO) kits produced by JYE Tech, such as the DSO-138 and DSO-150. While these kits can be purchased fully built, they are usually sold in a DIY state of “you solder everything” or “you solder everything minus the smd components”. In the images below, the red PCB is the DSO-138 and the blue PCB is the big brother DSO-150.

I required a portable oscilloscope for some analog related projects, but I also wanted the ability to capture digital output at the same time. In the absence of digital outputs, I kept putting off the purchase until happily, I came across a couple of Github projects where the firmware has been rewritten and enhanced for both the DSOs mentioned. They both now have support for digital channels. That is if you are willing to flash the new firmware.

The Open source DSO-138 features support for 2 analog + 2 digital channels. A second analog channel requires hardware mods to the pcb.

DSO-138 with an additional digital channel

DSO-138: An open source firmware for DSO-138 O-Scope  

Summary

DSO-138 is an excellent piece of hardware based on ARM Cortex M3 core STM32F103 processor and sufficient for most beginner users. The stock firmware, while quite responsive, can use a few improvements. The main shortcoming which prompted the development of DLO-138 firmware is the inability to get waveform data into a computer for further analysis and the lack of a second channel. Engineers troubleshooting hardware issues need to mark reference points on waveform so having another analog or digital channel can greatly improve analysis. This firmware hopes to improve on these issues.

Features

  • Two analog channels
  • Two digital logic channels (SWDIO and SWDIO pins (PA13 and PA14) on board)
  • Serial port interface for captured waveform data
  • Trigger source selectable from Analog Channel 1 or Digital Channel
  • Option to use rotary encoder instead of + – and SEL switches
  • 2K sample depth

This firmware can be used on stock DSO-138 hardware as well. Select one of the pre-compiled binaries to suit the board. Follow the firmware upgrade instructions for DSO-138. At any time, you can reflash DSO-138 with JYE Tech provided firmware.

Cost

Extra features come at an additional cost. In the case of DLO-138, it is the loss of lowest timebase. Maximum sampling rate in DLO-138 is 20 µs/div instead of 10 µs/div. In the 20 µs/div range, firmware under-samples ADC channels, often reading same data twice. To use the second analog channel, analog front end has to be duplicated on a daughter board. On a stock hardware, this firmware can be used to provide two digital logic channels.

The Open source DSO-150 features support for 1 analog + 3 (yes 3) digital channels.

DSO-150 with 1 analog and 3 digital channels

DSO-150: An open source firmware for JYE Tech DSO-150 Digital Storage Oscilloscope

Summary

Complete rewrite of DSO-150 Firmware

  • No longer DSO-138 compatible (Sorry…)
  • Rewritten for Atollic trueSTUDIO (Yea… Real debugging)
  • Now using internal digital trigger through ADC IRQ (So trigger level can now be correlated to real voltage)
  • Lots of new features like voltage overlay, markers, auto cal

Features

  • Support 1 Analog and up to 3 Digital Channels
  • Trigger on rising/falling/both edges
  • Trigger on Analog, Digital 1,2,3 Signal
  • Single/Norm/Auto Trigger Mode
  • Exact trigger voltage
  • Serial Data Dump
  • Automatic Zero-Level Cal for all gain-stages
  • Voltmeter mode (Averaged over last 10 samples)
  • Signal Statistics Display
  • Cursors for Analog Signal
  • Load/Store Waveform to/from Flash
  • Zoom Out Display (See more data with full sampling Rate)
  • “Persistence” Mode
  • Variable Signal Size for Digital Signal Waveform
  • “loop” mode to scroll current input-values
  • AC/DC mode
  • 3K Sampling Depth
  • Buttons not blocked during sampling

After discovering the availability of the enhanced firmware, I bit the bullet and decided to get a DSO-150. Not looking forward to doing that much soldering, I therefore chose yet another purchase option of DIY “pre-soldered, just pop everything into the case on arrival”.

The instructions of building and flashing the DSO-Firmware are included in the github page, but as things never go smoothly, I had to

  • Convert the built binary to HEX format

After building the project in TrueStudio you will be left with an ELF binary file. To be able to update the firmware the ELF file will have to be in HEX file format. This can be easily achieved by adding a post build step to the project.

The post build command is

and the post build description can be whatever you like, in my case

So now when you build the project you will end up with both an ELF file and a HEX file. The HEX file is what you will flash to the DSO.


  • Flashing the device.

I tried to flash the device via the on board USART1 with both Linux and Windows using the tools,

Download stm32flash with git.

But the device was not recognised with the message,

No response from the target, Bootloader cannot be started

I eventually concluded that the required Serial bootloader was missing and gave up on UART flashing, deciding instead to flash via STLink/JTAG port. But not having an STLink handy, I decided to flash it with my FTDI FT2232H device and openocd on Linux.

The FTDI device is readily available in various flavours at various outlets including Ebay, Aliexpress, and Amazon. Mine is shown below.

Plugging in the FT2232HL gives you a satisfying,

All About Circuits have a good primer on using and FTDI witth openocd @ https://www.allaboutcircuits.com/technical-articles/getting-started-with-openocd-using-ft2232h-adapter-for-swd-debugging/

I would follow their guide referring back here for DSO-150 specifics 🙂

I soldered on some header pins to the FT2232HL and DSO-150.

Now the wiring was complete I installed openocd and moved on to setting up the configuration files required by openocd

  • /usr/share/openocd/scripts/interface/ftdi/myft2232hl.cfg

is the number from the dmesg log!

  • /usr/share/openocd/scripts/target/stm32f1x.cfg

If you have wired up the FTDI FT2232H (or whichever) correctly then running openocd should give you,

I forgot to take notes at the time of flashing, but I remember having to unprotect the flash!

Update: This post describes in detail the process of flashing a STM32 Cortex M3 with openocd 🙂 https://jacobmossberg.se/posts/2017/01/10/using-openocd-flash-arm-cortex-m3.html

These are the commands I executed during the process of flashing.

Anyway the take away is that I got it flashed, but not via the UART, I had to use the JTAG port and the new digital inputs are fully functional.

DSO-150 User Instructions – User Guide

File name : dso150-shell-user-manual.pdf

DSO-150 How to Upgrade Firmware (Official) – Flashing Guide

File name : DSO150_HowToUpgradeFirmware.pdf

Leave a Reply

Your email address will not be published. Required fields are marked *