Jump to content
Sign in to follow this  
MarcosA

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 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×