diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-06-27 12:00:18 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-06-27 12:00:18 -0700 |
commit | 5a0be9b1de7be7ba6c266dd742456a96e25373fc (patch) | |
tree | 6bcd3b02f399cc2677a6c747411d7e2ced1923f5 /host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | |
parent | e48659cec5207b598d877d8beca7e0b3807b617e (diff) | |
parent | 24db48766dff45b8fe8ed3031e09617ca92b84b6 (diff) | |
download | uhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.tar.gz uhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.tar.bz2 uhd-5a0be9b1de7be7ba6c266dd742456a96e25373fc.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp/x300/x300_radio_ctrl_impl.cpp')
-rw-r--r-- | host/lib/usrp/x300/x300_radio_ctrl_impl.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp index daae309c3..1a37cbdd1 100644 --- a/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp +++ b/host/lib/usrp/x300/x300_radio_ctrl_impl.cpp @@ -870,8 +870,14 @@ void x300_radio_ctrl_impl::synchronize_dacs(const std::vector<x300_radio_ctrl_im boost::posix_time::time_duration t_elapsed = boost::posix_time::microsec_clock::local_time() - t_start; - //Add 100% of headroom + uncertaintly to the command time - uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 13000 /*Scheduler latency*/; + //Set tick rate and make sure FRAMEP/N is 0 + for (size_t i = 0; i < radios.size(); i++) { + radios[i]->set_command_tick_rate(radios[i]->_radio_clk_rate, IO_MASTER_RADIO); + radios[i]->_regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 0); + } + + //Add 100% of headroom + uncertainty to the command time + uint64_t t_sync_us = (t_elapsed.total_microseconds() * 2) + 16000 /*Scheduler latency*/; //Pick radios[0] as the time reference. uhd::time_spec_t sync_time = @@ -879,15 +885,17 @@ void x300_radio_ctrl_impl::synchronize_dacs(const std::vector<x300_radio_ctrl_im //Send the sync command for (size_t i = 0; i < radios.size(); i++) { - radios[i]->set_command_tick_rate(radios[i]->_radio_clk_rate, IO_MASTER_RADIO); - radios[i]->_regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 0); radios[i]->set_command_time(sync_time, IO_MASTER_RADIO); //Arm FRAMEP/N sync pulse by asserting a rising edge - radios[i]->_regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 1); - radios[i]->_regs->misc_outs_reg.set(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 0); + radios[i]->_regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 1); radios[i]->set_command_time(uhd::time_spec_t(0.0), IO_MASTER_RADIO); } + //Reset FRAMEP/N to 0 + for (size_t i = 0; i < radios.size(); i++) { + radios[i]->_regs->misc_outs_reg.write(radio_regmap_t::misc_outs_reg_t::DAC_SYNC, 0); + } + //Wait and check status boost::this_thread::sleep(boost::posix_time::microseconds(t_sync_us)); for (size_t i = 0; i < radios.size(); i++) { |