buffmasterbran
Posts: 2
Joined: Mon Jan 11, 2016 7:41 pm

GPIO to SPI

Mon Jan 11, 2016 7:44 pm

Is it possible to modify the Raspberry Pi so there are 2 SPI MOSI/MISO and in doing so, using up 2 of the GPIO's?

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5087
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: GPIO to SPI

Mon Jan 11, 2016 8:16 pm

buffmasterbran wrote:Is it possible to modify the Raspberry Pi so there are 2 SPI MOSI/MISO and in doing so, using up 2 of the GPIO's?
Not quite sure what you want to do. The Pi currently supports two SPI interfaces using common MOSI/MISO/SCLK GPIO's + two ¬CE GPIO's. More ¬CE signals can be added by gating the existing ones with other GPIO's. Alternatively it's also possible to "bit-bang" additional SPI interfaces** (but that requires more GPIO's).
Trev.
** As I did in this test/demo circuit here:
http://www.cpmspectrepi.webspace.virgin ... Lvspi.html
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
RogerW
Posts: 285
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: GPIO to SPI

Tue Jan 12, 2016 9:30 am

PIs with 40 pin headers (A+, B+, B2) have two SPI interfaces anyway. The primary one uses GPIOs 9,10,11 and one of two chip selects 7,8. The extra port uses 19,20,21 with three chip selects 11,12,36.

User avatar
Burngate
Posts: 6013
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: GPIO to SPI

Tue Jan 12, 2016 9:41 am

RogerW wrote:... with three chip selects 11,12,36.
Actually GPIOs 16, 17, 18 on header pins 36, 11, 12 respectively

User avatar
karrika
Posts: 1070
Joined: Mon Oct 19, 2015 6:21 am
Location: Finland

Re: GPIO to SPI

Tue Jan 12, 2016 9:53 am

SPI pins in a nice graphical view http://pinout.xyz/pinout/spi

User avatar
RogerW
Posts: 285
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: GPIO to SPI

Tue Jan 12, 2016 9:55 am

Burngate wrote:Actually GPIOs 16, 17, 18 on header pins 36, 11, 12 respectively
Thanks for correcting that - I misread the comments in my code.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5087
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: GPIO to SPI

Tue Jan 12, 2016 2:31 pm

RogerW et al wrote: PIs with 40 pin headers (A+, B+, B2) have two SPI interfaces anyway.
...
Thanks folks for adding that info. (I had a vague recollection that there was a second set, but didn't have the time to check further when I replied to the O.P.)
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

buffmasterbran
Posts: 2
Joined: Mon Jan 11, 2016 7:41 pm

Re: GPIO to SPI

Tue Jan 12, 2016 2:52 pm

I found an answer. I need a small display to run on GPIO's and not on the SPI's. I am very new to all of this so someone told me to figure out how to big-bang GPIO's to SPI.

https://www.youtube.com/watch?v=4U9TWmFlZDo

Thank you all for you responses.

Return to “General discussion”