theoatvecna wrote:I have searched for a couple of hours to find some clear guidance on this, but perhaps my search foo is poor. Hopefully this question is addressed elsewhere and I just haven't been able to find it.
So, I would like to interface several SPI devices with my RPI3. I have found many posts indicating that this is possible, but they all seem to reference the older rpis. I thought I saw somewhere that RPI3 had hardware support for 3 SPI Chip Enable/Select lines, but haven't been able to find it. Only two seem to be called out on the GPIO diagrams. So assuming there are actually only two, then what is the appropriate way to use a 74hc138 or similar address decoder on a RPI3? (or if I have enough GPIO available, can I just use other pins as additional SPI CE pins?)
For specifics, right now I want to connect a mcp3008 ADC, and a LSM9DS0 IMU (which requires two CE pins as it has two separate SPI slaves, one for accelerometer and magnetometer, and one for gyros). It is likely that I will want to connect a couple more SPI devices in a future rev.
Any help or guidance is much appreciated!
You use the spi_flags.ChristophK wrote:Joan, how do I tell pigpio's spi_open not to use the official CE pins?
Can I use a spi_channel number different from 0..1 /0..2 to switch it off?
Or should I tell it via the u2/u1/u0 bits in spi_flags that all CE pins are occupied?
Code: Select all
spi_flags consists of the least significant 22 bits. 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 b b b b b b R T n n n n W A u2 u1 u0 p2 p1 p0 m m