Go Down

Topic: SPI comunication in the arduino (Read 1 time) previous topic - next topic

luckiboy1875

what is SPI library and how can i used , can i used to control 5 or 3 microcontrollers

iluvatar

must read:
http://arduino.cc/en/Reference/SPI
http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

It's meant to be for control I/O devices, I don't know how hard could be to put a microcontroller instead.

graynomad

A micro can be an SPI slave just like any other chip. It is enabled by pulling the SS pin low, therefore a master can have say 5 outputs connected to the SS pins of the 5 slaves.

To talk to slave 3 pull that pin low and leave the others high etc.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

MonkeyKnight

Yes, you can use it to control 5 or 3 microcontrollers.

There are multiple ways of meeting your goal of multiple micros.

luckiboy1875

but if i do this how does it work  pre programming the avr so when the arduino  command him start the sketch or another way

cyclegadget


but if i do this how does it work  pre programming the avr so when the arduino  command him start the sketch or another way



Quote
Slave Select pin - the pin on each device that the master can use to enable and disable specific devices. When a device's Slave Select pin is low, it communicates with the master. When it's high, it ignores the master. This allows you to have multiple SPI devices sharing the same MISO, MOSI, and CLK lines.


The slave select "SS", sometimes call chip select "CS", can be a pin or pins of your choice set to output low when you want to communicate with a device. When you are wanting to stop comms. to the selected device, you reset the pin to high.

Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Go Up