DSO Quad remote control / SDK

Hello everyone,

after a long time I was playing a little with my DSO project and implemented an interesting feature. I added the ability to communicate with the DSO with PC. Unfortunatelly I was not able to change the USB descriptors to create a virtual serial port for communication and I was looking for some workaround. Then I decided to use the mass storage disk for transferring data to/from PC. It is working like this:

PC application creates a file 32kB “SDK.BIN” on the DSO. DSO is every second checking this file for any request. When host application writes some request into “SDK.BIN”, for example “REQ=ENUM::Ampl(CH1::Resolution); ENUM::Ampl(CH2::Resolution); ENUM::Time(TIME::Resolution); ADC::Get();” and DSO recognizes this request, simple evaluator evaluates whole expression and creates a response text for every single request command "ANS=‘500ms’ ANS=‘50mV’ ANS=‘100mS’ ANS=(stream, len=16384)…END’

This response is processed by the host application and transformed into JSON and sent through WebSocket into web browser with user application. Little complicated, but working :slight_smile:

The only problem is that it is a little slow. For example a transfer of whole waveform memory takes about 4 seconds. But it is only question of time when someone will implement virtual serial port usb profile (maybe I will one day :slight_smile:.

Here are some examples of implemented commands:
Beep(500) - makes a 500ms beep
Print(300,10,‘Hello’) - prints Hello message at position 300,10
Print(‘Hello’) - prints debug message
CH1::Resolution - returns integer corresponding to the resolution setting of CH1
CH1::Resolution=3 - sets the resolution to 500mV
ENUM::Ampl(3) - returns string representation of resolution setting, ‘500mV’
GEN::Square(180-1,400-1) - starts generating 1kHz square signal
TIME::Resolution=12 - sets the time resolution to 1mS

So it basically looks like simple C commands
here is a screenshot of user application running in web browser (I am using html5/canvas for drawing the signals):

I am looking for some betatesters, everything necessary for testing this project you can find here:
https://github.com/gabonator/DS203

I think that javascript is very simple language and with this feature it is possible to implement interesting algorithms much faster than implementing them in C/C++ for DSO. Currently my example allows you to change the resolution of input channels and download and display the waveforms (I was tesing it on Firefox/Nightly)

one note: the connector application source code should be built with visual studio 2010 (or other version, but you need to make your own project file), if you don’t have this program, I placed there a release version that should work for you, but it will probably ask for some dlls. Important thing to know is that the path to DSO is hardcoded in the connector app, and it tries to create the sdk file in this path: “G:\SDK.BIN”

Gabriel

That’s great.

PS: Glad to see you back.

This is definitely heading in a cool direction garbonator! I’m actually needing to ‘use’ the DSO next week or so - but after that I’ll happily start putting it through some paces.

Now to get Serial working… :slight_smile:

Yeah, serial port through the USB would be very useful, both for remote control and especially for debugging. It’s relatively easy to access the onboard serial port, but it’s dull when there is an USB connector that could be used.

I think libopencm3 might have some useful stuff to implement it, but I haven’t had the time to try it out.

Doesn’t continous writing on the SDK.BIN file wear out the flash?
I have no experience with USB descriptors, but maybe a usb storage class command (like those used to switch 3g cards from disk to modem mode) could be used here.

Anyway, thank you for your work :smiley:

About the wearing out of the flash… Yes, I am curious when it will stop working. During the developing of calibration algorithm I have made thousands of transactions with full waveform dump, and it is still working :slight_smile: I hope they used some common type of flash chip in case it will refuse to work and I will be forced to replace it.

Yes, I know there is some serial port, but I dont want to drill holes to the nice plastic casing, and also I am travel a lot from home to school, to work and I don’t want to take next piece of hardware with me (usb to serial cable)… And also I am sure that sooner or later someone will prepare the serial connection usb descriptor for DSO. Unfortunatelly, I am focused on the calibration right now, so I don’t have a plans for implementing this in near future… My aim is to make a DSO a working and reliable oscilloscope with nice gui :slight_smile: