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.

  • Resolved

TIDA-01485: MSP430F5132 UART Comminications

Prodigy 220 points

Replies: 6

Views: 1128

Part Number: TIDA-01485

Hello,

This design uses P3.0 and P3.1 for UART communications, but I am not able to get it to work. I am able to get serial communications working using P1.1 and P1.2 for UARTutilizing examples that I have found. However, these pins are assigned as an ADC input. I think my problem is that I am not familiar with how to map to these pins.

Thank you,

  • Hi Rodney,

    It looks like the design configure P3.0 and P3.1 for UART, but I do not see anywhere that UART communication is actually done. You would need to write your own code to use the UART.

    As for P1.1 and P1.2, they are set by default to be configured for UART. This can be changed using P1MAP.x as discussed in section 13 of the User's Guide. These pins can only be used for one function at a time.

    Regards,
    Nathan
  • In reply to Nathan Siegel:

    Nathan,
    Thank you for the reply. You are correct. The UART communications is not actually done. I am trying to implement it but not having much luck. I am new to TI microcontrollers. I am hoping to find an example.

    Thank you,
  • In reply to RS:

    Hi,

    UART example code for the MSP430F5132 can be found here: www.ti.com/.../getliterature.tsp

    The TI Design already configures the UART (for P3.0 and P3.1), so all you would have to do then is move a value to the transmit buffer to start a transmit, or use an interrupt to read a UART receive. This can be done in the same way as in the examples. The only difference is that it will use different pins.

    Regards,
    Nathan
  • In reply to RS:

    Hi Rodney,

    Did this information help? If so, please mark it as answered.

    Thank you,
    Nathan
  • In reply to Nathan Siegel:

    Hello Nathan,

    No, I still have not been able to get it to work on P3.0 and P3.1. I have no problem at all getting UART communications to work on P1.1 and P1.2 though. I would really like to get it to work on port 3 as the board is designed. Would thee be any way that you could build a simple program that receives a byte on P3.1 and echo right back out on P3.0?

    Thank you,

    Rodney

  • In reply to RS:

    Hi Rodney,

    Again, those pins are already set up in the code for UART. The only thing you would need to add for the UART echo is to write your ISR with the following:

    while (!(UCA0IFG&UCTXIFG));             // USCI_A0 TX buffer ready?

    UCA0TXBUF = UCA0RXBUF;                  // TX -> RXed character

    The only other thing I see in the TID code that might be missing is that, though it maps these pins to the eUSCI module for UART, I do not see anywhere in the code where these pins are set to their secondary function (which they need to be for pin mapping). So, please try including these lines in the init_IO function:

    P3SEL |= BIT0;

    P3SEL |= BIT1;


    Please give this a try and let me know if it works,

    Nathan

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.