icepicknz
Posts: 2
Joined: Wed Oct 08, 2014 6:40 am

Having multiple GPIO devices on one PI

Wed Oct 08, 2014 6:48 am

Hey guys,

My first post regarding Raspberry, I've got 4 units now and only started with GPIO stuff over the last 2 weeks or so.
I have a NXP NFC card (http://www.nxp.com/demoboard/PNEV512R.html) which slots onto the RP.
I also have a LCD screen (http://www.adafruit.com/products/1109) which slots onto the RP.

Both GPIO addons I have connected to separate RP's at the moment, however I'm now wondering how I can use both devices on a single PI, so when someone uses the NFC and they are declined access it can show on the LCD screen.

I have a few bits and bobs I purchased, one being a RasPi stacking header but need some advice before I just assume this will work. I'm assuming I can desolder the 26 Pin connector on the LCD or NFC board and then use the stacking header which will allow me to connect two boards to the same PI.

Is my assumption true or do I need to find spare pins that are not being used by both devices?
I have 2 Model B+'s so have the additional PINS, but would hate to have to connect these all manually and modify all the example code and drivers I have right now to work with the new PIN configuration.

Any advice or suggestions out there?

Many thanks and sorry if this is a repeat question

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Having multiple GPIO devices on one PI

Wed Oct 08, 2014 8:29 am

You need to find out precisely which gpios are used by both devices. If there are any clashes you'll need to decide if the gpio(s) can be shared (unlikely) or you must find alternate gpio(s). If you need to find alternate gpio(s) you'll then need to see if any software you have can be configured to accept the changed gpio(s).

User avatar
hansotten
Posts: 341
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Having multiple GPIO devices on one PI

Wed Oct 08, 2014 8:31 am

The GPIO connector on the Pi is not a bus, it is just a collection of digital I/O pins and serial busses (I2C, SPI, Serial)

Combining GPIO devices will require a thorough investigation on what and how GPIO pins are used by these devices:

- digital I/O pins cant be shared between devices
- I2C and SPI may be shared but only if one program on the Pi controls it. Unlikely if seperate devices come with own software. Devices on the bus will have to have separate addresses also.

A quick look at your devices learns the Adafruit LCD is I2C and the NFC is SPI based. Thats good news. Hopefully none overlapping other I/O pins are used. Since the Adafruit software is open source you may reroute any I/O to free ports if there is a conflict.

So you may have luck in your plans!
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

Return to “General discussion”