the Mega board ports located on
SCK = Pin 52
MISO = Pin 50
MOSI = Pin 51
CS = Pin 53
the TFT 3.2 inch Shield already connected to 52/50/51/53 pins
when i sold the ethernet pins to the 52/50/51/53 pins
the touch screen and the ethernet card stop to work
when i disconect the ethernet card i can use the TFT
and when i desconnect the TFT and connect the ethernet card i can get DHC
so my project need the 3 hardware TFT , RFID ,Ethernet
so how can i connect the 3 hardware to the Mega boars ??
SCK, MISO and MOSI can be same but the SS for each device must be different !! ??
the quation can i use any of unused pins for SS ??
in another way if Mega 53 pin is SS and use it for the TFT
so for example i can use pin D4 Like SS for Ethernet Module ???
and pin D5 Like SS for RFID ??
SCK, MISO and MOSI can be same but the SS for each device must be different !! ??
Yes.
the quation can i use any of unused pins for SS ??
Yes, even the analog inputs can be configured as digital outputs.
in another way if Mega 53 pin is SS and use it for the TFT
so for example i can use pin D4 Like SS for Ethernet Module ???
and pin D5 Like SS for RFID ??
IS That right ???
I don't see why not as long as all those devices properly share the SPI bus.
You don't even have to use pin 53 as one slave's control (unless it's hardwired of course, like on a shield.) The only rule is that pin 53 (10 on a Uno) must be made an output, else if it was an input it may get taken low and then turn the Arduino into a slave. Once you have it an output, you might as well use it to control a slave, but you're not forced to.
The code that controls each device on the SPI bus much properly assert and de-assert the CS (i.e. SS) at the appropriate time. So, if it has a hard-coded CS pin, you either need to use that or change the code.
EDIT:
A decent library will take a CS pin as part of its constructor or begin() function.
The only rule is that pin 53 (10 on a Uno) must be made an output, else if it was an input it may get taken low and then turn the Arduino into a slave.
OK thanks i understand how it works
If arduino like master the main SS port must be output else if the SS port like low thats will make the board slave