From 4ac4f25aba479a21e73539eb29b56951247c2e8a Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Thu, 30 Dec 2010 18:09:54 -0800 Subject: USRP1: Fix ATR for TX/full duplex --- host/lib/usrp/usrp1/dboard_iface.cpp | 46 ++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index 70ce3da76..c2c971269 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -267,22 +267,38 @@ void usrp1_dboard_iface::_set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t value) { // Ignore unsupported states - if ((atr == ATR_REG_IDLE) || (atr == ATR_REG_FULL_DUPLEX)) + if ((atr == ATR_REG_IDLE)) return; - - switch(unit) { - case UNIT_RX: - if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) - _iface->poke32(FR_ATR_RXVAL_1, value); - else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) - _iface->poke32(FR_ATR_RXVAL_3, value); - break; - case UNIT_TX: - if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) - _iface->poke32(FR_ATR_TXVAL_0, value); - else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) - _iface->poke32(FR_ATR_TXVAL_2, value); - break; + if(atr == ATR_REG_RX_ONLY) { + switch(unit) { + case UNIT_RX: + if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) + _iface->poke32(FR_ATR_RXVAL_1, value); + else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) + _iface->poke32(FR_ATR_RXVAL_3, value); + break; + case UNIT_TX: + if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) + _iface->poke32(FR_ATR_RXVAL_0, value); + else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) + _iface->poke32(FR_ATR_RXVAL_2, value); + break; + } + } else if (atr == ATR_REG_TX_ONLY && atr == ATR_REG_FULL_DUPLEX) { + switch(unit) { + case UNIT_RX: + if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) + _iface->poke32(FR_ATR_TXVAL_1, value); + else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) + _iface->poke32(FR_ATR_TXVAL_3, value); + break; + case UNIT_TX: + if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) + _iface->poke32(FR_ATR_TXVAL_0, value); + else if (_dboard_slot == usrp1_impl::DBOARD_SLOT_B) + _iface->poke32(FR_ATR_TXVAL_2, value); + break; + } } } /*********************************************************************** -- cgit v1.2.3 From 3f30734fbace70c952c2939ed0cd9fff7b6e4914 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 31 Dec 2010 11:27:53 -0800 Subject: xcvr2450: update comment for full duplex case --- host/lib/usrp/dboard/db_xcvr2450.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp index a3a1e6242..e76727bec 100644 --- a/host/lib/usrp/dboard/db_xcvr2450.cpp +++ b/host/lib/usrp/dboard/db_xcvr2450.cpp @@ -245,7 +245,8 @@ void xcvr2450::update_atr(void){ int band_sel = (xcvr2450::is_highband(_lo_freq))? HB_PA_TXIO : LB_PA_TXIO; int tx_ant_sel = (_tx_ant == "J1")? ANTSEL_TX1_RX2_TXIO : ANTSEL_TX2_RX1_TXIO; int rx_ant_sel = (_rx_ant == "J2")? ANTSEL_TX1_RX2_TXIO : ANTSEL_TX2_RX1_TXIO; - int xx_ant_sel = tx_ant_sel; //prefer the tx antenna selection for full duplex (rx will get the other antenna) + int xx_ant_sel = tx_ant_sel; //Prefer the tx antenna selection for full duplex, + //due to the issue that USRP1 will take the value of full duplex for its TXATR. int ad9515div = (_ad9515div == 3)? AD9515DIV_3_TXIO : AD9515DIV_2_TXIO; //set the tx registers -- cgit v1.2.3 From b4d58f3501596fdddf240d576d0b1b2cb5862892 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Fri, 31 Dec 2010 10:31:42 -0800 Subject: USRP1: REALLY fix the full-duplex case. --- host/lib/usrp/usrp1/dboard_iface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp1/dboard_iface.cpp b/host/lib/usrp/usrp1/dboard_iface.cpp index c2c971269..4e47d6bf6 100644 --- a/host/lib/usrp/usrp1/dboard_iface.cpp +++ b/host/lib/usrp/usrp1/dboard_iface.cpp @@ -267,7 +267,7 @@ void usrp1_dboard_iface::_set_atr_reg(unit_t unit, atr_reg_t atr, boost::uint16_t value) { // Ignore unsupported states - if ((atr == ATR_REG_IDLE)) + if ((atr == ATR_REG_IDLE) || (atr == ATR_REG_TX_ONLY)) return; if(atr == ATR_REG_RX_ONLY) { switch(unit) { @@ -284,7 +284,7 @@ void usrp1_dboard_iface::_set_atr_reg(unit_t unit, _iface->poke32(FR_ATR_RXVAL_2, value); break; } - } else if (atr == ATR_REG_TX_ONLY && atr == ATR_REG_FULL_DUPLEX) { + } else if (atr == ATR_REG_FULL_DUPLEX) { switch(unit) { case UNIT_RX: if (_dboard_slot == usrp1_impl::DBOARD_SLOT_A) -- cgit v1.2.3