Is it possible to use any digital pin as a chip select pin on the mega ?
I am building a board which is pretty heavily populated and I want to include a Micro SD adapter. Normally they seem to use pin 4 for the chip select but I'm already using that pin. Ideally I'd like to use pin 16 (TX2) or pin 17 (RX2).
Is it possible to just change the cs pin in my code or are there any hardware limitations?
I wasn't aware of this issue but (by sheer fluke !!) I'm only using 3 level shifters (MOSI, SCK and CS) with MISO connected directly to the SD socket so it should be Ok. I do currently have one other device (MCP2515 CanBus) on the bus and will potentially add a third (TFT Display) although my preference will probably be to go I2C with that.
Sanity checking the design revealed that D6 (device pin 15) was free so I've opted to go for that for the SD CS.