Powering and connection suggestions for MCP23S17 device
I would like to connect various MCP23S17 devices to the Raspberry Pi3 MB SPI port. But first I would like to start making some test with a single connection: only one chip. I have some questions:
1.- Regardless electrical char:
- About inputs, Is 20mA the max current that one input GPIOn pin can drive as said at datasheet or is it refered to SPI and power inputs? Datasheet says: "Input clamp current, IIK...20mA"?
- About outputs there are two instructions: " output current sourced by any output pin.. 25mA" and "output clamp current, IOK...20mA". What is the difference between 2 both expressions? If 20mA is a damaging value how is it possible that they could give until 25mA? So what are typical working values for their GPIOs inputs and outputs?
2.- Regardless powering, some ideas I have found googling:
I have seen that several people suggests to connect SPI Rasp port pins to the expanser SPI port pins directly, without any Rs. They also has powered the chip by connecting Vdd = 3.3V Raspberry pin to the MCP23S17 and Raspb ground pin to the microchip device one like this: (see the pict)
- Is it a good idea?
- If it does, would it be correct for powering more than one device (x8 or even more) knowing that only one would be active at once at final design?
- If it doesn't I was thinking to bring VDD from a source supply and connecting a capacitor between VDD and GND, close to the VDD pin. But I don't really know how to know the C value. I have seen examples from 0.1uF (100nF)
3.- About external resistor for pull up/down & current limitation:
I have another question GPIOs configured as inputs. I will only use them for being at high/low level. At my first tests I will be playing to read inputs values (some ones with '1' level) and then writing outputs connected to LED depending on inputs values. But after this, I would like having an application that some times will be configured as inputs some times, but they could also be configured as output. For doing this and save hw dis/connections with external resistors I thought about enable internal Rpull up. But if I would like to use Rpull up smaller than 100k or even connecting Rpull down, instead of pull up:
- What could be a good way for the same pin to be connected and disconnected from this external Rpull up? in order to changing the pin direction at any moment.
- Would you use any type of switches here? How would you do in this case?
4.- About open drain configuration for GPIO = outputs:
The other theme I would like to deal with is the one about the outputs configuration. I have read at datasheet that INTA and INTB could be configured for being open-drain. Does it also apply to any of GPIO being configured as output pins? I have found an application notes in which it's said that outputs could emulate this open-drain feature. So now, I don't know if it does or not. The register explanation found specifies: "INTA and INTB" outputs.
- I guess this is the actual pins that can been configured with open drain, is it?
Thanks in advance for your attention.
Any information will help.
post edited by Eusuvi - 2020/06/04 00:39:56