# Enveloping a transmit amplifier

**URL:** <https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058>\
**Category:** GNU Radio\
**Created:** [August 18, 2015, 9:18pm UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058 "2015-08-18T21:18:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [August 18, 2015, 9:18pm UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058/1 "2015-08-18T21:18:43Z")

</div>

Hello,

I’m transmitting a fairly bursty, irregularly timed signal. I attach a  
stream tag to the sample that has the start of the burst (tx\_sob). I  
also  
have a PA that I can turn on and off that’s inbetween my USRP B210 and  
antenna.

I’d like to be able to turn the PA on and off synchronously, say 50 ms  
before tx\_sob is to be transmitted.

Is there any way to do this? I’m thinking I could add a new tag that’s  
50  
ms before my transmission but then how would I synchronously turn on the  
PA? Is there something like a callback function I can use? Does the  
UHD  
or the UHD block have this functionality?

Thanks for any help,  
Devin

---

<div class="post-metadata">

**Author:** ![devin\_kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@devin\_kelly](https://www.ruby-forum.com/u/devin_kelly)\
**Post date:** [August 19, 2015, 11:45am UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058/2 "2015-08-19T11:45:01Z")

</div>

Hi Devin,

You wanted to ramp up/down the external PA: Use the GPIO pins, and the  
ATR registers [1] or timed commands issued over the message bus [2] to  
change their state

Best regards,  
Marcus

[1] [USRP Hardware Driver and USRP Manual: GPIO API](http://files.ettus.com/manual/page_gpio_api.html#xgpio_fpanel_atr)  
[2] [GNU Radio Manual and C++ API Reference: UHD Interface](http://gnuradio.org/doc/doxygen/page_uhd.html#uhd_command_syntax)

---

<div class="post-metadata">

**Author:** ![devin\_kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@devin\_kelly](https://www.ruby-forum.com/u/devin_kelly)\
**Post date:** [August 19, 2015, 2:30pm UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058/3 "2015-08-19T14:30:57Z")

</div>

Marcus,

Thanks for the advice, this seems to do exactly what I’m looking for.  
My  
only question is that I’ve been under the impression that the UHD  
doesn’t  
yet support GPIO for the B210. I did recently upgrade to 3.8.5 though  
so  
maybe things have changed?

Devin

On Wed, Aug 19, 2015 at 5:43 AM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![devin\_kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@devin\_kelly](https://www.ruby-forum.com/u/devin_kelly)\
**Post date:** [August 19, 2015, 8:45pm UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058/4 "2015-08-19T20:45:26Z")

</div>

I tried this out and I’m having some problems. I’m on GR 3.7.8 and UHD  
3.8.5, both the newest as far as I know.

What I did was make a flowgraph with a signal generator source and a UHD  
sink in GRC. It works before I made any modifications. There are a  
few  
lines in top\_block.py that set the sample rate, antenna, etc. At the  
end  
of them I added this:

self.uhd\_usrp\_sink\_0.set\_gpio\_attr(“TXA”, “ATR\_TX”, 1, 0x10, 0)

It should set pin 4 high whenever I transmit (right?). I run my  
flowgraph  
and get this traceback:

Traceback (most recent call last):  
File “top\_block.py”, line 76, in   
tb = top\_block()  
File “top\_block.py”, line 55, in **init**  
self.uhd\_usrp\_sink\_0.set\_gpio\_attr(“TXA”, “ATR\_TX”, 1, 0x10, 0)  
File  
“/usr/local/lib64/python2.7/site-packages/gnuradio/uhd/uhd\_swig.py”,  
line 4539, in set\_gpio\_attr  
return \_uhd\_swig.usrp\_sink\_sptr\_set\_gpio\_attr(self, bank, attr,  
value,  
mask, mboard)  
RuntimeError: LookupError: Path not found in tree:  
/mboards/0/dboards/A/iface

I know I’m using the right banks because I can do this command:

$ python -c ‘from gnuradio import uhd; usrp =  
uhd.multi\_usrp\_sink(“serial=”, uhd.io\_type.COMPLEX\_FLOAT32, 1);  
print usrp.get\_gpio\_banks(0)’

and get

(‘RXA’, ‘TXA’)

I also run this command:

uhd\_usrp\_probe --args=‘serial=’ --tree | grep -i iface

and get nothing. Without piping into grep I get 177 lines that all seem  
to  
make sense to me.

Is that command I’m using correct or is there some other issue?

Thanks,  
Devin

---

<div class="post-metadata">

**Author:** ![devin\_kelly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@devin\_kelly](https://www.ruby-forum.com/u/devin_kelly)\
**Post date:** [August 21, 2015, 3:02pm UTC](https://www.ruby-forum.com/t/enveloping-a-transmit-amplifier/243058/5 "2015-08-21T15:02:04Z")

</div>

For anyone interested I took this to the USRP Users list and got the  
issue  
resolved.

The gist of it was that none of the GPIO code got moved into any of the  
releases until UHD 3.9.

[http://lists.ettus.com/pipermail/usrp-users\_lists.ettus.com/2015-August/015455.html](http://lists.ettus.com/pipermail/usrp-users_lists.ettus.com/2015-August/015455.html)
