Uncategorized

mcp23s17 demux problem

Asked 
Viewed 9 times
0

I am planning on using the MCP23S17 port expander for my use case but upon wiring them up , it would seem that the MCP23S17 which is the SPI version of the port expander has address pins which is weird. The SPI protocol does not need addresses but instead rely on the Chip Select pin. What is this for ?

  • Ah let me see. The address decoding pins A2, A1, A0, are for you to select one of up to 8 MCP23S17s (See Datasheet Section 3.3). If you have only one MCP23S17, then you can connect those three pins to ground (CANNOT leave them floating) and use 000 to select the MCP23017: imgur.com/gallery/NamPVPW. – tlfong01 1 hour ago    
  • 1
    I do have multiple MCP23S17s but hook them up to a 3 to 8 line decoder 74HC138, i apologize i still dont quite get it, So are you saying that i still have to adjust the address kind of like i2c ? So , the CS pin can be shared by multiple MCP and have to adjust the address manually? – Jack 1 hour ago
  • Ah, let me see. I did once used HC137/138 and similar in my Arduino Decimilla days. But when I started leaning SPI and I2C, I found they can replace the MUX/DEMUX chips. Actually I did not even use any Rpi CS0/CS1 pins, I just use GPIO pins instead. This way I can have say, 10 GPIO pins as CS0~9 pins. Later I even forgot the CPIO pins and used MCP23018 GPIO pins as CS pins. In other words, with one MCP23017, I can have 16 CS pins! 🙂 (1) raspberrypi.org/forums/…, / to continue, … – tlfong01 52 mins ago    
  • (2) raspberrypi.org/forums/…. / top continue, … – tlfong01 52 mins ago   
  • yes, i have no problem on my chip selects. Its those address pins that are kinda throwing me off. Can i leave A2,A1,A0 to ground on all my MCP devices? – Jack 15 mins ago
  • Yes, you can keep your old timer’s HC138s to demux MCP23S17s. Just short all the A2,1,0 pins to ground and pretend they don’t ever exist. But then hackers watching this forum would LOL, thinking that the general hardware IQ here is a bit low and thus damaging this forum’s reputation! 🙂 – tlfong01 just now   Edit   

Your Answer

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

%d bloggers like this: