diff --git a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/cx9261adriver.cc b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/cx9261adriver.cc index 55d29ea..8b37782 100644 --- a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/cx9261adriver.cc +++ b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/cx9261adriver.cc @@ -896,13 +896,14 @@ bool afcPll1() writeSpi(0x617, 0x03); pause(delay_afc); writeSpi(0x61D, saved); - pause(delay_afc); - const auto lock = readSpi(0x635); +// pause(delay_afc); +// const auto lock = readSpi(0x635); // const auto lock1 = readSpi(0x635); // const auto lock2 = readSpi(0x635); // const auto lock3 = readSpi(0x635); // return 0x10 & lock & lock1 & lock2 & lock3 ; - return 0x10 & lock ; +// return 0x10 & lock ; + return true ; } bool afcPll2() @@ -915,13 +916,15 @@ bool afcPll2() writeSpi(0x639, 0x03); pause(delay_afc); writeSpi(0x63F, saved); - pause(delay_afc); - const auto lock = readSpi(0x657); +// pause(delay_afc); +// const auto lock = readSpi(0x657); // const auto lock1 = readSpi(0x657); // const auto lock2 = readSpi(0x657); // const auto lock3 = readSpi(0x657); // return 0x10 & lock & lock1 & lock2 & lock3 ; - return 0x10 & lock ; +// return 0x10 & lock ; + + return true ; } bool afcPll3() diff --git a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/defs.h b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/defs.h index 053f447..df123b6 100644 --- a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/defs.h +++ b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/defs.h @@ -55,7 +55,7 @@ enum class NCOMode { Bypass = 0, Up, Down, BIST, Master, Slaver }; * @brief AFC等待延时,单位ms */ constexpr double delay = 100; -constexpr double delay_afc = 0.020; +constexpr double delay_afc = 0.025; /** * @brief QEC等待延时,单位ms */ diff --git a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/frqhop_config.cc b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/frqhop_config.cc index 6df37de..c4a9c93 100644 --- a/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/frqhop_config.cc +++ b/cx9261a_demo_cmos_20240513/vitis_classic_autobuild/source_CX9261A_CPPV4/frqhop_config.cc @@ -29,6 +29,7 @@ void frqhop_config(int hop_flag){ static int hop_cnt = 0; static int next_pll_index = 2; static double curr_freq; + static double hop_freq = MIN_FREQ + FREQ_SEP; static double next_freq = MIN_FREQ; static int unlock_pll1_cnt = 0, unlock_pll2_cnt = 0; @@ -36,13 +37,17 @@ void frqhop_config(int hop_flag){ { curr_freq = next_freq; hop_cnt++; - if (hop_cnt % 3 == 2) + if (hop_cnt % 3 == 0) { next_freq = MIN_FREQ; } else { - next_freq = (curr_freq + FREQ_SEP > MAX_FREQ) ? MIN_FREQ : curr_freq + FREQ_SEP; + hop_freq += FREQ_SEP; + if( hop_freq > MAX_FREQ){ + hop_freq = MIN_FREQ + FREQ_SEP; + } + next_freq = hop_freq; } if (next_pll_index == 2)