usrp-users@lists.ettus.com

Discussion and technical support related to USRP, UHD, RFNoC

View all threads

B205-mini GPIO

AK
Arun kumar Verma
Thu, Aug 30, 2018 6:43 PM

Hi
We brought B205mini recently and we want to use three GPIO to control some external device which require SPI interface, in the schematics the header mentioned is J5 for GPIO while website USRP Hardware Driver and USRP Manual: USRP B2x0 Series is mentioning J6 as GPIO header. Can you please suggest some example source code for GPIO, so that we can incorporate in our software.
Arun Verma

|
|  |
USRP Hardware Driver and USRP Manual: USRP B2x0 Series
|  |

|

Hi We brought B205mini recently and we want to use three GPIO to control some external device which require SPI interface, in the schematics the header mentioned is J5 for GPIO while website USRP Hardware Driver and USRP Manual: USRP B2x0 Series is mentioning J6 as GPIO header. Can you please suggest some example source code for GPIO, so that we can incorporate in our software. Arun Verma | | | USRP Hardware Driver and USRP Manual: USRP B2x0 Series | | |
MM
Marcus Müller
Thu, Aug 30, 2018 7:25 PM

Hi Arun,

in the uhd/host/examples directory, you'll find gpio.cpp !

Note that you'll need to bitbang SPI that way from the host; that can
work, but it's going to be slooooow.

Alternatively, if you are familiar with FPGA development, implementing
another SPI host in the FPGA should be thoroughly possible. You'd then
need to find a smart way to talk to the SPI controller from the host,
which I'd say is the bigger challenge.

Honestly, if you just need something to talk SPI, getting an USB-to-
SPI adapter (of the popular FTDI variety, for example) is probably way,
way easier and faster. If you need timed execution of SPI transactions,
you could also combine the two: Use an easy-to-use SPI bridge or
microcontroller or … and just (de)assert the CS line of SPI using timed
commands and the standard GPIO.

From a bit of a long-time support perspective: 90% of people don't

actually need their GPIOs to talk full protocols; if your application
needs that, a minor adjustment to architecture is often easier.

Best regards,
Marcus

On Thu, 2018-08-30 at 18:43 +0000, Arun kumar Verma via USRP-users
wrote:

Hi

We brought B205mini recently and we want to use three GPIO to control
some external device which require SPI interface, in the schematics
the header mentioned is J5 for GPIO while website USRP Hardware
Driver and USRP Manual: USRP B2x0 Series is mentioning J6 as GPIO
header. Can you please suggest some example source code for GPIO, so
that we can incorporate in our software.

Arun Verma

 	 USRP Hardware Driver and USRP Manual: USRP B2x0 Series  	  

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

Hi Arun, in the uhd/host/examples directory, you'll find gpio.cpp ! Note that you'll need to bitbang SPI that way from the host; that can work, but it's going to be slooooow. Alternatively, if you are familiar with FPGA development, implementing another SPI host in the FPGA should be thoroughly possible. You'd then need to find a smart way to talk to the SPI controller from the host, which I'd say is the bigger challenge. Honestly, if you just need *something* to talk SPI, getting an USB-to- SPI adapter (of the popular FTDI variety, for example) is probably way, way easier and faster. If you need timed execution of SPI transactions, you could also combine the two: Use an easy-to-use SPI bridge or microcontroller or … and just (de)assert the CS line of SPI using timed commands and the standard GPIO. >From a bit of a long-time support perspective: 90% of people don't actually need their GPIOs to talk full protocols; if your application needs that, a minor adjustment to architecture is often easier. Best regards, Marcus On Thu, 2018-08-30 at 18:43 +0000, Arun kumar Verma via USRP-users wrote: > Hi > > We brought B205mini recently and we want to use three GPIO to control > some external device which require SPI interface, in the schematics > the header mentioned is J5 for GPIO while website USRP Hardware > Driver and USRP Manual: USRP B2x0 Series is mentioning J6 as GPIO > header. Can you please suggest some example source code for GPIO, so > that we can incorporate in our software. > > Arun Verma > > USRP Hardware Driver and USRP Manual: USRP B2x0 Series > > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com
DK
Derek Kozel
Thu, Aug 30, 2018 7:25 PM

Hello Arun,

The gpio example is the first place to look for a reference.
https://github.com/EttusResearch/uhd/blob/master/host/examples/gpio.cpp

A description of the GPIO header on the B20xmini can be found here
http://files.ettus.com/manual/page_usrp_b200.html#b200_hw_ref_ext

Regards,
Derek

On Thu, Aug 30, 2018 at 7:43 PM, Arun kumar Verma via USRP-users <
usrp-users@lists.ettus.com> wrote:

Hi

We brought B205mini recently and we want to use three GPIO to control some
external device which require SPI interface, in the schematics the header
mentioned is J5 for GPIO while website USRP Hardware Driver and USRP
Manual: USRP B2x0 Series
https://files.ettus.com/manual/page_usrp_b200.html is mentioning J6 as
GPIO header. Can you please suggest some example source code for GPIO, so
that we can incorporate in our software.

Arun Verma

USRP Hardware Driver and USRP Manual: USRP B2x0 Series
https://files.ettus.com/manual/page_usrp_b200.html


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

Hello Arun, The gpio example is the first place to look for a reference. https://github.com/EttusResearch/uhd/blob/master/host/examples/gpio.cpp A description of the GPIO header on the B20xmini can be found here http://files.ettus.com/manual/page_usrp_b200.html#b200_hw_ref_ext Regards, Derek On Thu, Aug 30, 2018 at 7:43 PM, Arun kumar Verma via USRP-users < usrp-users@lists.ettus.com> wrote: > Hi > > We brought B205mini recently and we want to use three GPIO to control some > external device which require SPI interface, in the schematics the header > mentioned is J5 for GPIO while website USRP Hardware Driver and USRP > Manual: USRP B2x0 Series > <https://files.ettus.com/manual/page_usrp_b200.html> is mentioning J6 as > GPIO header. Can you please suggest some example source code for GPIO, so > that we can incorporate in our software. > > Arun Verma > > USRP Hardware Driver and USRP Manual: USRP B2x0 Series > <https://files.ettus.com/manual/page_usrp_b200.html> > > > _______________________________________________ > USRP-users mailing list > USRP-users@lists.ettus.com > http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com > >