TDSO152

TDSO152 is an application written in Tcl/Tk to control the FNIRSI DSO152 oscilloscope. Although it is still a work in progress (WIP), it is already fully operational and significantly expands the capabilities of this small oscilloscope by adding:

  • Different types of spectrograms.
  • Export of waveforms in CSV format.

Currently, in addition to the SWD port, it is necessary to add a USART connection. The initial intention was to use the device’s own USB port for data transfer, but since a satisfactory implementation could not be achieved, the decision was made to use USART, which offers stable and reliable operation.

The goal of this project is to transform the DSO152 into a true desktop oscilloscope (within its technical limitations), significantly expanding its capabilities compared to the original firmware.

Warning

To use the capabilities offered by TDSO152, it will be necessary to replace the device’s original firmware. As a result, the functionalities provided by the factory firmware will be lost.

Additionally, small hardware modifications will be required, meaning the manufacturer’s warranty will be voided.

Use this information at your own risk.

Hardware modifications and tools

The minimum necessary tools are:

  • Soldering iron.
  • Solder wire.
  • 90° angled pins.
  • Wires.
  • Sandpaper sheet.
  • WCH-LinkE.

It is also recommended to have the MounRiver IDE if you want maximum flexibility.

SWD Port

If you watch the video Hacking a Fnirsi DSO152 mini oscilloscope to play Breakout, you can see the instructions for adding a debug port to the DSO152. It is recommended to use fine sandpaper or a similar method to properly clean the pads before soldering.

If you do not have a Dremel or equivalent tool, a cutter or knife can also be used to adapt the necessary gap for the new connector.

USART

Since it has not been possible to use the USB port integrated into the DSO152 for data transfer, USART has been used instead. In practice, it fulfills its purpose perfectly, although it requires an additional small hardware modification.

Fortunately, the modification is extremely simple: you just need to solder two wires to the pads of two existing buttons on the board. It is also recommended to clean the surfaces beforehand with fine sandpaper.

UART connections UART connections

WCH-LinkE

This programmer incorporates both an SWD interface and a serial port, allowing you to program the firmware and debug it simultaneously using a single device.

The power supply must be configured to 3.3 V and the programmer must be put into ARM mode, since the DSO152 microcontroller is a CH32(F)103. Configure the WCH-LinkE.

Regarding the programmer, it is recommended to buy it from the official WCH store on AliExpress. It is also interesting to acquire one of the development boards that include an integrated programmer, as their price is low and they allow for easy experimentation with these microcontrollers.

The MounRiver development environment has proven to be a very valid tool. Although it is still behind more mature solutions like STM32CubeIDE, it is perfectly suited for this project.

To learn and experiment, it is recommended to download WCH’s evaluation packages, CH32F103EVT.ZIP

Version 1.1

  • Data transmission in byte stream (5x faster screen refresh rate compared to v1.0)
  • Cleaner signals on the PC side

Version 1.0

Below you can see the general operation of the oscilloscope.

TDO152 executable TDO152 executable

Operation

The architecture used is client-server. The server (the main application) is responsible for communicating with the oscilloscope and distributing the data to the different clients (plugins).

The transmitted information mainly consists of:

  • Data obtained from the ADC.
  • Configured sampling rate.
  • General status of the oscilloscope.

The tdso152.bat file is responsible for starting the server and the various clients. After startup, two windows will appear:

  • The main oscilloscope window.
  • The run-clients window.

Why two windows and the tdso152.bat file?

The main development is done using the Tcl interpreter directly:

tclsh dso152.tcl

The main application creates a server responsible for exchanging data with different specialized clients:

  • Discrete Hartley Transform.
  • Standard measurements (Vrms, Vmax, Vmin, Vpp, etc.).
  • Other extensions that may be developed in the future.

These clients perform complex calculations independently and notify the main program when the results are ready to be displayed.

This design provides a complete separation between the graphical interface and data processing, also allowing new capabilities to be added through independent plugins.

For example:

exec tclsh client-measures.tcl &

launches a client responsible for performing specific measurements and calculations.

When using FreeWrap to generate standalone executables, this mechanism no longer works exactly the same way, making it necessary to generate several executables. However, this circumstance also brings advantages, as each component maintains a high degree of independence from the rest.

Although initially there were no plans to distribute the software in executable format, having a packaged version significantly facilitates its use.

Source code

For now, it can be extracted from the executable itself using 7-zip: 7z x tdso152.exe -oextraido

After the summer, the code will be published on Github and Sourceforge.

Project page

TDSO152

Roadmap

Currently, development is focused on incorporating new capabilities and fixing some issues detected during testing.

Pending aspects:

  • Implement screen refresh improvement (Techo)
  • Implement byte stream (Techo)
  • There is a small offset error in the input signal.
    • In high voltage measurements, the offset is excessive.
  • Integration with Sigrok
  • Expand the ADC buffer to approximately 10,000 samples using 8-bit reads.
  • Take advantage of the full 12 bits of the ADC.
  • Implement a virtual canvas that allows comfortable navigation through large buffers.

About the name

The name TDSO152 has a double meaning.

On the one hand, it refers to the fact that this is a development made in Tcl/Tk on a Digital Storage Oscilloscope. On the other hand, its pronunciation in Spanish is particularly suggestive.

Contact

For any suggestions, inquiries, or collaboration:

tdso112a a hykrion c o m