#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Microcontroller Texas Instruments MSP430F449 to Telit GPRS GM862 connection problems


    Hi everybody,


    I connected my MSP430F449 controller to GPRS GM862 over the RS232 serial port. I want to send AT<cr> command, and to read response OK (in fact, it responses <cr><lf>OK<cr><lf>). However, I receive only one character, the one I sent the last (and that is <cr>).

    Here is the code. Where did I wrong?

    It enters the interrupt routine only once... Please, help! Thanks!


    ------------------------------------------------------------

    #include "io430.h"
    #include "in430.h"

    #include<string.h>
    #include<stdio.h>

    unsigned char d;
    int b;

    int main( void )
    {
    // Stop watchdog timer to prevent time out reset
    WDTCTL = WDTPW + WDTHOLD;

    P2SEL |= 0x30;
    ME1 |= URXE0+UTXE0;
    U0CTL = 0x10;
    U0TCTL = 0x30;
    U0BR0 = 0x6D;
    U0BR1 = 0x00;
    U0MCTL = 0x0040;
    IE1 = 0x40;
    _EINT();

    b = 0;

    while(!IFG1&UTXIFG0);
    U0TXBUF = 'A';
    while(!IFG1&UTXIFG0);
    U0TXBUF = 'T';
    while(!IFG1&UTXIFG0);
    U0TXBUF = 0x0D;
    while(!IFG1&UTXIFG0);

    while(1)
    { }

    }

    #pragma vector = UART0RX_VECTOR
    __interrupt void uart0RxHandler (void)
    {
    d = U0RXBUF;
    b++;
    }
    ------------------------------------------------------------
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,377
    Rep Power
    1871
    > It enters the interrupt routine only once... Please, help! Thanks!
    Well you probably need to do more in your ISR than just read the data.

    It seems to me that you also need to figure out what "IRQ-ACK" (Interrupt Acknowledge) is also required for that particular device. Until you do this, it won't inform you of any more characters.

    Also, modern UART's come with buffers, so you might need to check whether there is more data in the buffer.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0
    Hi, thanks for answering!

    The problem was ECHO. GPRS immediately returned back every char I sent him. When I turned ECHO off, he started to accept all my commands.

    Thank you again!

IMN logo majestic logo threadwatch logo seochat tools logo