forked from M-Labs/artiq
1
0
Fork 0

runtime: enable ad9914 matched latency

This commit is contained in:
Sebastien Bourdeauducq 2015-08-22 12:25:44 +08:00
parent 094fc1cfd1
commit fba05531f4
2 changed files with 8 additions and 14 deletions

View File

@ -77,18 +77,12 @@ void dds_init(long long int timestamp, int channel)
#endif #endif
#ifdef DDS_AD9914 #ifdef DDS_AD9914
/* DDS_WRITE(DDS_CFR1H, 0x0000); /* Enable cosine output */
* Enable cosine output (to match AD9858 behavior) DDS_WRITE(DDS_CFR2L, 0x8900); /* Enable matched latency */
* Enable DAC calibration DDS_WRITE(DDS_CFR4H, 0x0105); /* Enable DAC calibration */
* Leave SYNCLK enabled and PLL/divider disabled
*/
DDS_WRITE(DDS_CFR1L, 0x0008);
DDS_WRITE(DDS_CFR1H, 0x0000);
DDS_WRITE(DDS_CFR4H, 0x0105);
DDS_WRITE(DDS_FUD, 0); DDS_WRITE(DDS_FUD, 0);
/* Disable DAC calibration */
now += DURATION_DAC_CAL; now += DURATION_DAC_CAL;
DDS_WRITE(DDS_CFR4H, 0x0005); DDS_WRITE(DDS_CFR4H, 0x0005); /* Disable DAC calibration */
DDS_WRITE(DDS_FUD, 0); DDS_WRITE(DDS_FUD, 0);
#endif #endif
} }

View File

@ -237,13 +237,13 @@ static void ddsinit(void)
long long int t; long long int t;
brg_ddsreset(); brg_ddsreset();
brg_ddswrite(DDS_CFR1L, 0x0008); brg_ddswrite(DDS_CFR1H, 0x0000); /* Enable cosine output */
brg_ddswrite(DDS_CFR1H, 0x0000); brg_ddswrite(DDS_CFR2L, 0x8900); /* Enable matched latency */
brg_ddswrite(DDS_CFR4H, 0x0105); brg_ddswrite(DDS_CFR4H, 0x0105); /* Enable DAC calibration */
brg_ddswrite(DDS_FUD, 0); brg_ddswrite(DDS_FUD, 0);
t = clock_get_ms(); t = clock_get_ms();
while(clock_get_ms() < t + 2); while(clock_get_ms() < t + 2);
brg_ddswrite(DDS_CFR4H, 0x0005); brg_ddswrite(DDS_CFR4H, 0x0005); /* Disable DAC calibration */
brg_ddsfud(); brg_ddsfud();
} }
#endif #endif