Uncategorized

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 I2CSPI, 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

Tue Mar 05, 2019 1:29 am

westwol wrote: 

Sun Mar 03, 2019 10:21 pm

I’ve read that a Raspberry board has 2 SPI individual ports. Is there anyway to use 8x MCP23S17 on each of them?

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 I2CSPI, 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, …

https://penzu.com/p/478664cf

Last edited by tlfong01 on Tue Mar 05, 2019 7:26 am, edited 4 times in total.

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s