Schlabonski / evalcontrol

A minimalistic python library to control the AD9959 DDS Evaluation Board.
3 stars 8 forks source link

How to set the modulation of the channel #4

Closed Hanros94 closed 3 years ago

Hanros94 commented 4 years ago

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

Schlabonski commented 4 years ago

Hi Hanros94,

what type of modulation do you want to use? If it is frequency modulation you are looking for, you can use the function

enable_modulation(self, level=2, active_channels=None, modulation_type='frequency')

and specify the modulation level (i.e. number of frequency words between which you switch) as well as the channel that you want to modulate. You will then also have to set the frequency words of the channel that you want to modulate using

set_frequency(self, frequency, channel=None, channel_word=0)

Did this help you?

Hanros94 commented 4 years ago

Hi Fabian

I want to perform a linear sweep and then activate it. I'm currently apply an external power to the P0 -P3 pins. Is it possible to switch these pins on and off just using the software. Likewise I would like to ramp up and down the amplitude during the linear sweep, I have read in the manual that I would need to control the SDIO pins, is this possible during linear sweep and is it possible just using the software.

Hanros94 commented 3 years ago

Hi Fabian

I have been able to get everything working but then I installed a different version of python 3.6 and I'm getting the following error. Did you get this error and if so how did you overcome this?

File "C:\Users\SinghRV-admin\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\backend\libusb1.py", line 604, in _check raise USBError(_strerror(ret), ret, _libusb_errno[ret]) usb.core.USBError: [Errno 2] Entity not found

Kind regards Roshan


From: Fabian T. notifications@github.com Sent: 09 November 2020 11:23 To: Schlabonski/evalcontrol evalcontrol@noreply.github.com Cc: Roshan Singh roshan.singh@new.ox.ac.uk; Author author@noreply.github.com Subject: Re: [Schlabonski/evalcontrol] How to set the modulation of the channel (#4)

Hi Hanros94,

what type of modulation do you want to use? If it is frequency modulation you are looking for, you can use the function

enable_modulation(self, level=2, active_channels=None, modulation_type='frequency')

and specify the modulation level (i.e. number of frequency words between which you switch) as well as the channel that you want to modulate. You will then also have to set the frequency words of the channel that you want to modulate using

set_frequency(self, frequency, channel=None, channel_word=0)

Did this help you?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Schlabonski/evalcontrol/issues/4#issuecomment-723951652, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APQOQ2SHK6J7ICK6BHGN26DSO7GMFANCNFSM4S74PZUA.

Schlabonski commented 3 years ago

Hi Roshan,

sorry I never ran into that error. Which version of python did you use before, when everything worked for you?

Cheers

Fabian

Hanros94 commented 3 years ago

Hi Fabian

Thanks for the reply.

I have got it working with python 3.6 it was an issue with not installing libusbdk. I have a few questions I was hoping you would be kind enough to answer:

1.In the function, set_frequency you have performed (2^32-1) whereas for set_phase you used (2^14), is this to allow for decimal places. I'm currently trying to set the amplitude to two decimal places so I assume I would use (2^10-1)?

  1. I also wanted to perform a linear sweep in amplitude, and in the AD9959 GUI, amplitude 2 level modulation and linear sweep seem to behave exactly the same, meaning the linear sweep is too fast with a maximum step size of 2.55 mircoseconds. I have written an amplitude linear sweep configure and enable functions and have attached them, could you spot what is wrong. All I have done is change the fraction for the rising and falling delta words to fraction = dw/1.0. linear_sweep_functions.txt
Schlabonski commented 3 years ago

Hi Roshan,

  1. Yes you're correct. The 2^n-1 does the conversion to an n-bit representation of the corresponding quantity, where n is the length of the register it is written to.
  2. Could you explain what you are trying to achieve and what is the outcome? If the ramp is too fast, did you try to decrease the amplitude step size?
Hanros94 commented 3 years ago

Hi Fabian

I have solved it now, it was just a case of learning binary notation!

Hanros94 commented 3 years ago

Hi Fabian

I have a new issue with initialising the board without the use of the native AD9959 software. I have posted the issue on your evalcontrol github page. Could you please advise me.

Kind regards Roshan


From: Fabian T. notifications@github.com Sent: 17 November 2020 13:06 To: Schlabonski/evalcontrol evalcontrol@noreply.github.com Cc: Roshan Singh roshan.singh@new.ox.ac.uk; Author author@noreply.github.com Subject: Re: [Schlabonski/evalcontrol] How to set the modulation of the channel (#4)

Hi Roshan,

  1. Yes you're correct. The 2^n-1 does the conversion to an n-bit representation of the corresponding quantity, where n is the length of the register it is written to.
  2. Could you explain what you are trying to achieve and what is the outcome? If the ramp is too fast, did you try to decrease the amplitude step size?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Schlabonski/evalcontrol/issues/4#issuecomment-728914429, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APQOQ2TDLYKQ223Q5O5MEV3SQJYMFANCNFSM4S74PZUA.