I've searched google and this forum but it seems no-one else is working with many Arduinos connected together via SPI.
I'd like to have one master Arduino node and many (say 32) Arduino's connected to that master via SPI. They are all SPI slaves and they all would be running the exact same software.
The question I have is simple: How do I allocate each slave Arduino with a unique address if they are all running the same .elf?
If each slave was running different software, I would hardcode the address of each slave in each project and all would work ok, but this simple problem is stumping me.
A few other ways to pose the same question:
how can I get each slave to retrieve a unique address from the master node?
how can I get each slave to self-allocate a unique address?
how can I send each slave a unique address from the master node before it has an SPI address allocated to it?
how can I get each slave to retrieve a unique address from the master node?
how can I get each slave to self-allocate a unique address?
how can I send each slave a unique address from the master node before it has an SPI address allocated to it?
All this is moot until you explain how you are going to connect them, because SPI is not by nature an addressing bus and if you use logic to get 32 CS signals then the Arduinos don't need to know any address in the first place.
And just how large is this system - how long are the cables going to be? SPI is designed for use on a single circuit board and not for long cable runs - you might have to consider using RS485 or similar as the wire-protocol and SPI over RS485 isn't very practical with its 3 signals plus CS-per-slave.