Git Product home page Git Product logo

evalcontrol's Introduction

evalcontrol

A python library to control the AD9959 DDS Evaluation Board. This library is based on the MIT Labview drivers and the official documentation of the AD9959.

Installation

To install the package from source simply do

git clone https://github.com/Schlabonski/evalcontrol`
cd evalcontrol
python3 setup.py install

Requirements: This library works on top of pyusb which uses libusb so these should both be installed as well. To install liusb on windows, see instructions below.

Use without sudo

If you want to use the library, i.e. access the evaluation board, without root rights run the following steps first.

  1. Add the user to the plugdev group sudo useradd -G plugdev USERNAME
  2. Add the evaluation board to the plugdev group by edditing a new rules file sudo vim /etc/udev/rules.d/10-ad9959.rules and adding the following line ATTRS{idProduct}=="PRODUCT_ID", ATTRS{idVendor}=="VENDOR_ID", MODE="666", GROUP="plugdev" where PRODUCT_ID and VENDOR_ID are replaced by the respective IDs (mind the quotes).
  3. Reload the udev rules sudo udevadm trigger

Use with artiq

To use the package within artiq just activate the corresponding virtual environment and run python3 setup.py install When accessing the device in the preparation phase of an experiment, use the AD9959.reset() method to prevent USBErrors due to timeout.

Use on Windows

To use this package on windows, you need to install a port of the libusb driver.

  1. Download from https://sourceforge.net/projects/libusb-win32/
  2. copy libusb0.dll to C:\Windows\System32
  3. copy libusb0.sys to C:\Windows\System32\drivers
  4. add a filter for the AD9959 using the install-filter-win utility

evalcontrol's People

Contributors

schlabonski avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

evalcontrol's Issues

How to set the profile pins using the software - urgent request

Hi Fabian

I only have one problem outstanding. How do you set the profile pins to be on and off using the python module. As it is done using the proprietary software without any external signals to the header pins surely it must be possible using the python module. I want to be able to upload frequency profiles regularly and activate the modulation mode.

How to set up board without the native software

Hi Fabian

Could you please tell me how to initialise the board without first running the native software. I understand that there is the init function however when I run the script below, I don't see any changes in the frequency in channel 0. To reiterate I can set the frequencies using this module after I have first set the frequency in the native software.

`import evalcontrol
import time

evaluation_board = evalcontrol.AD9959()

#evaluation_board._reset_usb_handler()
evaluation_board.init(vid=0x0456, pid=0xee25, port_numbers=None, bus_number=None, auto_update=True,
rfclk=20e6, clkmtp=20, channel=0)
evaluation_board.set_frequency(2e6, channel=[0])

`

How to set the modulation of the channel

Hi

I am trying to use a 2 level modulation, and I understand that I will need to use the functions, enable_channel_modulation and enable_modulation. To write the values to register I understand I need to make use of write_to_dds_register however I don't understand how to set the values as explained below:

" :register: hex
ID of the target register on the DDS chip.
:word: bytearray
word that is written to the respective register. Each byte in
the bytearray should be either 0x00 or 0x01.
"

Could you please give me some examples

question: how to use the evalcontrol app under Ubuntu 16.04

Hello,

I have installed your application under Ubuntu 16.04 and I think I meet all the dependencies( PyUSB, libsub), but I do not have much success using it so far. I just want to set the frequency and phase of each of the 4 port, not much more for the time being. I am running the latest version of Ubuntu 16.04.

I am trying to use your application with an AD9958/9959 control board sold on ebay (see link below) and that works fine with the evaluation board software under Windows 10 ( I have tested it ok on a dedicated native windows 10 PC )

https://www.ebay.com/itm/4-channel-AD9959-DDS-Generator-Module-USB2-0-control-board/152605192513?hash=item2387fa7141:g:8-IAAOSwbopZVUiV

Here is the error that I get:

root@abc:~/evalcontrol# ./set_frequency_example.py
import: unable to open image evalcontrol': Is a directory @ error/blob.c/OpenBlob/2712. ./set_frequency_example.py: line 3: syntax error near unexpected token ('
./set_frequency_example.py: line 3: `evaluation_board = evalcontrol.AD9959()'

If instead I use ;

root@abc:~/evalcontrol# python3 ./set_frequency_example.py
Traceback (most recent call last):
File "./set_frequency_example.py", line 3, in
evaluation_board = evalcontrol.AD9959()
File "/home/peter/evalcontrol/evalcontrol/ad9959.py", line 43, in init
assert len(devs) > 0, dev_mess
AssertionError: No devices with matching vID/pID 1110/60965 found!
Exception ignored in: <bound method AD9959.del of <evalcontrol.ad9959.AD9959 object at 0x7f20aaa26438>>
Traceback (most recent call last):
File "/home/peter/evalcontrol/evalcontrol/ad9959.py", line 83, in del
usb.util.dispose_resources(self.dev)
AttributeError: 'AD9959' object has no attribute 'dev'

Please provide me some guidance on on how to use your app. I really would like to try to avoid using my windows 7 PC, not my favourite os ;-)

Thanks
Peter

Error in running set_frequency_example

Hi, can you help me with the errors below please? Thanks

File "C:\evalcontrol\venv\lib\site-packages\usb\backend\libusb1.py", line 600, in _check
raise NotImplementedError(_strerror(ret))
NotImplementedError: Operation not supported or unimplemented on this platform
Exception ignored in: <function AD9959.del at 0x000001EE71A63E58>
Traceback (most recent call last):
File "C:\evalcontrol\evalcontrol\ad9959.py", line 86, in del
usb.util.dispose_resources(self.dev)
AttributeError: 'AD9959' object has no attribute 'dev'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.