Jump to content

UART communication results in garbled values on Serial Monitor

Recommended Posts


I have been trying to create a serial link between the Launchpad (based on tm4c123gh6pm) and my cellphone. The code is very simple for testing purpose. Here is it:

/* This is a demo code for testing Bluetooth functionality
->The peripheral used here was a smartphone; and to obtain the values of 'i' on the terminal of the device, the "display mode" setting must be changed to ' HEX'
->The code doesn't work properly on when the pin 10 and 11 are used as RX and TX
->It has been successfully tested to send the values of i to the Rx terminal and receive the characters sent from there. */
int i=0;
void setup()
 Serial.print("Welcome ");
 char data_from_Blue=0;
 //String rx_str = "";
void loop()
           data_from_Blue = Serial.read();    // reading the data received from the bluetooth module/the peripheral (phone here)         
           Serial.println("I received: ");
           //Serial.println(rx_str);   //display it on serial monitor  i.e,the reading has been received here!!              
      Serial.write(i);                //Print incrementing value of 'i' across the other terminal(i.e, my cellphone)

The code works fine for Arduino+HC05 and MSP430G2 Lauchpad Kit+HC05.

But for TIVA Launchpad mentioned above, the serial monitor simply displays garbled values with '?' within boxes. I have tried almost everything.

Please help me. 

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