Hello,
I am about to deploy my EFIS to a Raspbery Pi, but I need 39 I/O pins for that (I count 1 LED as 1 I/O, 1 button as 1 I/O, and 1 rotary encoder as 2 IOs).
RPi2 has 40 GPIO, but not all of them are actual I/O pins, so there is not enough of them to connect all my stuff (EFIS control panel, etc). What is the best way to connect more I/Os to the Rpi? Is there any way to use a shift register IC? I can't seem to find a wiki article on how would I access those I/Os. Or is there a way to connect Arduino Mega to Raspbery, to act as I/O interface?
Thank you.
Pavel
What is the best practice to increase number of RPi I/Os
What is the best practice to increase number of RPi I/Os
Pavel Brodský
Prague, Czech Republic
Prague, Czech Republic
Re: What is the best practice to increase number of RPi I/Os
I would actually prefer to use directly Rpi pins, not arduino, as the arduino seems quite complicated for what I need... Any chance to use multiplex with Rpi? Or some I/O board connected to Rpi? Maybe this? https://www.abelectronics.co.uk/p/54/IO-Pi-Plus
Pavel
Pavel
Pavel Brodský
Prague, Czech Republic
Prague, Czech Republic
Re: What is the best practice to increase number of RPi I/Os
First thought: just use two/three... arduino/rpi
About arduino: you could use the new message port feature to talk with arduino. In this way, with your own arduino sketch, you could add i2c or serial expanders..
But, you need to know how to program in the Arduino ide and how i2c expander works. And learn how to use the message port feature.
It depends on the experience you have, but it is not like using the arduino api in air manager. It needs more work and knowledge.
I think arduino API is perfect like it is. Simple... some buttons for the needs of the instruments.
If someone need something more complex, can be made with the message port library.
if you only need a lot of inputs for mapping switches in the cockpit... it is probably than some leobodnar cards can make the work.
About arduino: you could use the new message port feature to talk with arduino. In this way, with your own arduino sketch, you could add i2c or serial expanders..
But, you need to know how to program in the Arduino ide and how i2c expander works. And learn how to use the message port feature.
It depends on the experience you have, but it is not like using the arduino api in air manager. It needs more work and knowledge.
I think arduino API is perfect like it is. Simple... some buttons for the needs of the instruments.
If someone need something more complex, can be made with the message port library.
if you only need a lot of inputs for mapping switches in the cockpit... it is probably than some leobodnar cards can make the work.
Re: What is the best practice to increase number of RPi I/Os
For multiplexing you need timers I would guess, and I don't think that can be trusted on the Pi. Corjan might know a better option, but I think that the Arduino is the safest solution.
Re: What is the best practice to increase number of RPi I/Os
Ok, but is there a way to connect Arduino to RPi? That is what I am missing maybe I would be pretty hapy to use it without message port, just as I/O board to my RPi.
Pavel
Pavel
Pavel Brodský
Prague, Czech Republic
Prague, Czech Republic
Re: What is the best practice to increase number of RPi I/Os
Yes you can, configure it on a desktop computer with the Arduino installer and then hook it up to the Pi (USB).
Re: What is the best practice to increase number of RPi I/Os
You could also perhaps try to run the code for a matrix of buttons and/or LED multiplexing. I haven't tried myself yet but I'd be interested to see if the timing would be an issue or not.
There shouldn't be anything stopping you from expanding the I/0 with some simple 74 series chips or similar. You could even program an Arduino or some other micro to act as a basic multiplexer. You don't even need USB comms for this.
There shouldn't be anything stopping you from expanding the I/0 with some simple 74 series chips or similar. You could even program an Arduino or some other micro to act as a basic multiplexer. You don't even need USB comms for this.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: What is the best practice to increase number of RPi I/Os
Just an idea:
Can we use additional libraries within lua-scripts which connects to the native raspberry Hardware?
I am thinking of using I2C as a GPIO Expander.
AFAIK there are ways to use I2c from LUA
Can we use additional libraries within lua-scripts which connects to the native raspberry Hardware?
I am thinking of using I2C as a GPIO Expander.
AFAIK there are ways to use I2c from LUA
Air Manager 3.6 Home Use - Rpi AirpLayer with 7" Touchscreen
Re: What is the best practice to increase number of RPi I/Os
You could do I2C with an Arduino using your own Arduino sketch and the AM to Arduino message port. Some have started to use it this way. The Rpi does not have the message port functionality so only what's achievable with the AM API functions is possible.
Last edited by Sling on Sun Jan 07, 2018 12:24 am, edited 1 time in total.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: What is the best practice to increase number of RPi I/Os
I think is the better way too.
With Arduino, I2C and 8 x mcp23017 we have 128 inputs/outputs only with the i2c lines.
I have 6 mcp23017 working now with one of my arduinos, and works perfect.