Integrate AD9959 into BLACS

396 views
Skip to first unread message

Allen Chiu

unread,
Jan 16, 2021, 2:44:56 AM1/16/21
to the labscript suite
Hi Everyone, 

We use AD9959 eval boards in our lab as the DDS. I'm wondering if there's a recommended way (or an existing solution) to add AD9959 into BLACS. I did some search on the internet, and some existing packages uses Arduino /Raspberry Pi /Direct USB communication. I'm wondering if anyone has any experiences on this and would like to give me some directions. 

Thanks

Best, 
Allen

dihm....@gmail.com

unread,
Jan 19, 2021, 10:26:29 AM1/19/21
to the labscript suite
Allen,

I have looked into this in the past as we have an interest in using those eval boards to use some of the functionality of the AD9959 that is not exposed by our usual solution (the Novatechs, which use the same chip under the hood). My recommendation is that if you just need single tone outputs, you would be best off using the USB communication route (doesn't require extra hardware and is relatively simple). If you need complicated access to low level functionality of the AD9959 or want to optimize communication speed/latency go ahead an use the arduino (or any fast DIO platform, which could technically include a NI-DAQ). If you want to do hardware triggered step-sweeps (like the Novatech's current buffered mode) it is a bit of a toss-up which way will be better and you should probably just do what you are most comfortable with. That said, if your sweep has a lot of steps in it, you may be forced to use an external microcontroller (like the Pi or arduino) since I don't think the eval board microcontroller has a ton of on-board memory for storing the table.

In any case, you'll end up incorporating one of those libraries (or more likely creating a subset python package) into a custom written labscript device. Luckily, since the functionality will be largely identical t the Novatechs, implementation into labscript shouldn't be much more than modifying that device to suite the chosen library's communication needs. If you decide you need the arduino/Pi route, I know of someone already who is actively looking in to that who I could put you in touch with. When it comes to stuff like this, I'm definitely a believer in getting multiple people behind a single solution instead of merging multiple solutions together at the end.

Finally, when you get something working and reasonably tested, I would encourage you to consider making a PR to add it to labscript_devices. That eval board is a fairly ubiquitous item in labs and I think it would be a worthy addition to the suite. And I'm personally interested so am willing to help out as I can.

Best,
-David

Allen Chiu

unread,
Jan 19, 2021, 5:07:25 PM1/19/21
to the labscript suite

Hi David, 

Thanks for the info. I'm looking into the easy way first and this caught my attention: https://github.com/Schlabonski/evalcontrol, which takes the USB connection route. I wonder if I take the USB route, can I still trigger the AD9959 to do simple sweeps (sweep frequency or amplitude linearly)? When I google "AD9959 eval board, trigger" very little information came up, so I'm kind of suspicious if this is doable. If this feature already requires an external microcontroller, then I guess I can give it a try. (I'm relatively new to this, apologies if this is a stupid question) Can you let me know how to contact the person you mention?

Thanks!

Best, 
Allen

dihm....@gmail.com

unread,
Jan 22, 2021, 10:51:08 AM1/22/21
to the labscript suite
Allen,

I would say it depends on what exactly you mean by linear sweeps. The current labscript offering (the Novatechs) provide sweeps by discretely stepping the outputs as fast as the single-tone updates of the AD9959 (and the controlling microcontroller) allow. This works well for arbitary sweeps, but does add significant discretization noise when trying to do things fast (set by the ~10 kHz update rate). If this is what you are thinking, I would guess that the USB route will be tricky, but potentially possible in limited situations.

If, instead, you are referring to the AD9959 onboard accumulator sweeps which are significantly faster and finer tuned, but can only sweep one parameter at a time, then it is actually possible to use the USB route. These sweeps are ultimately triggered by the four profile pins, which are exposed via the eval board. There is a buffered and direct interface, which have different behavior depending on if you are using the eval board's microcontroller or not. If I remember correctly (so please check me before really trying), you can use the onboard microcontroller (USB mode) and external triggering of the profile pins by driving transistor switches that short the direct profile pins to ground. You then use the USB control to set them high, and can not control whether they are low externally. It sounds janky, but the way the profile pins work, they must always be high or low, so this style of control is valid.

There is also a possibility to modify the evalcontrol library to software write the profile pins, if that is of any interest, though it would be harder. I found this old conversation I had with someone else about this:
"As for the evalcontrol package, it appears it is not configured to read/write the profile pins, though that is obviously possible. Best I can suggest is a careful reading of the USB/Microcontroller datasheet to figure out how to set those pins high/low (the pins you need are labelled according to the microcontroller labelling in the eval board datasheet [ie PD0,1,2,3/FD8,9.10,11]). Controlling those pins will likely come down to writing to the correct pointer addresses in the controller and triggering updates." 

As for the other person, I'm confirming he is still working on this an OK with me sending out his contact info. I'll e-mail you direct, assuming he assents.
-David

Ivan Herrera

unread,
Jul 14, 2021, 12:25:56 AM7/14/21
to the labscript suite
Hi,

I know this is an old post but. I've developed a system to control a AD99959 eval board (from Aliexpress or Analog Devices) from Labscript. It's a bit involving since needs a PCB, (order the  PCB + soldering) and a microcontroller ESP32.
I can fully control the AD9959, i.e. write in each register, with simple python commands, integrated in Blacs. And as well a limited memory, in the EP32, where you can save instructions and
trigger externally.

Please let me know if you are interested.

Cheers,

Ivan  

tobia...@gmail.com

unread,
Jul 15, 2021, 3:57:03 AM7/15/21
to the labscript suite
Dear Ivan,

Thank you very much for your post!
For my point, I am very interested in your system and code.
It would be very useful for me to have the AD9959 implemented in BLACS, though it never became that essential for me to really develop it. I am thinking of applications like laser locking with the AD9959 as reference for a beat frequency with a master laser or steering an AOD with the frequency from the AD9959. So far, I am using large and expensive synthesizers for sometimes fairly easy jobs ;-)

