I am busy with a project that would involve both the Arduino Mega and The Raspberry Pi3, my Arduino has a few components on and the Raspberry Pi has a GSM add-on on. My main issue is that i need to connect my Arduino to the PI without using a USB cable. Now i know i can use a few jumper cables to connect the two between the TXD and the RXD ports on the Pi but the GSM add-on is already using those.
So my question is: Can i use the ISCP header to transfer data like a JSON response to and from the Pi and if not what specifically are the ISCP headers used for? If this is not possible what would be a viable workaround, bear in mind i cant use a USB cabe between the two(It uses too much space and looks too messy).
Second question is: can i maybe use different GPIO pins on the pi to connect the Arduino to with the same function as the TXD and the RXD?
pins on the ICSP header are SPI pins. you can use SPI with Arduino SPI library.
However, the ICSP connector does not include a "chip select" pin that would also be needed.
I believe that that RPi only supports SPI "master" mode, and you would need some chip select to make SPI work.
The Three SPI pins on the ICSP connector can also be used for general purpose IO. On Uno and Mega, they're also connected in parallel with other digital pins. (not necessarily so on other boards.)
On SAMD21-based boards (zero), you can potentially re-program the SPI/ICSP port for other serial protocols (TWI, UART)