Changing MISO and MOSI pins for arduino

HI all,

I am using 4G Arduino shield and SD card with an Arduino UNO as a part of a project i'm working on.

I have a problem with the pins overlapping.
the 4G shield uses pin 12 as a power pin that i need to define as an output and write HIGH to switch on the module, while also the SD library needs to use these pins:
MOSI - pin 11
MISO - pin 12

Is there a way to modify these pins in the library? in fact, is there other MOSI and MISO pins in Arduino ?

You do not say which Arduino board.

Investigate the SD card library for a way to use software SPI where you specify which pins that you want to use for SCK, MOSI, MISO and CS.

Arduino Uno, just edited that.

I tried to look at SD.h and SD.cpp and modify there
But i can't find the definition for those pins there

That's hardware SPI with fixed pins. You need software SPI.

after some googling, i discovered that using software SPI with SD library is a headache and might make errors, so i simply did this to resolve the issue

this is the shield, i just took a wire from the pin that is supposed to be the energy source and solder it to another pin and just bent the original wire so it doesn't fir into arduino when plugging the sheild

I'm sure you did the right thing and thank you for bringing this to our attention. DFRobot have been around for a long time and should know better than to inflict this idiotic bit of design on you. Maybe they will come to their senses and fix it when they deservedly find they can't sell any.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.