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.

gps-msp interfacing

Other Parts Discussed in Thread: MSP430F5438

Hey! I want to interface my GPS (em-406a) with my mCU msp430f5438...  As it is a RS-232 connection, UART interfacing is required. Now, I m not able to understand how to receive the continuous input of data (complying with the NMEA standards). Please help. Thankyou

  • This is a fairly vague request.  Are you asking about recommendations on the hardware connections?

    If so, you will need to provide more information regarding the specifics of the GPS module you are using.  Does this module output a RS-232 signal, or LVCMOS levels?  This is an important point as the MSP430F5438 can only accept a LVCMOS signaling level.  If you need RS-232, you will need to ensure a RS-232 transceiver is used between the GPS module and the MSP430F5438.

    On the MSP430F5438 side, you should check the MSP430x5xx Family User's Guide to find that you should connect to the USCI interface to support UART mode of operation.

  • BrandonAzbell said:
    This is a fairly vague request

    Indeed it is!!

    I m not able to understand how to receive the continuous input of data (complying with the NMEA standards).

    There are two distinct processes required here:

    1. How to receive any continuous stream of data.
      This is a standard serial comms problem; the actual meaning of the data is irrelevant.
      There are plenty of examples for serial comms.
    2. How to interpret NMEA sentences.
      The NMEA format is long established and very widely used - there are plenty of interpreting NMEA sentences.
      This is independent of the means by which the data was received and, largely, of the processor on which it runs.

    So where, exactly, are you stuck?

    This Whitepaper (with accompanying source code) gives a very good example of applying a State Machine design:

    http://www.visualgps.net/WhitePapers/NM ... arser.html

    The specific problem addressed is the decoding of GPS NMEA Sentences.

     In particular, note that this also illustrates how to accept data from a stream of arbitrary "chunks" that do not necessarily correspond to complete "messages" (NMEA Sentences, in this case)

  • haha! okay! forgive my ignorance. I am new to this. You said there are plenty of serial comm examples. Can u please paste some links!

    Thank you once again!

  • For the specific MSP430 device that you are using, you can go to the Product Folder for that device and obtain simple C code examples to illustrate how to configure the various peripherals, etc.  You can use this as a starting point for communications routines that will layer on top for interfacing to the NMEA stream coming out of the GPS modules.

  • Chandrasekhar N said:
    I am new to this

    BrandonAzbell said:
    go to the Product Folder

    The "product folder" (or product page) gives you summary information about the product, and loads of links to all the supporting materials available - you should spend time browsing & familiarising yourself with what's there...

  • ok thankyou!

    My UART is configured for 4800baud rate, Well I am not able to RX the NMEA sentences(GPS eval board) using the UART code pasted below. Individually GPS+Terminal and UART+Terminal is working fine . But GPS+UART , I am never able to RX any sentences

     

    Any idea where I am going wrong with UART???

    /**

      * Buffer to save data 

      */

    void push_char(volatile char byte)

     {

     rxBuffer[ptr] = byte;

     ptr++;

     }

    /**

     * uart default at 4800 ACLK= 32.768KHz

     * @4800 bps

     */

     void UART_default(void){

     

      P3SEL = BIT3+BIT4;                        // P3.3,3.4 = USCI_A0 TXD/RXD

     

      UCA0CTL1 |= UCSWRST;                      // Put state machine in reset

      UCA0CTL1 |= UCSSEL_1;                     // CLK = ACLK

      UCA0BR0 = 0x06;                           // 4800

      UCA0BR1 = 0x00;                           //

      UCA0MCTL |= UCBRS_6+UCBRF_0;              // Modulation UCBRSx=6, UCBRFx=0

      UCA0CTL1 &= ~UCSWRST;                     // Initialize USCI state machine

      UCA0IE |= UCRXIE;                         // Enable USCI_A1 RX interrupt

    }

    #pragma vector=USCI_A0_VECTOR

    __interrupt void USCI_A0_ISR(void)

    {

      volatile char byte;

        switch(__even_in_range(UCA0IV,4))

      {

      case 0:break;                             // Vector 0 - no interrupt

      case 2:               

        byte=  UCA0RXBUF;

        if (byte == '\r') {

        push_char(byte); // At end of Data transmission

        ptr = 0;

        }

        else{                  

        push_char(byte);

        }

        break;

      case 4:break;                             // Vector 4 - TXIFG

      default: break;

      }

    }

     

  • some help please!

  • Are you receiving any data in your GPS + MSP430 connection over UART?  Is it possible you are getting a few characters and then it stops?  Are you not receiving any UART RX interrupts?

  • No! I am not receiving ANY interrupt through UART. The port is always low.

  • Let's get back to some basics.  You mentioned in an earlier post that you verified the GPS module was transmitting data by connecting it up to a "terminal".  Would you describe that connection?

    Is the GPS module transmitting at TTL output levels?  What is your terminal that you mention?  Is this a COM port on a PC?

    In a similar fashion, please describe the connections between the MSP430 board and your terminal.

  • yes. The evaluationboard of the GPS module also had a USB port. This USB connection to the computer was receiving data perfectly fine.

    Its a COM port.

    The MSP430 was connected through a FET debugger.

  • The MSP-FET430UIF does not have an application UART functionality on it, just JTAG.

**Attention** This is a public forum