On Monday 06 October 2008 19:31:04 Stefan Brüns wrote:
> The DB code sets the gain in the 9862 to the wrong value (there is
> something wrong with the calculation of the register value from the gain in
> db) - this may be fixed in the cppdb feature branch.
Patch attached.
Stefan
--
Stefan Brüns / Bergstraße 21 / 52062 Aachen
mailto:lurch at gmx.li http://www.kawo1.rwth-aachen.de/~lurchi/
phone: +49 241 53809034 mobile: +49 151 50412019
=== modified file 'usrp/host/lib/legacy/usrp_basic.cc'
--- usrp/host/lib/legacy/usrp_basic.cc 2008-09-24 17:59:43 +0000
+++ usrp/host/lib/legacy/usrp_basic.cc 2008-10-06 17:32:31 +0000
@@ -37,6 +37,8 @@
#include <string.h>
#include <db_boards.h>
+#include <iostream>
+
using namespace ad9862;
#define NELEM(x) (sizeof (x) / sizeof (x[0]))
@@ -229,8 +231,22 @@
_write_fpga_reg (FR_DEBUG_EN, 0); // disable debug outputs
}
+static void
+dump_ddb(usrp_basic& u)
+{
+ for( int j = 0; j < 4; j++ ) {
+ std::vector<db_base_sptr> v = u.db(j);
+ std::cout << "db[" << j << "]: " << v.size() << std::endl;
+ for( int i = 0; i < v.size(); i++) {
+ std::cout << "\t" << i << ": " << v[i] << " - " << v[i]->name();
+ }
+ std::cout << std::endl;
+ }
+}
+
usrp_basic::~usrp_basic ()
{
+ dump_ddb(*this);
d_db.resize(0); // kill refs to daughterboards before closing USB
if (d_udh)
usb_close (d_udh);
@@ -601,7 +617,8 @@
bool
usrp_basic::_write_9862 (int which_codec, int regno, unsigned char value)
{
- if (0 && d_verbose){
+ //if (0 && d_verbose){
+ if (1){
// FIXME really want to enable logging in usrp_prims:usrp_9862_write
fprintf(stdout, "_write_9862(codec = %d, regno = %2d, val = 0x%02x)\n", which_codec, regno, value);
fflush(stdout);
=== modified file 'usrp/host/lib/legacy/usrp_basic.h'
--- usrp/host/lib/legacy/usrp_basic.h 2008-09-24 17:59:43 +0000
+++ usrp/host/lib/legacy/usrp_basic.h 2008-10-06 18:27:44 +0000
@@ -181,8 +181,8 @@
* \brief Return hardware step size of PGA (linear in dB).
*/
virtual double pga_db_per_step () const;
- double pga_tx_db_per_step () const { return 20.0 / 20; }
- double pga_rx_db_per_step () const { return 20.0 / 255; }
+ double pga_tx_db_per_step () const { return 20.0 / 255; }
+ double pga_rx_db_per_step () const { return 20.0 / 20; }
/*!
* \brief return frequency of master oscillator on USRP
_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio