MarcosA 1 Posted August 9, 2018 Share Posted August 9, 2018 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 Quote Link to post Share on other sites
Fmilburn 445 Posted August 9, 2018 Share Posted August 9, 2018 I am not sure if Energia supports it on the TM4C123 but try using hardware serial - eg Serial1 or Serial2 instead of software serial http://energia.nu/reference/serial/ Quote Link to post Share on other sites
MarcosA 1 Posted August 23, 2018 Author Share Posted August 23, 2018 Thank you, Fmilburn! I was wrong when I was trying to use the library SoftwareSerial.h. Now just using Serial3.begin and etc and looking the arm's pin map, the program is working. Thank you one more time! Fmilburn 1 Quote Link to post Share on other sites
vinith 0 Posted March 14, 2019 Share Posted March 14, 2019 hi marcosA please put the codes which you have changed even I am facing the same problem... Quote Link to post Share on other sites
Fmilburn 445 Posted March 15, 2019 Share Posted March 15, 2019 I suggest looking in the language reference and getting familiar with it, e.g. http://energia.nu/reference/en/language/functions/communication/serial/begin/ You have not specified the board you are using and some do not offer multiple serial. Quote Link to post Share on other sites
vinith 0 Posted March 16, 2019 Share Posted March 16, 2019 same board tm4c123gxl Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.