diff options
author | matt | 2007-08-09 11:54:21 +0000 |
---|---|---|
committer | matt | 2007-08-09 11:54:21 +0000 |
commit | a4e4925de62b771d850972917ed802d7c467f2c7 (patch) | |
tree | 1fa439d0f8f4f4e13c7527cf0367d307f0e5b056 /gr-usrp/src/db_flexrf.py | |
parent | 9967e2e7664dbc96a5d1587c194cc648d01cf487 (diff) | |
download | gnuradio-a4e4925de62b771d850972917ed802d7c467f2c7.tar.gz gnuradio-a4e4925de62b771d850972917ed802d7c467f2c7.tar.bz2 gnuradio-a4e4925de62b771d850972917ed802d7c467f2c7.zip |
minor fixes
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@6129 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-usrp/src/db_flexrf.py')
-rw-r--r-- | gr-usrp/src/db_flexrf.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gr-usrp/src/db_flexrf.py b/gr-usrp/src/db_flexrf.py index 31c75c31f..bb2acbb64 100644 --- a/gr-usrp/src/db_flexrf.py +++ b/gr-usrp/src/db_flexrf.py @@ -98,7 +98,7 @@ class flexrf_base(db_base.db_base): Adds 10ms delay between writing control and N if this is first call. This is the required power-up sequence. - @param $: 24-bit R counter latch + @param R: 24-bit R counter latch @type R: int @param control: 24-bit control latch @type control: int @@ -345,6 +345,7 @@ class flexrf_base_rx(flexrf_base): @returns True/False """ maxgain = self.gain_range()[1] - self._u.pga_max() + mingain = self.gain_range()[0] if gain > maxgain: pga_gain = gain-maxgain assert pga_gain <= self._u.pga_max() @@ -355,7 +356,7 @@ class flexrf_base_rx(flexrf_base): V_maxgain = .2 V_mingain = 1.2 V_fullscale = 3.3 - dac_value = (agc_gain*(V_maxgain-V_mingain)/maxgain + V_mingain)*4096/V_fullscale + dac_value = (agc_gain*(V_maxgain-V_mingain)/(maxgain-mingain) + V_mingain)*4096/V_fullscale assert dac_value>=0 and dac_value<4096 return self._u.write_aux_dac(self._which, 0, int(dac_value)) and \ self._set_pga(int(pga_gain)) |