I have Atmega1280v 8MHz 3.3V with SH1106 OLED display and uSD card reader. Devices are working on SPI (hardware). When I test them alone, both works, but when I want to run them together mcu stops while initializing SD card.
For display I have tried U8glib and Adafruit_SH1106 library. For SD card, SdFat.h and SD.h.
What is more, display works with SD.h library, but freezes with SdFat.
SPI_HALF_SPEED etc daosn't help.
"display works with SD.h library, but freezes with SdFat"
One difference between those two libraries is that SdFat configures the SPI bus before each and every access whereas SD only configures it at initialization. So maybe it's an SPI compatibility issue.
Setup function just stops when gets to sd.begin() with SdFat, so this is first init.
I guess there are many people running U8glib and SdFat libraby, but is there anybody with SH1106 driven display?
I should add that I have started my project with Arduino pro mini board and SdFat worked together with this display, BUT I was using very simple display library from m3gg ( m3gg · GitHub ) without frame buffer.
I have already moved from SdFat library to SD library in my project (don't need fast SD access), but this might be solution: