Is it possible via code to assign, for instance, pins A3, A4, and A5 on a Mega to be connected to MOSI, MISO, and SCK, while retaining existing SPI pin connectivity? On my prototype I have no way to physically connect an additional SPI device to pins 50, 51, or 52. But I am able to connect to A3, A4, and A5.
Only if you add jumper wires between the sets of pins, say on the bottom of the Mega card.
There is no reassignment of hardware functions to pins in the '328P/1284P/2560 chips.
I don't know if it helps but remember you can have multiple devices on the same SPI bus.
Just make sure you configure the Chip-Select (CS) pin correctly and use atomic SPI transactions, for example, by basically disabling any interrupt before read/write to SPI and re-enabling it later, have a look on http://www.arduino.cc/en/Reference/NoInterrupts
Also, as good practice place a pull-up resistor on all CS lines. Here some good reference:
http://www.dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_steps
Cheers,
Mike M.
da40flyer:
On my prototype I have no way to physically connect an additional SPI device to pins 50, 51, or 52.
That sounds like some seriously bad prototype planning, but, hopefully, you haven't blocked out the six-pin cluster ICSP, so maybe you can use those instead. At least they are there for that purpose, and thus a lot better proposition than trying to use pins A3>5..