I have an SD card in addition to the Ethernet shield.
I noticed that:
If I start the SD card first, and the Ethernet next, both start but loop() does not run.
If I start the Ethernet shield first, the SD card will not run with SPI_FULL_SPEED, or SPI_HALF_SPEED
If I start the Ethernet shield first, the SD card will run with SPI_QUARTER_SPEED but then the loop() never starts.
I would appreciate the community’s help with this issue as I need to have both an SD card and Ethernet. I am considering switching to Xenons but it is not practical at the moment as I have a custom board.
@Jimmie Without code share and from what you have described as @ScruffR has said it is not easy to help.
I would suggest you confirm/try/investigate the following:
Use or confirm you are using the latest SDfat library?
Confirm which Device OS you have on the Photon?
Confirm if your LCD display is running on SPI and how this is initiated?
Look at the Ethernet shield driver software and see what speed it is running the SPI and how this is initiated?
I would guess that there is an error condition with one of the device drivers which ends with while(1);
It would appear that you are running 3 SPI bus devices? off the Photon. They may need to be setup in a specific sequence due to the controller ICs’ restart timing requirements and they will surely all need to be using the SPI bus at the same speed and settings SPI.beginTransmission() and you are not calling SPI.begin() multiple times with incompatible settings and/or SS pins. I remember that initially getting an SD card reader and TFT working together took a bit of time. Personally, I skipped using the Ethernet shield with the Photon for the reason it cannot communicate with the Particle Cloud and have picked up the Xenon with the Ethernet FeatherWing which works out of the box and reliably.
If it looks like the Ethernet FeatherWing is the way to go. I was wondering if you have it working with an SD card and what the SD settings are? I am asking because I will need to build a board that has other stuff on it.
Which SD card library are you using and why do you need to use SPI1 - the Slave Select (SS) Pin allows you to share the bus? I guess using hardware SPI and software SPI might be the cause of the problem.
I have an Adafruit data logger featherwing but had not yet tried it out so I can’t report, in fact, I am not sure how it communicates with the Xenon?