Jump to content
43oh

SIM800L using TM4C123GXL and Energia


Recommended Posts

Hello everyone! I am using the SIM800L module to send SMS through a TivaC TM4C123GXL board, but its clock is 80MHz, and the library only accepts 20, 16 or 8 MHz. In Arduino it worked perfectly, this code found on a website. How do I reduce the TM4C123 clock in Power software? Is there another solution? Thanks in advance!
 

The code:

#include <SoftwareSerial.h>
SoftwareSerial sim(3, 4);
int _timeout;
String _buffer;
String number = ""; //here I inserted my number phone
void setup() {
  delay(4000); //delay for 7 seconds to make sure the modules get the signal
  Serial.begin(9600);
  _buffer.reserve(50);
  Serial.println("Sistem Started...");
  sim.begin(9600);
  delay(1000);
}
void loop() {
  SendMessage();
  delay(10000);
}
void SendMessage()
{
  //Serial.println ("Sending Message");
  sim.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode
  delay(1000);
  //Serial.println ("Set SMS Number");
  sim.println("AT+CMGS=\"" + number + "\"\r"); //Mobile phone number to send message
  delay(1000);
  String SMS = "Testing GSM module";
  sim.println(SMS);
  delay(100);
  sim.println((char)26);// ASCII code of CTRL+Z
  delay(1000);
  _buffer = _readSerial();
}
String _readSerial() {
  _timeout = 0;
  while  (!sim.available() && _timeout < 12000  )
  {
    delay(13);
    _timeout++;
  }
  if (sim.available()) {
    return sim.readString();
  }
}

The error: 

 #error This version of SoftwareSerial supports only 20, 16 and 8MHz processors 

Link to post
Share on other sites
  • 2 weeks later...
  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...