Sign in to follow this  
Followers 0
nirbar11

UART interface to sim900

4 posts in this topic

Hello
Im trying to send sms message by sending AT commands from MSP40F5529 to SIM900 (by Simcom).
physical connections: Rx(P3_4) to Tx, Tx(P3_3) to Rx, GND to GND.
When I plug the micro-usb cable and turn the serial monitor on ,I can see the commands and messages well.

I scoped the signal from the UART pins of the MSP and I saw noting changes (constant 0) - the pins do not react to my code.

this is my code (i print int 55 in order to see some changes in the uart pins value ,which didnt happend) :

void setup(){
Serial.begin(9600);
}


void sendsms(){
Serial.println("AT\r");
delay(1000);
Serial.println("AT+CMGF = 1\r");
delay(1000);
Serial.println("AT+CMGS =\"+972****844095\"\r"); //my phone number
delay(1000)
Serial.println("HELLO WORLD");
delay(1000);
Serial.println((char)26);
delay(100);
}


void loop() {
  Serial.println(int(55));
  //delay(200);
  sendsms(); 
}

questions:
1. do i need to configure my UART pins in setup() or its done automatically when I use Serial? because I didn't declare anything
2. When I plug the usb cable - the serial reading and writing from the UART pins are stopped? because i scoped both cases (with and without usb cable) and the results were different
3. Why is the serial monitor shows all fine and when i scope the signals , the voltage value does not change? do i need to use some special library?

 

Looking forward for help.
Thank you
Nir

Share this post


Link to post
Share on other sites

There are two hardware UARTs on the F5529.  See the Energia pin diagram here.  Note that P3_4 and P3_3 are designated as RX(1) and TX(1) respectively.  RXD and TXD are connected to P4_5 and P4_4 on the header with the jumpers.  When you specify Serial in Energia it is using P4_5 and P4_4.

Quoting from the Energia reference on the Serial Library:

Quote

Depending on your hardware you may have more than one pair of UART pins. By default, you can use “Serial” when using UART. You can use additional UART pins by calling “Serial1, Serial2, …” etc.

To use pins P3_4 and P3_3, specify Serial1 instead of Serial.

Share this post


Link to post
Share on other sites

Amazing, thank you! I just moved the connectios to the RXD and RXD and it works

Only one more issue:
I want to watch the serial communication through the monitor. i can not see nothing there. I have 2 options (COM3 and COM4). none of them works.
Any suggestions?

 

Thank you!!!

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  
Followers 0