diff options
author | Thomas Tsou <ttsou@vt.edu> | 2010-08-19 19:33:18 -0700 |
---|---|---|
committer | Thomas Tsou <ttsou@vt.edu> | 2010-08-19 19:33:18 -0700 |
commit | f41cdf4eeb31a2fed2a93b23e0fbe5f3b2142296 (patch) | |
tree | 4ef9b7cbe4ca3fdee666789bbfd53354cf7b3bc1 /host/lib/usrp/usrp1/codec_ctrl.cpp | |
parent | dafbb2c047fc0878288a67ec161c7c2735e1dcb8 (diff) | |
download | uhd-f41cdf4eeb31a2fed2a93b23e0fbe5f3b2142296.tar.gz uhd-f41cdf4eeb31a2fed2a93b23e0fbe5f3b2142296.tar.bz2 uhd-f41cdf4eeb31a2fed2a93b23e0fbe5f3b2142296.zip |
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.
Diffstat (limited to 'host/lib/usrp/usrp1/codec_ctrl.cpp')
-rw-r--r-- | host/lib/usrp/usrp1/codec_ctrl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |