-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for ADALM2000 #104
base: master
Are you sure you want to change the base?
Conversation
Hi, I just tried compiling to Windows using This could be a blocker for PR acceptance since the Windows target is automatically built by the nightlies. If you want to try give it go, you would (currently) need to checkout Btw, PulseView uses CMake with its CMakeLists.txt detecting that it is being built under 'WIN32', so that might be a start.
|
If you need a place to start, check this comment left for building a MXE Windows target (for the KingST LA2016 PR): |
I will have a look at the compiling script in the following weeks. |
Build adalm2000 driver only if libm2k is found in the system. Signed-off-by: Teo Perisanu <[email protected]>
libm2k is a C++ library. In order to use it for the driver, a C code wrapper must be created. Signed-off-by: Teo Perisanu <[email protected]>
adalm2000 has both a 16-channel logic analyzer and a 2-channel oscilloscope. There are some global attributes, but also each channel has several specific attributes. Signed-off-by: Teo Perisanu <[email protected]>
Add the initial structure of the device. Scan for each USB connected board. Also an IP can be provided, in order to create a connection. Signed-off-by: Teo Perisanu <[email protected]>
After the device is opened, an ADC calibration is performed. Signed-off-by: Teo Perisanu <[email protected]>
Signed-off-by: Teo Perisanu <[email protected]>
Retrieve the number of enabled channels for the logic analyzer or for the oscilloscope. Signed-off-by: Teo Perisanu <[email protected]>
The available samplerates are the common values between the LA and the OSC. Always set the same samplerate for both components. Signed-off-by: Teo Perisanu <[email protected]>
Store the oversampling ratio. It will be actually set just before the acquisition starts. Signed-off-by: Teo Perisanu <[email protected]>
The oscilloscope has a range of -2.5V +2.5V in the high resolution mode. In the normal mode the range is between -25V and 25V. Signed-off-by: Teo Perisanu <[email protected]>
Signed-off-by: Teo Perisanu <[email protected]>
Add an extra trigger state - NO_TRIGGER. Add function to convert the libsigrok trigger to a libm2k trigger. Signed-off-by: Teo Perisanu <[email protected]>
adalm2000 has a source trigger for the OSC and for each channel has a trigger mode. Handle both attributes depending on the trigger source. Signed-off-by: Teo Perisanu <[email protected]>
Convert the libsigrok trigger slope into libm2k trigger condition. Signed-off-by: Teo Perisanu <[email protected]>
Signed-off-by: Teo Perisanu <[email protected]>
Transform the pre-capture ratio into a delay value for both OSC and LA. Always keep the same delay for both components. Signed-off-by: Teo Perisanu <[email protected]>
… libm2k. Add functions for creating the internal buffers, populating them, canceling any operation performed on them and destroying them. Signed-off-by: Teo Perisanu <[email protected]>
…bm2k. Add functions for creating the internal buffers, populating them, canceling any operation performed on them and destroying them. Signed-off-by: Teo Perisanu <[email protected]>
…of libm2k. Add functions for creating the internal buffers and destroying them in the mixed signal mode. Add function to check if the mixed signal is available. Signed-off-by: Teo Perisanu <[email protected]>
Add functions for enabling the analogical channels, setting the number of kernel buffers, and enabling the streaming mode. Signed-off-by: Teo Perisanu <[email protected]>
Destroy all buffers and stop the streaming mode. Signed-off-by: Teo Perisanu <[email protected]>
Configure the digital trigger. Set the oversampling ratio. Synchronize the OSC with the LA. Start the acquisition in the streaming mode. Acquire the exact number of samples to fit in the given boundaries. Signed-off-by: Teo Perisanu <[email protected]>
Thanks @teoperisanu! Btw, I tried your changes under Linux and seems to run great on the device - many thanks for the contribution! It might also be a good idea to put some docs together on how to install the Linux drivers and any other important information. Not sure where you could put that though - the best place would obviously be on the official sigrok website, but I suppose that can only be done once this PR has been merged. Maybe for now you could possibly update your PR comments to include at least a link to the driver setup/requirements for testing the PR. |
I managed to build this but only with dynamic linkage to libm2k, libiio, libxml2. Pulseview doesn't start if you don't have the dlls alongside pulseview.exe . Is this a hard requirement, full static build ? If so, do you have any pointers to do so ? I'm getting some linkage errors when linking pulseview/sigrok-cli to libm2k. I can post a build log with static/dynamic linkage or you can test it yourself: -Adrian |
Thanks for the work @adisuciu! Unfortunately I think only the maintainers know anything about the MXE-based Windows build. I just barely managed to get it work after a lot of trial and error. |
@adisuciu, maybe if you post a snippet of the relevant error output for the static linking build, and also attach the full build log, then someone might recognise the error and be able to help out. This is another great piece of hardware for the money and it would be a shame to not find a solution to this to have it included in the mainline build. |
Attached are the log files - the error is on the bottom of build_static.log build.log - build with dynamic libs |
There is another effort underway for an ADALM2000 driver in PR #243. Could you join forces with that PR? The use of libiio there isn't going to work out, and it looks like libm2k (a precursor to libiio?) is a similar thing: it brings nothing to the table that I can see, and the device interface should just be handled with libusb. |
ADALM2000 is an affordable USB-powered data acquisition module designed by Analog Devices Inc.
The adalm2000 driver integrates both the digital(16 channels) and analogical(2 channels) inputs and these are synchronized so that when both are running a mixed signal acquisition is performed.
The triggers for both components are configurable.
There are a variety of attributes that can be modified, such as vertical offset, the analogical range, oversampling ratio, the trigger delay and many others.
libm2k documentation: https://wiki.analog.com/university/tools/m2k/libm2k/libm2k