Using RFX2400 from C++

Hi,

I’m trying to get the code together to enable the RFX2400 board from a
C++ program. I’m mostly looking in usrp.py, usrp1.py, db_base.py, and
db_flexrf.py and copying commands like write_io and write_oe into their
C++ versions. Is there good documentation on all of these various
commands, and/or is there an easier way to use the Python code to
instantiate the usrp data structure for me?

Thanks,

Dan

On Wed, Jan 03, 2007 at 01:01:36AM -0800, Dan H. wrote:

Dan

Hi Dan,

Converting this stuff all to C++ is “on the list”. In the meanwhile,
documentation of the primitives is contained in usrp_basic.h and
usrp_standard.h.

Eric

Dan, Eric, all:

I am interested in the same and am willing to help out. For now I’d be
happy with just getting the bits from the USRP (i.e. no graph theory).

Chris

On Wed, Jan 03, 2007 at 01:01:36AM -0800, Dan H. wrote:

Hi,

I’m trying to get the code together to enable the RFX2400 board from a
C++ program. I’m mostly looking in usrp.py, usrp1.py, db_base.py, and
db_flexrf.py and copying commands like write_io and write_oe into their
C++ versions. Is there good documentation on all of these various
commands, and/or is there an easier way to use the Python code to
instantiate the usrp data structure for me?

If you don’t want to maintain your own C++ interface, you can call the
python code from C++ using Boost:

Boost.Python - 1.82.0

  • Chris

I decided to take the path of least resistance and instrumented usrp1.py
to print whenever a set_* or write_* function was called. I then ran a
modified version of tunnel.py to get the following output (full output
attached as log):

_write_oe (, 0, 0, 65535) _write_fpga_reg (, 40, 0) set_pga (, 0, 0.0) set_pga (, 1, 0.0) _write_fpga_reg (, 20, 0) _write_fpga_reg (, 21, 0) _write_fpga_reg (, 22, 0)

I then took this output, grepped for source, and turned it into C code
(attached), but have been unable to get signal out. Interestingly, when
I screwed up and used the sink instead (that should be the transmit
path, right?), I did get signal out, albeit not pretty sine waves like I
expected (the signal was sent using usrp_siggen at the same freq with -w
0). I’m confused.

Also, I may be doing that thing with the write_spi wrong, I don’t know
how to properly handle the \x00s.
//
-Dan