changeset 23:65e277fdf01f

Correct DDS3 frequency adjustement on N3 measurement We need to take into account the phase locked loop divisor factor that links DDS1 frequency change to repetition rate change.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 20 Jul 2012 16:50:11 +0200
parents b7b3b5f1c5a6
children b838371c7a91
files FXAnalyse.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Thu Jul 19 20:01:40 2012 +0200
+++ b/FXAnalyse.c	Fri Jul 20 16:50:11 2012 +0200
@@ -1222,7 +1222,7 @@
 									SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4 + DeltakHz_3 * 1000);
 									DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4 + DeltakHz_3 * 1000);
 									// compensate with DDS3 to keep measured beatnote in counter box range
-									double fDDS3 = FrequencyDDS3Init + N3/N1 * DeltakHz_3;
+									double fDDS3 = FrequencyDDS3Init + N3/N1 * Ndiv * DeltakHz_3;
 									SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3);
 									DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3);
 									// allow counter to settle
@@ -1254,7 +1254,7 @@
 									SetCtrlVal(MainPanel, PANEL_DDS4, FrequDDS4 - DeltakHz_3 * 1000);
 									DDS4xAD9912_SetFrequency(&DDS4xAD9912, 4, FrequDDS4 - DeltakHz_3 * 1000);
 									// compensate with DDS3 to keep measured beatnote in counter box range
-									double fDDS3 = FrequencyDDS3Init - N3/N1 * DeltakHz_3;
+									double fDDS3 = FrequencyDDS3Init - N3/N1 * Ndiv * DeltakHz_3;
 									SetCtrlVal(MainPanel, PANEL_DDS3, fDDS3);
 									DDS4xAD9912_SetFrequency(&DDS4xAD9912, 3, fDDS3);
 									// allow counter to settle