If you do not send a set of new parameters to the device, it will stay on whatever was active when USB mode was requested. "Connecting" does not change anything, it just turns on streaming the data frames.
I didn't touch the low level serial communication procedures. I just fiddled around with the high level "buffer received" and "send buffer" routines. However, if you have a "FE" byte anywhere within your data, you must follow it with an additional "00", otherwise this would be interpreted of a "start new data frame" character and possibly blast your device
The sequence to set the device into USB mode is outlined in the user manual. The default bitrate is set to 115200, N,8,1. No matter what bitrate you set, you must send
The "FE" is the sync character that precedes every command, "E1" is the Frame-ID for "connection command", "0004" is the total frame length (counting from the "E1"), "C1" is idontknow?
This "should" trigger an "identify" response frame
Code: Select all
FE E2 0D 00 'O' 05 'DSO112A' 00 00
The "O" identifies it as "oscilloscope", model 5, named "DSO112A".
This response did not arrive, the hell knows why. So I sent another frame after the "connect", one of type "Query"
which finally resulted in the expected "identify" response to reveal the model.
It was primarily the model number 5 that prevented Jye Lab from doing anything useful with the now streaming "data frames". There was simply no procedure that processed frames in case of "model 5".
Once you are connected, the data streams in constantly, usually a full buffer of values at once. You get 25 samples per div and 25 counts per div vertically. To judge the true voltage, you have to know the sensitivity setting and the vertical position of the baseline, as the values are 0-255 spanning 10 vertical divs where 128 should match the center line - which it does not, at least not mine. I have a small offset, but overall that are the parameters.
The current settings can be requested too. And you can send new settings to the device (see manual). However, the sensitivity seems to be ignored when "connected" i.e. when data are streaming in. The whole communication also works without setting the device to USB mode. The connect/disconnect seem to define whether the data is displayed on screen or whether it is sent to the PC. Without this you can still operate the scope remotely and get status responses, just no measurements.
The rest is all about processing the data, as well as send and receive settings, but this is the part that paints everything on screen and doing all the math to get all the lines and points scaled properly into the display area.
Unfortunately parameters like setting the trigger level or the sensitivity seem to be ignored while "connected", whereas trigger-edge, buffer size or time base values are honored.