Could you please make this system available to us?
I am not very familiar with the recent branches of labscript. But I am sure, a repository (like GitHub or what you prefer) with information about the PCB, the code on the ESP32 and your implementation into labscript would be a great enrichment.

Sincerely,
Tobias

Ivan Herrera

unread,
Jul 15, 2021, 4:01:47 AM7/15/21
to labscri...@googlegroups.com
Hi Tobias,

I'll clean up a bit the code and try to upload everything in something like Github.
Give me some time.

Cheers,

Ivan

--
You received this message because you are subscribed to a topic in the Google Groups "the labscript suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/labscriptsuite/zG7-dBZg-Ig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to labscriptsuit...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/labscriptsuite/1a0833c0-0de6-4aeb-8326-ed6509503603n%40googlegroups.com.

Ivan Herrera

unread,
Jul 20, 2021, 2:27:02 AM7/20/21
to the labscript suite
Hi,

I tried to clean up a bit the project and upload it to GitHub.


Let me know how goes.

Ivan

tobia...@gmail.com

unread,
Jul 21, 2021, 5:22:26 AM7/21/21
to the labscript suite
Hi Ivan,

Thank you very much.
I had a look at your test data and I am really impressed how good you managed to implement ramps and frequency changes with fast control by an external trigger.
This can really help me a lot!
That you communicate via WiFi with the ESP is the icing on the cake :-)

I am going to order the PCBs and see to get the parts. When I got it running or have any problems, I will tell you.

Best regards
Tobias

Ivan Herrera

unread,
Jul 21, 2021, 8:23:48 PM7/21/21
to the labscript suite
Hi Tobias,

I hope can help you with your research. A couple of remarks.

The PCB:
     -Isolators, interrupt_1, filters and pull-down pull-up resistors footprints are placed but not used. Isolators can be bypassed (with resistors) and not populated. You will need to use a jumper on R1 to connect the grounds in case no using isolators. And all the 5V power sections can be unpopulated as well if you don't use the isolators. Jumper R16 is necessary if you don't want to control the powerdown (floating is a problem).
    - SMA connectors have been used because are the standard of our lab. You can substitute with whatever is more suitable, twisted cable?
    - The connector between the AD eval-board and the ucontroller PCB is a bit tricky, the pitch between pins is correct but the distance between the two sections is not perfect. What I did is to place the connectors in the AD board, fit the PCB (this needs a bit of force) and solder the connectors. Another option is to use cables between board, but maybe the SPIclock have to be decreased.
    - Be sure to  set the jumpers on the AD eval-board to manual. 
.
The ESP32 ucontroller:
     - Be sure to order the right one there are many versions, check that the pinout and numbers of pins are correct.
     - Use version 1.0.4 from espressif in the Arduino board manager.  I know there are new versions but are not tested.

The WiFi connection:
    - I'm using a local network, i.e. I have a router in the lab.
    - A the beginning of the program the ESP32 will print out via MacAddress, and IP/password in case of being connected to the local network, set up a fixed IP for the board to avoid IP hopping. 

Sorry about all this stuff,  just want to make things more smooth.

Please let me know, how is going.

Cheers,
Ivan

Matthew Peters

unread,
Aug 12, 2021, 3:27:00 PM8/12/21
to the labscript suite
Hi all,

I've also made some code to talk to the AD9959 via an arduino here if anyone is interested: https://github.com/matth2peters/Rydberg_userlib/tree/main/user_devices/Rydberg/AD9959ArduinoComm
It has a blacs gui and just requires uploading the arduino code/making connections between arduino pins and AD9959

I haven't implemented a frequency ramp, but it can switch frequencies and set phases within a few tens of microseconds, which is good enough for what we're using it for.

Lufter Reis

unread,
Nov 14, 2023, 3:45:43 AM11/14/23
to the labscript suite
Hi all,
I am wondering if someone has already implemented something similar to what Matthew did in https://github.com/matth2peters/Rydberg_userlib/tree/main/user_devices/Rydberg/AD9959ArduinoComm, but with design logic more similar to the Novatec DDS. Instead of writing my own set_frequecny in BLACS_worker I am currently looking for the possibility of using the "setfreq(t, )" method that is already been provided by labscript.labscript.DDSQuantity. Or is there anybody that is interested in working on this together?


Best,
Chun-Wei
matthew.pe...@gmail.com 在 2021年8月12日 星期四下午3:27:00 [UTC-4] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages