What is the easiest way to talk to multiple slave devices using and Arduino platform (or TI Energia platform). the issue I am thinking about is having to keep passing the new CS pin the SPI begin function. Any help is much appreciated.
Thanks
Kas
What is the easiest way to talk to multiple slave devices using and Arduino platform (or TI Energia platform). the issue I am thinking about is having to keep passing the new CS pin the SPI begin function. Any help is much appreciated.
Thanks
Kas
Your question exposes the limitations of using "out of the box" library functions to control hardware - one is always at the mercy of the choices and simplifications made when the function was written.
All is not lost - the Arduino stuff is open source so you can modify the SPI driver for the slave so that the MISO pin is tri-stated when the port is at rest. Then you can devise a protocol which allows the master to address a slave to talk - so that the slave then activates its MISO pin. This way you can wire many slaves in parallel, subject only to the limitations of hardware.
The downside of this approach is that every slave must be able to see the "address to talk" messages from the master - which will add to the processing load on them - but in many cases this isn't a problem.
If the slave devices are just dumb chips this system won't be possible - my solution then would be to use Shabaz's method, or a modern processor which will have multiple SPI ports, or be fast enough to bit bang as many as you might want.
MK
Thank you for the responce, I have not used Emergia or Arduino that much, I prefer barebones... That being said I would really need to spend some time to learn how to edit the library to include a CS pin to set high or low in teh function call.
It is this reason I have kept away from Energia and Arduino I find it very confining and restricting in what and how I can do things.
Thank you for the suggestions and the help
Kas
Thank you for the responce, I have not used Emergia or Arduino that much, I prefer barebones... That being said I would really need to spend some time to learn how to edit the library to include a CS pin to set high or low in teh function call.
It is this reason I have kept away from Energia and Arduino I find it very confining and restricting in what and how I can do things.
Thank you for the suggestions and the help
Kas