discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] USRP2 write_gpio() command


From: Ryan L. Buffington
Subject: [Discuss-gnuradio] USRP2 write_gpio() command
Date: Mon, 19 Jul 2010 12:18:06 -0600

I'm trying to use one of the GPIO pins on my USRP 2 / WBX daughtercard to 
control an external antenna selector box. I've created a simple GUI with a 
USRP2 source feeding into a graphical FFT sink, and I'm able to change the 
state of io_tx_14 using the following code:

#this code is called when the program is started
self.gr_null_sink_0 = gr.null_sink(gr.sizeof_gr_complex*1)
self.howto_rx_gpio_0 = usrp2.source_32fc()
self.howto_rx_gpio_0.set_decim(decimation)
self.howto_rx_gpio_0.set_center_freq(frequency)
self.howto_rx_gpio_0.set_gain(daughtercard_gain)
self.howto_rx_gpio_0.set_gpio_ddr(0xffff, 0b0100000000000000)  #set the DDR
self.howto_rx_gpio_0.set_gpio_sels(".s..............") #set the output 
selection register

....

#this code is called when the checkbox on the GUI is changed
def set_check(self, check):
        self.check = check
        self._check_check_box.set_value(self.check)
        self.howto_rx_gpio_0.write_gpio(self.check * 2**14, 0xffff)

The problem is that whenever I change the value of the checkbox, the FFT sink 
freezes and stops displaying new values, or it begins displaying garbage at 
like -300 dB. The pin continues to change from high to low just fine even after 
the FFT sink stops updating. I've tried restarting the source using the stop() 
and start() commands, but this does not help. The problem is not unique to the 
FFT sink - applying the same code to a working NBFM receiver causes the audio 
sink to start playing popping sounds. I considered using gr-gpio, but this 
requires custom firmware, and I'm already running custom firmware to support my 
WBX daughtercard. Does anyone have any ideas?

-- Ryan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]