Use Rpi/MCP23017 GPIO pins to select more than 16 SPI Devices
https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=234869&p=1437642&hilit=i2c+spi+tlfong01#p1437642
Instead of RPi’s built in CE0, CE1 signals. I can use, says, 6 GPIO pins as CE0, CE1, to CE5 pins to select 6 SPI devices.
Similarly, I almost NEVER use Rpi’s GPIO pins. I only use the I2C, SPI, and UART pins. This way I can easily port my python/microPython software and I2C/SPI/UART hardware between Rpi, PyBoard, MicroBit, and CircuitPython etc.
I almost never make use of Rpi’s built in CE0/CE1 signals to chip select the devices on the SPI channels. My trick is using MCP23017 GPIO signals to pretend to be CEn signals. In other words, only 1 MCP23017 can chip select 16 SPI devices. I tried it a couple of times and so far so good.
Re: I2C I/O PORT EXPANDER QUESTION
Using MCP23017 GPIO Pins to Select MCP23S17 Chips
I almost never make use of Rpi’s built in CE0/CE1 signals to chip select the devices on the SPI channels. My trick is using MCP23017 GPIO signals to pretend to be CEn signals. In other words, only 1 MCP23017 can chip select 16 SPI devices. I tried it a couple of times and so far so good.
Update – 2019mar05hkt1502
Instead of RPi’s built in CE0, CE1 signals. I can use, says, 6 GPIO pins as CE0, CE1, to CE5 pins to select 6 SPI devices.
Similarly, I almost NEVER use Rpi’s GPIO pins. I only use the I2C, SPI, and UART pins. This way I can easily port my python/microPython software and I2C/SPI/UART hardware between Rpi, PyBoard, MicroBit, and CircuitPython etc.
You may like to read my old post on MCP23017 Demuxing.
RE: RPI ZERO W MULTIPLE SENSORS – tlfong01 2019-Feb-13
https://www.raspberrypi.org/forums/view … 1#p1429189
You may also like to take a look of my current ECG test setup, showing 7 demux TSX0104 up level shifters, and 2 PWM (PCM9685) and 8 IOX (MCP23017) modules, with a total of 160 PWM/nonPWM GPIO pins, …
Categories: Uncategorized
