Go Down

Topic: Can I use the GSM and SD library together? (Read 363 times) previous topic - next topic


Apr 19, 2016, 01:12 pm Last Edit: Apr 19, 2016, 01:27 pm by ElusivePi
The SD library uses pin 13 for clock. I'm not sure if the GSM library uses it as well.

I've tested my code with the SD library (#include <SPI.h> and #include<SD.h>) commented out and the GSM library included and my program runs as expected. However, when I include the libraries that were commented out, the code does not run (I've issued print statement immediately after void loop() and that print statement does not get called. It could be that I'm stuck in another loop (and this is likely the case) but I will keep checking).

If it helps, the SD library uses the SPI library which uses the SoftwareSerial library.

The headers for my program are:
#include <GSM.h>
#include <SPI.h>
#include <SD.h> //Commenting this library out makes the code behave correctly.

If they aren't compatible, do I have to use two Atmegas and basically dedicate one to be a GSM controller and the other to be an SD card controller?
Oscilloscope: Rigol DS1054z 50MHz (100MHz)
Function Generator: Siglent SDG 2042X
DC Power Supply: HY3005F-3

Go Up