usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

UHD Python API: X310 ATR TX not working

TV
Tim Vancauwenbergh
Fri, Dec 13, 2024 2:39 PM

Hi all,

In a project using an X310 and the Python api the requirement is to toggle
GPIO pins 0 and 1 whenever the device is transmitting or receiving.
The code is as follows:
PIN_0_MASK = (1 << 0)
PIN_1_MASK = (1 << 1)
PIN_MASK = PIN_0_MASK | PIN_1_MASK

usrp.set_gpio_attr("FP0A", "CTRL", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "DDR", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_0X", 0x000, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_RX", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_TX", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_XX", 0x000, 0xFFF)
This works for ATR_RX, but TX does not trigger the ATR. While the LED does
light up, the GPIO pin does nothing.
Both TX and RX are bursted. Is this a bug?

Thanks!

Tim

Hi all, In a project using an X310 and the Python api the requirement is to toggle GPIO pins 0 and 1 whenever the device is transmitting or receiving. The code is as follows: PIN_0_MASK = (1 << 0) PIN_1_MASK = (1 << 1) PIN_MASK = PIN_0_MASK | PIN_1_MASK usrp.set_gpio_attr("FP0A", "CTRL", PIN_MASK, 0xFFF) usrp.set_gpio_attr("FP0A", "DDR", PIN_MASK, 0xFFF) usrp.set_gpio_attr("FP0A", "ATR_0X", 0x000, 0xFFF) usrp.set_gpio_attr("FP0A", "ATR_RX", PIN_MASK, 0xFFF) usrp.set_gpio_attr("FP0A", "ATR_TX", PIN_MASK, 0xFFF) usrp.set_gpio_attr("FP0A", "ATR_XX", 0x000, 0xFFF) This works for ATR_RX, but TX does not trigger the ATR. While the LED does light up, the GPIO pin does nothing. Both TX and RX are bursted. Is this a bug? Thanks! Tim
MB
Martin Braun
Thu, Dec 19, 2024 11:29 AM

Hi Tim,

thanks for submitting the bug report as well as sending this email. Makes
it easier for us to track things.

Out of curiosity, have you tried setting the last line (for the ATR_XX
attribute) to HIGH as well? If you're only doing TX, then it shouldn't
matter but it's just another data point. Also, have you tried using pins 0
and 1 for different ATR states (again, shouldn't matter, I'm just trying to
get a bigger picture). Your code is correct if you want pins 0 and 1 be
high for whenever there is RX or TX going on (but not when both are on at
the same time), although the call to the DDR attribute is redundant (ATR
pins are always outputs); but it's not hurting either.

--M

On Fri, Dec 13, 2024 at 3:39 PM Tim Vancauwenbergh <
tim.vancauwenbergh13@gmail.com> wrote:

Hi all,

In a project using an X310 and the Python api the requirement is to toggle
GPIO pins 0 and 1 whenever the device is transmitting or receiving.
The code is as follows:
PIN_0_MASK = (1 << 0)
PIN_1_MASK = (1 << 1)
PIN_MASK = PIN_0_MASK | PIN_1_MASK

usrp.set_gpio_attr("FP0A", "CTRL", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "DDR", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_0X", 0x000, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_RX", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_TX", PIN_MASK, 0xFFF)
usrp.set_gpio_attr("FP0A", "ATR_XX", 0x000, 0xFFF)
This works for ATR_RX, but TX does not trigger the ATR. While the LED does
light up, the GPIO pin does nothing.
Both TX and RX are bursted. Is this a bug?

Thanks!

Tim


USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-leave@lists.ettus.com

Hi Tim, thanks for submitting the bug report as well as sending this email. Makes it easier for us to track things. Out of curiosity, have you tried setting the last line (for the ATR_XX attribute) to HIGH as well? If you're only doing TX, then it shouldn't matter but it's just another data point. Also, have you tried using pins 0 and 1 for different ATR states (again, shouldn't matter, I'm just trying to get a bigger picture). Your code is correct if you want pins 0 and 1 be high for whenever there is RX or TX going on (but not when both are on at the same time), although the call to the DDR attribute is redundant (ATR pins are always outputs); but it's not hurting either. --M On Fri, Dec 13, 2024 at 3:39 PM Tim Vancauwenbergh < tim.vancauwenbergh13@gmail.com> wrote: > Hi all, > > In a project using an X310 and the Python api the requirement is to toggle > GPIO pins 0 and 1 whenever the device is transmitting or receiving. > The code is as follows: > PIN_0_MASK = (1 << 0) > PIN_1_MASK = (1 << 1) > PIN_MASK = PIN_0_MASK | PIN_1_MASK > > usrp.set_gpio_attr("FP0A", "CTRL", PIN_MASK, 0xFFF) > usrp.set_gpio_attr("FP0A", "DDR", PIN_MASK, 0xFFF) > usrp.set_gpio_attr("FP0A", "ATR_0X", 0x000, 0xFFF) > usrp.set_gpio_attr("FP0A", "ATR_RX", PIN_MASK, 0xFFF) > usrp.set_gpio_attr("FP0A", "ATR_TX", PIN_MASK, 0xFFF) > usrp.set_gpio_attr("FP0A", "ATR_XX", 0x000, 0xFFF) > This works for ATR_RX, but TX does not trigger the ATR. While the LED does > light up, the GPIO pin does nothing. > Both TX and RX are bursted. Is this a bug? > > Thanks! > > Tim > _______________________________________________ > USRP-users mailing list -- usrp-users@lists.ettus.com > To unsubscribe send an email to usrp-users-leave@lists.ettus.com >