From af0543a8b72e924c26503d838976e249d8ca6fbb Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 30 Aug 2010 18:42:45 -0700 Subject: usrp1: work on gpio clock divider for dbsrx, still not locking --- host/lib/usrp/usrp1/dboard_iface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/usrp1/dboard_iface.cpp') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index b2221e221..454de3ece 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -49,8 +49,8 @@ public: _codec = codec; //init the clock rate shadows - this->set_clock_rate(UNIT_RX, _clock->get_master_clock_freq()); - this->set_clock_rate(UNIT_TX, _clock->get_master_clock_freq()); + this->set_clock_rate(UNIT_RX, this->get_clock_rates(UNIT_RX).front()); + this->set_clock_rate(UNIT_TX, this->get_clock_rates(UNIT_TX).front()); } ~usrp1_dboard_iface() @@ -134,14 +134,14 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate) _clock_rates[unit] = rate; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - size_t divider = size_t(rate/_clock->get_master_clock_freq()); + size_t divider = size_t(_clock->get_master_clock_freq()/rate); switch(_dboard_slot){ case usrp1_impl::DBOARD_SLOT_A: - _iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_A_REFCLK, (2*divider & 0x7f) | 0x80); break; case usrp1_impl::DBOARD_SLOT_B: - _iface->poke32(FR_RX_B_REFCLK, (divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_B_REFCLK, (2*divider & 0x7f) | 0x80); break; } } @@ -151,7 +151,7 @@ std::vector usrp1_dboard_iface::get_clock_rates(unit_t unit) { std::vector rates; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - for (size_t div = 1; div <= 127; div++) + for (size_t div = 8; div <= 127; div++) rates.push_back(_clock->get_master_clock_freq() / div); } else{ -- cgit v1.2.3 From 9a3217cbbeb39d677a439fe0982a7ac4d7f251c2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 31 Aug 2010 13:21:32 -0700 Subject: usrp1: tested dbsrx, works with lower divider --- host/lib/usrp/usrp1/dboard_iface.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/usrp/usrp1/dboard_iface.cpp') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index 454de3ece..4791b55ce 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -137,11 +137,11 @@ void usrp1_dboard_iface::set_clock_rate(unit_t unit, double rate) size_t divider = size_t(_clock->get_master_clock_freq()/rate); switch(_dboard_slot){ case usrp1_impl::DBOARD_SLOT_A: - _iface->poke32(FR_RX_A_REFCLK, (2*divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_A_REFCLK, (divider & 0x7f) | 0x80); break; case usrp1_impl::DBOARD_SLOT_B: - _iface->poke32(FR_RX_B_REFCLK, (2*divider & 0x7f) | 0x80); + _iface->poke32(FR_RX_B_REFCLK, (divider & 0x7f) | 0x80); break; } } @@ -151,7 +151,7 @@ std::vector usrp1_dboard_iface::get_clock_rates(unit_t unit) { std::vector rates; if (unit == UNIT_RX && _rx_dboard_id == dbsrx_classic_id){ - for (size_t div = 8; div <= 127; div++) + for (size_t div = 1; div <= 127; div++) rates.push_back(_clock->get_master_clock_freq() / div); } else{ -- cgit v1.2.3