Microcontroller Texas Instruments MSP430F449 to Telit GPRS GM862 connection problems

Discussion in 'Embedded Systems and Microcontrollers' started by d.mancic, Aug 12, 2011.

  1. d.mancic

    Thread Starter New Member

    Aug 12, 2011
    1
    0
    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++;
    }
    ------------------------------------------------------------
     
Loading...