From f41cdf4eeb31a2fed2a93b23e0fbe5f3b2142296 Mon Sep 17 00:00:00 2001 From: Thomas Tsou Date: Thu, 19 Aug 2010 19:33:18 -0700 Subject: usrp1: Change codec transmit gain scaling The AD9862 datasheet states that maximum gain is achieved with a value of 111111 (0x3f), however, empirical testing reveals that the gain scaling value spans the full register width of 8-bits. --- host/lib/usrp/usrp1/codec_ctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/usrp1/codec_ctrl.cpp b/host/lib/usrp/usrp1/codec_ctrl.cpp index a618eff6d..6751b9b7e 100644 --- a/host/lib/usrp/usrp1/codec_ctrl.cpp +++ b/host/lib/usrp/usrp1/codec_ctrl.cpp @@ -156,8 +156,8 @@ usrp1_codec_ctrl_impl::~usrp1_codec_ctrl_impl(void) **********************************************************************/ void usrp1_codec_ctrl_impl::set_tx_pga_gain(float gain) { - int gain_word = int(63*(gain - tx_pga_gain_range.min)/(tx_pga_gain_range.max - tx_pga_gain_range.min)); - _ad9862_regs.tx_pga_gain = std::clip(gain_word, 0, 63); + int gain_word = int(255*(gain - tx_pga_gain_range.min)/(tx_pga_gain_range.max - tx_pga_gain_range.min)); + _ad9862_regs.tx_pga_gain = std::clip(gain_word, 0, 255); this->send_reg(16); } -- cgit v1.2.3