[USRP-users] E310 GPIO ATR not working

2024-05-01 Thread Ethan C
I'm trying to use the GPIO ATR functionality on an E310 using a 'Python
Snippet' block in Gnuradio. I have code that works this way for a B210 and
am adapting it to work for the E310. However, I have not had any success.
The get_gpio_attr READBACK attribute (reads back input GPIOs but can also
read which output pins are high) print statements indicate GPIO data pin 6
should be high but there is nothing there when checked with a voltmeter.
I'm happy to provide any additional information.
Thanks,
Ethan

E310 GPIO ATR code



#   CHANGING GPIO STATE FOR E310   #



import uhd

ATR_GPIO_MASK = 0b11

# 1=atr 0=manual

ATR_CTRL = 0b11

# 1=output 0=input

ATR_DDR = 0b11

# 1=high on 0=nothing

ATR_0X = 0b10

ATR_RX = 0b01

ATR_TX = 0b001000

ATR_XX = 0b000100

# find usrp device

USRP_E310 = uhd.usrp.MultiUSRP('serial=F644E0')

# find usrp gpio port name

BANK_NAME = USRP_E310.get_gpio_banks(0)[0]

print('\n\n')

print( USRP_E310.get_gpio_attr(BANK_NAME, 'CTRL') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'DDR') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'OUT') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_0X') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_RX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_TX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_XX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'READBACK') )

print('\n\n')

# configure gpio for atr operation

USRP_E310.set_gpio_attr(BANK_NAME, 'CTRL', ATR_CTRL, ATR_GPIO_MASK)

USRP_E310.set_gpio_attr(BANK_NAME, 'DDR', ATR_DDR, ATR_GPIO_MASK)

USRP_E310.set_gpio_attr(BANK_NAME, 'ATR_0X', ATR_0X, ATR_GPIO_MASK)

USRP_E310.set_gpio_attr(BANK_NAME, 'ATR_RX', ATR_RX, ATR_GPIO_MASK)

USRP_E310.set_gpio_attr(BANK_NAME, 'ATR_TX', ATR_TX, ATR_GPIO_MASK)

USRP_E310.set_gpio_attr(BANK_NAME, 'ATR_XX', ATR_XX, ATR_GPIO_MASK)

print('\n\n')

print( USRP_E310.get_gpio_attr(BANK_NAME, 'CTRL') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'DDR') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'OUT') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_0X') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_RX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_TX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'ATR_XX') )

print( USRP_E310.get_gpio_attr(BANK_NAME, 'READBACK') )

print('\n\n')


Print statement outputs

0

4294967295

0

0

0

0

0

0

63 < CTRL

4294967295 < DDR

0 < OUT

32 < 0X (idle) set for pin 6

16 < RX set for pin 5

8 < TX set for pin 4

4 < XX (full duplex) set for pin 3

32 < READBACK detects high on pin 6
___
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com


Re: [USRP-users] E310 GPIO

2017-07-15 Thread EJ Kreinar via USRP-users
This particular problem sounds reasonable straightforward with a few fpga
edits. I have successfully commandeered a few gpios in the E310 before for
scoping a couple clock signals.

One possible suggestion for a quick fix: when you set a master clock rate,
then the radio_clk wire in the fpga will run at that frequency. So at 1
MHz, radio_clk would be high for 0.5 us, low for 0.5 us. This is by
definition synchronized with the digital sampling. I'd buffer it with a
higher rate signal (bus_clk, for example, which runs at 50 MHz), then you
could pretty easily route it out one of the gpios.

Hope that helps,
EJ

On Jul 14, 2017 4:58 PM, "Marcus D. Leech via USRP-users" <
usrp-users@lists.ettus.com> wrote:

On 07/11/2017 11:56 AM, Will Thompson via USRP-users wrote:

Hi all.

So I’m thinking of starting a project with the E310 that requires high
accuracy control of a switch.



Basically I need to receive a single RF sample (@1MHz) (1us), then send a
signal via the GPIO on a second sample (2us), and then receive a signal
again on the third sample (3us) and alternate between these functions for a
period of time.



I was wondering if anyone has experience with controlling the GPIOs on the
E310, and knows how accurate you can synchronise the signal outputs with RF
received samples? i.e. Can I synchronise the GPIO signalling and the
received RF sampling down to micro seconds?



