Skip to content

liyuan-qiu/DDS-ARDUINO

Repository files navigation

DDS-ARDUINO

The pin is based on the hardware https://github.com/afch/DDS-AD9910-Arduino-Shield. But I only use the single tone mode and profile play mode.

  1. The AD9910-profile-play-matlab file (https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910-profile-play-matlab) contains the arduino file and the matlab spi control file, but the profile play function can't be triggered by the DDS_trigger input pin.
  2. The AD9910_with_trigger_direct_finish file(https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910_with_trigger_direct_finish) contains the arduino file which can realize the triggered profile play funtion but the parameters can't be transferred from the SPI port. In fact, I will combine these two files in the future.
  3. The fast verstion(https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910_with_trigger_direct_fast) has improved the DDS_trigger response time as shown in Section:DigitalWrite&DigitalRead different function.
  4. The interrupt version(https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910_with_trigger_interrupt) is the updated version that can load profile and time sequence from serial input and can be triggered to play profile by interruption from pin 18 or pin 19.

Profile Play mode

The profile play mode time sequence with parameters set in file https://github.com/liyuan-qiu/DDS-ARDUINO/blob/AD9910-shield-spi-test-finish/AD9910_with_trigger_direct_finish/AD9910_with_trigger_direct.ino is shown in the following figure
int time_group=5;//the group you want to play
long time_play[5]={1546,899,300,675,200};//unit us, the length of time_show should be time_group
int profile_play[5]={2,1,3,5,7};// profile_play should be 0,1,2,...,7
The red line is the DDS_trigger signal and the blue line is the Profile=2b[Profile2,Profile1,Profile0] signal.

The following is the test result of profile play function which don't include the frequency noise because the frequency noise had been tested by the developer https://github.com/afch/DDS-AD9910-Arduino-Shield.

Profile Play time test: the difference between set profile time and real profile time

The CH1(yellow line) is Profile0, arduino mega pin 4
The CH2(blue line) is FOUT AM from the output of minicircuit power detector

There are two types of time counting

  1. when T_set<=16383us the time counting is delayMicroseconds(us) T_real=1.0202*T_set + 18.516(us) The first coefficient maybe from the system clock and the second coefficient maybe from the delay.
  2. When T_set>16383us, the time counting is delay(ms) T_real= 1.0071*T_set + 0.127(ms)

Delay test

Delay between the Profile0 pin and FOUT

The FOUT delay from Profile0 change is smaller than 0.5us.
The CH1(yellow line) is profile0, arduino mega pin 4
The CH2(blue line) is FOUT AM from the output of minicircuit power detector

image

Delay between the DDS_trigger and Profile0 pin

CH1(yellow) is DDS_Trigger--arduino Mega A8 pin
CH3(pink) is Profile0 CH2(blue) is FOUT AMP

The delay between CH1 and CH3 is not fix, the delay time is between 9-14us.
The delay between CH2 and CH3 is smaller than 0.5us

Profile switch robustness test

The profile switch bug is reported in the JQI DDS design and the artiq dds design, so I tested the profile switch function in this DDS. The result shows no bug in profile switch process.

Profile Play with sequence 0,1,2…7

%在profile里面写入相同频率不同幅度的信号
freq_set=ones(1,8)300;%MHz
amp_set=(-40:5:-5);%dBm
Profile_set=[0,1,2,3,4,5,6,7];
%profile按照0,1,2…7顺序来切换
time_set=ones(1,8)
(400);%delay us
profile_list=[0,1,2,3,4,5,6,7];
The result is shown below

Result:There is no wrong at 40 times of profile play

Profile Play with sequence 3,4,3,4,3,4,.....

freq_set=ones(1,8)*300;%MHz
amp_set=[-40,-40,-40,0,-20,-40,-40,-40];%dBm
Profile_set=[0,1,2,3,4,5,6,7];

time_set=ones(1,20)*(400);%delay us
profile_list=[3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4,3,4];

Result:There is no wrong at 100 times of profile play

DigitalWrite&DigitalRead different function

1. 全部用digitalWrite&digitalRead

(https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910_with_trigger_direct_finish) 用FOUT与DDS_trigger之间的delay时间在9-14us之间
image
同时出现profile0,1,2三个引脚切换不同时的问题,导致出现第三个态

2. digitalWrite&digitalRead换成直接控制

(https://github.com/liyuan-qiu/DDS-ARDUINO/tree/AD9910-shield-spi-test-finish/AD9910_with_trigger_direct_fast) FOUT与DDS_trigger之间delay是3.2-6us,但偶尔会到大约9-11us的地方,不是很robust

3. digitalWrite换成直接控制,digitalRead()继续使用

FOUT与DDS_trigger之间delay是2.8-8us
偶尔到11us
如果对于切换profile时间要求很高的话,可以将profile0,1,2三个引脚换成FPGA直接控制,arduino Mega只是作为load register所用

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors