PC <> Arduino Leonardo MASTER <> Arduino Leonardo SLAVES - question

Hi all, I have a little question today I bought four Arduino Leonardo.

My question arise from the communication between the master and three slaves, I read that Leonardo communication between all is not done using analog pins 4 and 5, and by means of pins SCL and SDA, and here comes my problem in the arduino uno on these pins SCL and SDA can be connected I2C expanders, but here if you used these pins to communicate it will not be able to use them to the expander, I read that I can use for this purpose digital pins 2 and 3, this is true?

Enclosed is a small representation of my project.

I ask for help.

You may be able to use pins 2 and 3 (or any other digital I/O pins) for 'software I2C' but it will be slower than the hardware I2C.

You might be able to use the SPI hardware to have one Arduino control the other three. This would allow the three slave units to use their I2C hardware for the I/O Expansion devices.

Slaves can communicate with the master on SPI pins(~10,11,~12,~13)? and expanders to give the SCL and SDA?

miminuno:
Slaves can communicate with the master on SPI pins(~10,11,~12,~13)? and expanders to give the SCL and SDA?

Yes. Each slave will use 10,11,12,13 to communicate with the master. The master will use 11,12,13 and one Slave Select pin for each slave.

The slaves are then free to use the I2C interface (A4, A5) for the I/O expanders.

That's not what I mean

All need to communicate on the same pins, because sometimes it can be connected to larger number of slaves

miminuno:
All need to communicate on the same pins, because sometimes it can be connected to larger number of slaves

Sorry. I think you've managed to design yourself into a corner.

Perhaps you can do the I/O expansion with something other than I2C? What do you need the 64-bit I/O expanders to do?

Overall, I would need an additional 32 output pins and 32 input pins

miminuno:
Overall, I would need an additional 32 output pins and 32 input pins

Have you thought of using shift registers? You can use Serial In/Parallel Out registers for outputs and Parallel In/Serial Out registers for inputs. You can hook them to your SPI ports and transfer data at 8 million bits per second.

I thought but did not know if it will be the best solution, but looking at it now I think it will be the best solution.

Thanks for your help 8)