This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Missing first character of UART on MSP430F5529LP UART0

Other Parts Discussed in Thread: MSP-EXP430F5529LP

Hi,

I have adapted the SimpleUSBBackchannel code for the MSP-EXP430F5529LP Launchpad for a particular use case. The original program works as follows:

Anything sent over UART1 (connected to my PC over a virtual COM port through ez-FET lite) is reflected on USB (connected to my PC over USB using the ez-FET lite too, as a hub) and vice versa. I have tested this very well through Hyperterminal, etc. This, of course, works very well.

Now, I need to connect to a GSM module over UART0 and the setup I am following is:

  1. Anything sent over USB from PC will be simply reflected back over UART1 back channel (working absolutely fine)
  2. Anything sent over UART1 (virtual COM) from PC will be directed to UART0 (at 115200bps baud rate) as well as reflected over USB to PC for debug purposes.
  3. Anything sent from GSM module over UART0 will be directed to PC over USB.

I have not copied the entire code because it is already part of the MSP-EXP430F5529LP user experience download, and my UART0 handling is an exact replica of the UART1 code with just the "1" changed to "0" in register names, etc.

The problem is that I am receiving the messages from the GSM module on boot up, but every single "first character" on every new line is missing! And, when I try to give it AT commands over UART0 (using UART1 terminal on PC), there is absolutely no response! Even if I hard code it, there is no response! It seems that the "<CR><LF>" or something like that is completely missing from what I am sending over to the GSM module.

I have tried connecting the UART0 TX and RX with a jumper cable and see that indeed, the first character of every new line is missing! The LPM3 is exited at the end of every RX ISR (UART0 & UART1) but the program never asks the MSP430 to actually enter LPM3 (or any other sleep state) ever!

Any pointers or guidance would be immensely appreciated!

Regards,

Anup

  • Anup,

    why are use sending the message in different line (i.e enter after each line). Just type the whole message into a single array. and send the whole array at a single time.and u can also use the array for mob. no. and use the same method if u r good on embedded C/C++.

    the procedure would be follows.

    1. declere and assign two arrays having contact no and message. 

    2. declare function protopype like that...

    void send_message(unsigned char*,unsigned char*);

    3. and declare definition as....

    void send_message(unsigned char *no,unsigned char *msg)
    {

    send command   AT+CMGS="

    for (i=0;i<10;i++)
    {j=(char)(*(no+i));tx_char(j);}
    tx_char('"');tx_char(0X0D);// enter

    _delay_cycles(16000000/5);// give delay is u dont want to see response
    {
    for (i=0;*(msg+i)!='\0';i++)
    {unsigned char k=(char)(*(msg+i));tx_char(k);}
    tx_char(0X1A);//ctrl+z
    }
    }

    Dharmendra Sharma

    INDIA

  • Anup,

    why are use sending the message in different line (i.e enter after each line). Just type the whole message into a single array. and send the whole array at a single time.and u can also use the array for mob. no. and use the same method if u r good on embedded C/C++.

    the procedure would be follows.

    1. declere and assign two arrays having contact no and message. 

    2. declare function protopype like that...

    void send_message(unsigned char*,unsigned char*);

    3. and declare definition as....

    void send_message(unsigned char *no,unsigned char *msg)
    {

    send command   AT+CMGS="

    for (i=0;i<10;i++)
    {j=(char)(*(no+i));tx_char(j);}
    tx_char('"');tx_char(0X0D);// enter

    _delay_cycles(16000000/5);// give delay is u dont want to see response

    for (i=0;*(msg+i)!='\0';i++)
    {unsigned char k=(char)(*(msg+i));tx_char(k);}
    tx_char(0X1A);//ctrl+z

    }

    Dharmendra Sharma

    INDIA

  • Hi Dharmendra,

    Thanks a lot for the helpful code.

    My problem is that when the GSM module boots up, it sends a few lines of messages. My USB terminal displays every line with the first character missing! I suspect that something is amiss because anything that I send (including in your scheme as mentioned above) doesn't elicit a response from the GSM module.

    I suspect something is wrong with the way I am handling the UART module. It's only the first character of every line that is missing every time!

    Regards,

    Anup

  • Anup,

    which GSM module u r using.

    Dharmendra Sharma
    INDIA
    ________________________________________
    Do, click "Verify Answer", if any of my replies helps solve your problem.

  • Hi Dharmendra,

    It's a Quectel M95. But, I observe this behaviour even if I just loopback the TX into the RX with a solder cable.

    Regards,

    Anup

**Attention** This is a public forum