Also, if anyone has any good resource links for the E310 and GPIO could you
pass them on please?





Kind regards

Will

The GPIO interface is normally accessed using UHD host-side API elements,
which operate asynchronously to the sample stream, so there's no way
  to guarantee really-tight timing.

You'd likely need to dive into FPGA coding to achieve this type of
application.

https://files.ettus.com/manual/page_gpio_api.html

Has a little bit of information, but deep answers to your query can be
found in the FPGA source code.






--

William Thompson Ph.D.

Senior Research Engineer

Toshiba Research Europe Limited

32 Queen Square, Bristol, BS1 4ND, UK

Tel: +44 (0) 117 906 0734



--

NOTE: The information in this email and any attachments may be confidential
and/or legally privileged. This message may be read, copied and used only
by the intended recipient. If you are not the intended recipient, please
destroy this message, delete any copies held on your system and notify the
sender immediately.

Toshiba Research Europe Limited, registered in England and Wales (2519556).
Registered Office 208 Cambridge Science Park, Milton Road, Cambridge CB4
0GZ, England. Web: www.toshiba.eu/research/trl



--
This email has been scanned for email related threats and delivered safely
by Mimecast.
For more information please visit http://www.mimecast.com
--


___
USRP-users mailing
listUSRP-users@lists.ettus.comhttp://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com



___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


Re: [USRP-users] E310 GPIO

2017-07-14 Thread Marcus D. Leech via USRP-users

On 07/11/2017 11:56 AM, Will Thompson via USRP-users wrote:


Hi all.

So I’m thinking of starting a project with the E310 that requires high 
accuracy control of a switch.


Basically I need to receive a single RF sample (@1MHz) (1us), then 
send a signal via the GPIO on a second sample (2us), and then receive 
a signal again on the third sample (3us) and alternate between these 
functions for a period of time.


I was wondering if anyone has experience with controlling the GPIOs on 
the E310, and knows how accurate you can synchronise the signal 
outputs with RF received samples? i.e. Can I synchronise the GPIO 
signalling and the received RF sampling down to micro seconds?


Also, if anyone has any good resource links for the E310 and GPIO 
could you pass them on please?


Kind regards

Will

The GPIO interface is normally accessed using UHD host-side API 
elements, which operate asynchronously to the sample stream, so there's 
no way

  to guarantee really-tight timing.

You'd likely need to dive into FPGA coding to achieve this type of 
application.


https://files.ettus.com/manual/page_gpio_api.html

Has a little bit of information, but deep answers to your query can be 
found in the FPGA source code.




--

William Thompson Ph.D.

Senior Research Engineer

Toshiba Research Europe Limited

32 Queen Square, Bristol, BS1 4ND, UK

Tel: +44 (0) 117 906 0734




NOTE: The information in this email and any attachments may be 
confidential and/or legally privileged. This message may be read, 
copied and used only by the intended recipient. If you are not the 
intended recipient, please destroy this message, delete any copies 
held on your system and notify the sender immediately.


Toshiba Research Europe Limited, registered in England and Wales 
(2519556). Registered Office 208 Cambridge Science Park, Milton Road, 
Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl





This email has been scanned for email related threats and delivered 
safely by Mimecast.

For more information please visit http://www.mimecast.com



___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


Re: [USRP-users] E310 GPIO

2017-07-12 Thread Brais Ares via USRP-users
My two cents:

Only useful reference: https://files.ettus.com/manual/page_gpio_api.html
UHD example:
https://github.com/EttusResearch/uhd/blob/master/host/examples/gpio.cpp

In E310 you have to select the correct GPIO bank, that being *INT0 *(took
me a while to figure it out). You can start your project just by checking
GPIOs are working by using UHD example (loop mode) and configure them all
as inputs:

$ ./gpio --bank INT0 --repeat --bitbang

Then if you shortcircuit, for example, Pin 1: +3.3V with Pin 3: Data[5],
you could see Pin 3 changing its logic value from 0 to 1 in the console
output.

Hope this helps,
Brais.






2017-07-11 17:56 GMT+02:00 Will Thompson via USRP-users <
usrp-users@lists.ettus.com>:

