Hi all, Nice to meet several of you at 29C3!
As some of you will know, I pulled a couple of late nights at the congress, writing a sigrok driver for the Rigol DS1000 series oscilloscopes. This code is now available on GitHub: https://github.com/martinling/libsigrok/commits/rigol-ds1xx2 It's not finished yet - this is just the state the code was at when Bert dragged me away from the scope so he could pack it away - but it does sort of work, so I suppose I should let you see it. :) Technical details follow: - The code was developed and tested against a DS1052E that had been patched to 100MHz, i.e. a DS1102E. It should work for all the DS1xx2 models including DS1xx2D variants, however the digital channels on those latter models are not yet supported. I have a DS1102D at home, so I will add that support when I get back from my travels. - The driver supports all the same parameters as the Hantek DSO driver: timebase, vdiv, triggersource, triggerslope, triggerpos, coupling. I gather these are the only analog scope settings that libsigrok currently has hwcap mappings for. Other features will be very easy to add once further mappings are decided on, since the protocol is well documented and provides access to all the features of the scope. In fact this scope could be a good initial reference model for designing those mappings. - Some further work needs to be done on the actual waveform readout. There are two readout modes available on the scope. When running, only a 600 sample readout is available (corresponding to the signal currently visible on the screen). When stopped, the full 1Msample buffer can be read. Currently, the driver assumes the scope is running and expects the 600 sample readout. The full buffer readout is not yet supported. Also, currently only the first active channel is actually read out by the driver, regardless of which probes are requested. - The driver currently runs on top of the Linux kernel's usbtmc support, which presents a USBTMC device as a character device node. We know that this approach has a lot of fundamental problems, but it was sufficient to get something that is usable on Linux for this instrument. The code is implemented such that the transport is easy to swap out. In another marathon hacking session at the congress, Simon Richter and I developed a USBTMC implementation based on libopenusb. The longer term plan is to switch to this as the transport layer, at which point the code will be usable cross-platform. - The hardware scan routine needs to be tamed. It should find a Rigol DS1xx2 if you have one plugged in, but it will also grab any other usbtmc device that responds to an "*IDN?" query. This is easy to fix but will have to wait till I have a device handy again. Some questions: - How does the code look? As per the above it's not complete yet, but what is there already could use some review. (Be gentle - this is my first sigrok patch and much of it was written at ungodly hours...) - Data readout in this protocol is on a per-channel basis, rather than interleaved samples from all channels at once. However libsigrok expects interleaved samples. I can interleave the data in the feed of course, but that seems wasteful if subsequent code is just going to de-interleave it again. Is it practical, or desirable, to support uninterleaved data (with new metadata indicating the arrangement)? - Some of the hwcap settings (coupling and vdiv) apply to individual probes rather than the device as a whole. I am applying the requested settings to all probes for now, but obviously this isn't really the right thing to be doing. How should these settings be supported properly? - Is anyone else with access to one of these devices interested in helping? If so I can help get you up to speed. Martin ------------------------------------------------------------------------------ Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 _______________________________________________ sigrok-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sigrok-devel

