pylon:
Mega2560 and M0 have different voltage levels. Do you use level converter for all SPI signals?If you connected them directly check the pins on the M0 for damage as the 5V of the Mega2560 are over specs.
What do you mean with different voltage levels? No I'm not using level converter.
aapatil:
Looking at this piece of code, you pull SS low, transfer code, pull SS high, transfer code again, pull SS high, etc. You never pull SS low again, so you wouldn't be able to transfer anything.
Yes, my bad. I took SS high out of for loop but it didn't help.