> Hi all.
>
> So I’m thinking of starting a project with the E310 that requires high
> accuracy control of a switch.
>
>
>
> Basically I need to receive a single RF sample (@1MHz) (1us), then send a
> signal via the GPIO on a second sample (2us), and then receive a signal
> again on the third sample (3us) and alternate between these functions for a
> period of time.
>
>
>
> I was wondering if anyone has experience with controlling the GPIOs on the
> E310, and knows how accurate you can synchronise the signal outputs with RF
> received samples? i.e. Can I synchronise the GPIO signalling and the
> received RF sampling down to micro seconds?
>
>
>
> Also, if anyone has any good resource links for the E310 and GPIO could
> you pass them on please?
>
>
>
>
>
> Kind regards
>
> Will
>
>
>
>
>
> --
>
> William Thompson Ph.D.
>
> Senior Research Engineer
>
> Toshiba Research Europe Limited
>
> 32 Queen Square, Bristol, BS1 4ND, UK
>
> Tel: +44 (0) 117 906 0734 <+44%20117%20906%200734>
>
>
>
> --
>
> NOTE: The information in this email and any attachments may be
> confidential and/or legally privileged. This message may be read, copied
> and used only by the intended recipient. If you are not the intended
> recipient, please destroy this message, delete any copies held on your
> system and notify the sender immediately.
>
> Toshiba Research Europe Limited, registered in England and Wales
> (2519556). Registered Office 208 Cambridge Science Park, Milton Road,
> Cambridge CB4 0GZ, England. Web: www.toshiba.eu/research/trl
>
>
>
> --
> This email has been scanned for email related threats and delivered safely
> by Mimecast.
> For more information please visit http://www.mimecast.com
> --
>
> ___
> USRP-users mailing list
> USRP-users@lists.ettus.com
> http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
>
>


-- 

[image: logo_170x100px.png] 

Brais Ares Fernández
Investigador - Desarrollador | Área de Comunicaciones Avanzadas
Researcher - Developer | Advanced Communications Department

Ph. (+34) 986 120 430  Ext. 3019
ba...@gradiant.org  |  www.gradiant.org

[image: Iconos Redes Sociales GRD Firma email-01]
  [image: Iconos Redes Sociales GRD
Firma email-02]   [image: Iconos Redes
Sociales GRD Firma email-03] 
 [image: Iconos Redes Sociales GRD Firma email-04]

Take care of the environment. Try not to print this email.
The information contained in this email message may be confidential
information, and may also be the subject of legal professional privilege.
If you are not the intended recipient, any use, interference with,
disclosure or copying of this material is unauthorized and prohibited.
Please inform us immediately and destroy the email. Thank you for your
cooperation.
___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com


[USRP-users] E310 GPIO

2017-07-11 Thread Will Thompson via USRP-users
Hi all.
So I'm thinking of starting a project with the E310 that requires high accuracy 
control of a switch.

Basically I need to receive a single RF sample (@1MHz) (1us), then send a 
signal via the GPIO on a second sample (2us), and then receive a signal again 
on the third sample (3us) and alternate between these functions for a period of 
time.

I was wondering if anyone has experience with controlling the GPIOs on the 
E310, and knows how accurate you can synchronise the signal outputs with RF 
received samples? i.e. Can I synchronise the GPIO signalling and the received 
RF sampling down to micro seconds?

Also, if anyone has any good resource links for the E310 and GPIO could you 
pass them on please?


Kind regards
Will


--
William Thompson Ph.D.
Senior Research Engineer
Toshiba Research Europe Limited
32 Queen Square, Bristol, BS1 4ND, UK
Tel: +44 (0) 117 906 0734




NOTE: The information in this email and any attachments may be confidential 
and/or legally privileged. This message may be read, copied and used only by 
the intended recipient. If you are not the intended recipient, please destroy 
this message, delete any copies held on your system and notify the sender 
immediately.

Toshiba Research Europe Limited, registered in England and Wales (2519556). 
Registered Office 208 Cambridge Science Park, Milton Road, Cambridge CB4 0GZ, 
England. Web: www.toshiba.eu/research/trl
---
 This email has been scanned for email related threats and delivered safely by 
Mimecast.
 For more information please visit http://www.mimecast.com
---
___
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com