Well, I now have my first user with a USRP2.
So, what are the gotchas that are going to bite me when supporting USRP2
in code that’s used to USRP1?
Setup seems a little different–only 1 TX and 1 RX channel, etc.
Here’s my new setup_usrp() function:
def setup_usrp(self):
if (self.usrp2 == False):
if (self.dual_mode == False and self.interferometer ==
False):
if (self.decim > 4):
self.u =
usrp.source_c(decim_rate=self.decim,fusb_block_size=8192)
else:
self.u =
usrp.source_c(decim_rate=self.decim,fusb_block_size=8192,
fpga_filename=“std_4rx_0tx.rbf”)
self.u.set_mux(usrp.determine_rx_mux_value(self.u,
self.rx_subdev_spec))
# determine the daughterboard subdevice we’re using
self.subdev[0] = usrp.selected_subdev(self.u,
self.rx_subdev_spec)
self.subdev[1] = self.subdev[0]
self.cardtype = self.subdev[0].dbid()
else:
self.u=usrp.source_c(decim_rate=self.decim,
nchan=2,fusb_block_size=8192)
self.subdev[0] = usrp.selected_subdev(self.u, (0, 0))
self.subdev[1] = usrp.selected_subdev(self.u, (1, 0))
self.cardtype = self.subdev[0].dbid()
self.u.set_mux(0x32103210)
c1 = self.subdev[0].name()
c2 = self.subdev[1].name()
if (c1 != c2):
print “Must have identical cardtypes for --dual_mode
or --interferometer”
sys.exit(1)
#
# Set 8-bit mode
#
width = 8
shift = 8
format = self.u.make_format(width, shift)
r = self.u.set_format(format)
else:
if (self.dual_mode == True or self.interferometer == True):
print "Cannot use dual_mode or interferometer with
single USRP2"
sys.exit(1)
self.u = usrp2.source_32fc(self.interface, self.mac_addr)
self.u.set_decim (self.decim)
self.cardtype = self.u.daughterboard_id()
Also, is there a way to set 8-bit mode on USRP2? Inquiring minds want
to know.
–
Marcus L.
Principal Investigator, Shirleys Bay Radio Astronomy Consortium