B4R Question Remap the SD card pins on TTGO TCALL SIM800L

sasetcolombia

Member
Licensed User
Longtime User
I'm trying to use an sd card module with the TTGO T-call SIM800L.
I can't use the SPI pins because I need to use also the SIM800L module.
The SIM800L uses the standard pins 23 (MOSI) to PWR
I have the TTGO TACALL module version 1.4 and it would only generate conflict with pin 23.
In version 1.3 it would conflict with pin 5. RST to SIM800L and VPPI_SS (CP)

in this thread they give a solution but for Arduino IDE

this is the code that they implement
Remap Pins Sdcard:
#include "FS.h"
#include "SD.h"
#include <SPI.h>
SPIClass sdSPI(HSPI);
//---------------------SD i used this pins
#define SD_CS 5
#define SD_SCLK 14
#define SD_MISO 12
#define SD_MOSI 13
void setup() {
Serial.println("Initializing SD card...");
sdSPI.begin(SD_SCLK, SD_MISO, SD_MOSI, SD_CS);
if (!SD.begin(SD_CS, sdSPI)) {

Serial.println("Card Mount Failed");

}else{
Serial.println("DEU CERTO INICIAR SD CARD");
}
}

¿How remap the SD card pins on B4R?

THANKS FOR YOUR HELP!
 

Attachments

  • Remap Pin SDCARD.pdf
    159.6 KB · Views: 182

Gerardo Tenreiro

Active Member
Licensed User
Hello
I do not have experience with the SIM800L but I do have experience in using the SPI with different equipment simultaneously. What I usually do is generate a variable as the flag of use of each of the equipments, for example a TFT, an ADC module and a DAC module. To each equipment I assign a number so that before starting the use of the SPI bus I verify that the Flag Value is = 0, at that moment I assign the flag to the value of the equipment that is using the SPI bus, for example to value 1 if you are using the TFT. At the end of the routine, I load the value ZERO to the variable so that another device can use it. Before each routine that uses the SPI bus I check that the flag is at ZERO and thus managed to govern many devices with the same lines of the SPI bus, of course it is that each device uses a unique CS line
A little code can solve the problem.
 
Upvote 0

sasetcolombia

Member
Licensed User
Longtime User
Hello
I do not have experience with the SIM800L but I do have experience in using the SPI with different equipment simultaneously. What I usually do is generate a variable as the flag of use of each of the equipments, for example a TFT, an ADC module and a DAC module. To each equipment I assign a number so that before starting the use of the SPI bus I verify that the Flag Value is = 0, at that moment I assign the flag to the value of the equipment that is using the SPI bus, for example to value 1 if you are using the TFT. At the end of the routine, I load the value ZERO to the variable so that another device can use it. Before each routine that uses the SPI bus I check that the flag is at ZERO and thus managed to govern many devices with the same lines of the SPI bus, of course it is that each device uses a unique CS line
A little code can solve the problem.
Thanks for your comment!
 
Upvote 0
Top