Most example code in gnuradio-examples/ is written for the USRP. If you are new to this (as I am), it is somewhat tricky to update the USRP1 code into working with the USRP2.
This is a short list of what you can try out. It was deduced from a simple diff between usrp_wfm_rcv.py and usrp2_wfm_rcv.py in gnuradio git. My setup is a simple USRP2 with the TVRX frontend, running gnuradio from ubuntu maverick apt.
- basics first: “from gnuradio import usrp2” instead of usrp.
- you don’t need to pick a subdevice, nor the usrp_dbid stuff.
- usrp.source_c() is now usrp2.source_32fc(). You don’t need to bother with the interface/MAC-addr arguments, it will autodetect.
- decimation levels will be higher on the USRP2. The USRP1 features 64 MS/s (megasamples/sec), while the USRP2 can do 100 MS/s. Multiply the USRP1 decimation rate with (100/64) to get the USRP2 equivalent.
- set gain on the usrp2 object instead of on the subdevice.
- usrp.set_decim_rate(decim) is now usrp2.set_decim(decim).
- usrp.tune(usrpobj, ..) is usrp2obj.set_center_freq(freq).
Some code examples to make it easier to understand:
< g = self.subdev.gain_range()
> g = self.u.gain_range()
< r = usrp.tune(self.u, 0, self.subdev, target_freq)
> r = self.u.set_center_freq(target_freq)
The full diff (liberal use of –unified to get the complete files) can be seen in Gist 654211.