GrubbyHalo
Posts: 25
Joined: Thu Jul 10, 2014 9:33 am

Maximum SPI Devices

Sat Mar 05, 2016 1:04 pm

There were rumors of the standard SPI driver being updated to support more than the current limit of two via the use of arbitrary GPIO pins used for CS. Does anyone know if progress has been made ?

Cheers

User avatar
mikronauts
Posts: 2717
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Maximum SPI Devices

Sat Mar 05, 2016 4:13 pm

If you want to add your own SPI i/o expanders, see my article

http://www.mikronauts.com/raspberry-pi/ ... and-howto/

which allows eight SPI devices per chip select.

If you want more off-the-shelf SPI based boards (tft etc) even a new driver would not help, as the drivers for those devices would not be set up for additional (or expanded) chip selects.
GrubbyHalo wrote:There were rumors of the standard SPI driver being updated to support more than the current limit of two via the use of arbitrary GPIO pins used for CS. Does anyone know if progress has been made ?

Cheers
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

msperl
Posts: 344
Joined: Thu Sep 20, 2012 3:40 pm

Re: Maximum SPI Devices

Sun Mar 06, 2016 8:02 am

Assuming you use the Linux kernel:
If you add

Code: Select all

gpio-cs = <&gpio 8>, <&gpio 7>,<&gpio 22>;
to the devicetree, then gpios 8, 7 and 22 will be used for CS 0,1 and 2. Add more until satisfied...

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

Re: Maximum SPI Devices

Sun Mar 06, 2016 11:01 am

msperl wrote:Assuming you use the Linux kernel:
If you add

Code: Select all

gpio-cs = <&gpio 8>, <&gpio 7>,<&gpio 22>;
to the devicetree, then gpios 8, 7 and 22 will be used for CS 0,1 and 2. Add more until satisfied...
Slightly sorry to hijack this question.

@msperl

Could you summarise the capabilities of the current spi_bcm2853 driver (i.e. arbitrary slave selects, interrupt driven, polling, DMA, auxiliary SPI device).

I don't think the auxiliary SPI is currently supported. If not, have you any feel for when it might be supported by the Pi Linux driver?

GrubbyHalo
Posts: 25
Joined: Thu Jul 10, 2014 9:33 am

Re: Maximum SPI Devices

Sun Mar 06, 2016 1:35 pm

msperl wrote:Assuming you use the Linux kernel:
If you add

Code: Select all

gpio-cs = <&gpio 8>, <&gpio 7>,<&gpio 22>;
to the devicetree, then gpios 8, 7 and 22 will be used for CS 0,1 and 2. Add more until satisfied...
Hi Martin. This is what i was looking for. Thank you

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: Maximum SPI Devices

Sun Mar 06, 2016 4:40 pm

this is a bare metal forum.

fsr
Posts: 88
Joined: Wed Jan 13, 2016 2:29 am

Re: Maximum SPI Devices

Sun Mar 06, 2016 11:41 pm

joan wrote:I don't think the auxiliary SPI is currently supported. If not, have you any feel for when it might be supported by the Pi Linux driver?
It was accepted into the next raspbian kernel (4.4.x)
https://github.com/raspberrypi/linux/co ... b239b1fd1f

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

Re: Maximum SPI Devices

Mon Mar 07, 2016 8:58 am

fsr wrote:
joan wrote:I don't think the auxiliary SPI is currently supported. If not, have you any feel for when it might be supported by the Pi Linux driver?
It was accepted into the next raspbian kernel (4.4.x)
https://github.com/raspberrypi/linux/co ... b239b1fd1f
Thanks.

I'm running 4.4.4-v7+ #850 on a Pi3 so gave it a go.

I just added dtoverlay=spi1-3cs to /boot/config.txt.

Unfortunately it won't boot with that line. Do you know of any gotyas?

gchirico
Posts: 6
Joined: Thu Apr 28, 2016 4:07 pm

Re: Maximum SPI Devices

Fri Apr 29, 2016 8:26 am

Hi Joan,
I too have the same problem with SPI1 aux on RBPi 3.
If I add "dtoverlay=spi1-3cs" to /boot/config.txt the RBPi3 won't boot.

I'm running 4.5.2-v7+ on a Pi3 so gave it a go.

Are you able to solve the problem ?

Thanks in advance,
Giovanni

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

Re: Maximum SPI Devices

Fri Apr 29, 2016 8:47 am

gchirico wrote:Hi Joan,
I too have the same problem with SPI1 aux on RBPi 3.
If I add "dtoverlay=spi1-3cs" to /boot/config.txt the RBPi3 won't boot.

I'm running 4.5.2-v7+ on a Pi3 so gave it a go.

Are you able to solve the problem ?

Thanks in advance,
Giovanni
Not directly. My solution is to use my pigpio library which supports both SPI devices. See http://abyz.co.uk/rpi/pigpio/cif.html#spiOpen

gchirico
Posts: 6
Joined: Thu Apr 28, 2016 4:07 pm

Re: Maximum SPI Devices

Fri Apr 29, 2016 9:23 am

Hi Joan,
thanks for the information.

Best Regards,
Giovanni

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: Maximum SPI Devices

Fri Apr 29, 2016 2:40 pm

still a bare metal forum...

fsr
Posts: 88
Joined: Wed Jan 13, 2016 2:29 am

Re: Maximum SPI Devices

Wed May 18, 2016 2:35 am

joan wrote:
Unfortunately it won't boot with that line. Do you know of any gotyas?
Hi Joan,
looks like there is a conflict between the Aux Uart (UART1) and Aux SPI (SPI1) on the PI3 B. Still looking into it but disabling the Bluetooth (and therefore reverting the Uart config back to PI1/2) seems to work around the issue.

viewtopic.php?f=29&t=146291&p=977167#p977167

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

Re: Maximum SPI Devices

Wed May 18, 2016 6:06 am

@fsr Thanks.
Last edited by joan on Wed May 18, 2016 7:29 am, edited 1 time in total.

User avatar
Cancelor
Posts: 757
Joined: Wed Aug 28, 2013 4:09 pm
Location: UK

Re: Maximum SPI Devices

Wed May 18, 2016 6:54 am

Is the question 'how many chip selects can be defined' a pure numbers question?
There must be an electronic limit to what the SPI bus can drive.
I don't know the right terms but I'm thinking of things like attenuation, jitter, propagation and impedance.
Can't find the thread you want? Try googling : YourSearchHere site:raspberrypi.org

rzusman
Posts: 346
Joined: Fri Jan 01, 2016 10:27 pm

Re: Maximum SPI Devices

Fri May 20, 2016 2:46 am

Fan-out is the term.
It's the number of inputs a single output can drive. For most ICs, it's typically "a handful."
You would also have to worry about signal integrity due to reflections caused by impedance mis-match, but that's not usually a big deal for slow, short-length signaling like SPI.

Return to “Interfacing (DSI, CSI, I2C, etc.)”