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
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 .
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