GPIO-expantion on Arduino Giga

Thread Starter

Rensieboy223

Joined Feb 3, 2024
88
Hey guys,

I've been working on expanding my GPIO-pins on my Arduino Giga R1.
I use the MPC23017 chip for this.
Can you check for if my schematic is correct and if there are any improvements that could be made?:
1721640802909.png

Thanks already!
 

Irving

Joined Jan 30, 2016
5,170
You probably need smaller pull-up resistors for the I2C clock & data lines. Typically these would be 1.8 - 4.7k depending on speed & distance. You might also consider connecting the reset# to Arduino reset line, and think about Interrupt lines A & B.. Other than that, looks OK
 

Thread Starter

Rensieboy223

Joined Feb 3, 2024
88
You probably need smaller pull-up resistors for the I2C clock & data lines. Typically these would be 1.8 - 4.7k depending on speed & distance. You might also consider connecting the reset# to Arduino reset line, and think about Interrupt lines A & B.. Other than that, looks OK
Thanks a lot for the advice, is it also so that a larger distance needs a lower pull-up resistor?
 

Jon Chandler

Joined Jun 12, 2008
1,621
Add 100nF caps across the power pins close to each chip.

If you connect the reset pins together, add a pullup resistor, and connect them to a port pin, you can reset the MCP23017s each time your code starts to be sure you're always in a known state if the code crashes.

If you connect the INT pins in parallel to a port pin and set them to open collector outputs, you can easily detect when an input changes – if all 4 are in parallel, you won't know which port has changed but you'll be able to determine that with a quick read of the interupt-on-change registers.
 

Irving

Joined Jan 30, 2016
5,170
Thanks a lot for the advice, is it also so that a larger distance needs a lower pull-up resistor?
Crudely, yes. The i2c buss can stand a maximum capacitance of 400pF on both SCK and SDA. The pull-up must be able to charge the buss capacitance when transiting from '0' to '1' to ensure the logic high is seen by the mid-pulse clock transition. This paper from TI explains the detail. The lowest value for 3.3v is around 970ohm. 1 metre/39" of standard telephone or CAT5 4-core cable is approx 400pF which gives a maximum pull-up value of 3k @ 100kHz and 1k at 400kHz. For a 10cm/4" connection across & between PCBs, 1k8 - 3.3k works fine for both fast and standard mode. Ideally there should be only one termination resistor per wire. If it's already terminated on the main PCB then you can probably leave the ones on your PCB unpopulated.
 

Thread Starter

Rensieboy223

Joined Feb 3, 2024
88
Crudely, yes. The i2c buss can stand a maximum capacitance of 400pF on both SCK and SDA. The pull-up must be able to charge the buss capacitance when transiting from '0' to '1' to ensure the logic high is seen by the mid-pulse clock transition. This paper from TI explains the detail. The lowest value for 3.3v is around 970ohm. 1 metre/39" of standard telephone or CAT5 4-core cable is approx 400pF which gives a maximum pull-up value of 3k @ 100kHz and 1k at 400kHz. For a 10cm/4" connection across & between PCBs, 1k8 - 3.3k works fine for both fast and standard mode. Ideally there should be only one termination resistor per wire. If it's already terminated on the main PCB then you can probably leave the ones on your PCB unpopulated.
Okay, thanks a lot, that's really informing for me. I will use the 1K8 pull-up resistors then. This is for fast mode ofcourse. Is it also possible to switch from fast mode to standard mode with the same pull-up resistors, or can this give complications?

This is the schematic now:
1721670559928.png
 

Irving

Joined Jan 30, 2016
5,170
Okay, thanks a lot, that's really informing for me. I will use the 1K8 pull-up resistors then. This is for fast mode ofcourse. Is it also possible to switch from fast mode to standard mode with the same pull-up resistors, or can this give complications?
It'll be fine, as long as there isn't a <1k8 on the main board!
 

Thread Starter

Rensieboy223

Joined Feb 3, 2024
88
It'll be fine, as long as there isn't a <1k8 on the main board!
I will connect it to a Arduino Giga R1, I never heard that there is a pull-up resistor on the main board connected to the I2C ports. Should be good I think.

Following resource from Arduino Website:
1721673140611.png
 
Top