The question is, Is it possible to use MISO and MOSI pins with a software serial library (after SPI tasks are finished)?
The problem is that in my project, SPI communication is used at initialization to read configuration params from an SD card. For this, SD library is used.
Then part of this configuration data must be sent to an XBee using UART. Due to a PCB design flaw, no other pins than MISO and MOSI can be used for UART.
I tried some libraries (SoftwareSerial, NSWSerial, AltSoftSerial) to initialize a serial port in 11,12 pins but no data is received in the XBee, just rubbish when SD card is read, after that, nothing. It seems like those pins are stuck by the SD library in some way…
I solved it by setting to ‘0’ SPIE bit in SPCR register after SD tasks.
SPCR &= (0<<SPIE);