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.

Timer UART vs USCI UART

Other Parts Discussed in Thread: MSP430G2553

Hello all,

I am a beginner and using MSP430 launchpad having MSP430G2553. Till now I have got along with interrupts, timers and ADCs and I am able to read temperature in the registers in CCS. Obviously my next worry is to use UART communication to transmit internal temperature sensor reading to my computer.

I want to ask what is the difference between Timer UART and USCI UART? In the pre-installed code provided by TI in MSP430G2553, they have used Timer UART while they could have used USCI UART module, right? USCI UART seems to be much simpler to understand and implement. Whats the catch?

Thank you in advance.

  • No catch use the USCI if possible.

    The older revisions of the launchpad would have required some hardware changes to support USCI UART - one the newer ones I believe you can just alter the orientation of the TX RX jumpers to switch the UART over to the USCI pins.

    I assume they also favoured the Timer A usage as I presume the other chips which were previously provided did not have a USCI UART.

  • Thanks Alan. I wrote a small program to transmit alphabets from a to z using USCI UART. But I am not able to get any output at the HyperTerminal. Can you or anyone please check if there might be error? (I don't even know if I should be posting this here). I have properly set the settings (Baud rate, etc) in HyperTerminal.

    #include "msp430g2553.h"
    #define     RED          BIT0


    void main(void)
    {
       unsigned int i=0;
       WDTCTL = WDTPW + WDTHOLD;                             // Stop WDT

       P1DIR = 0xFF;                                                                  // All P1.x outputs
       P1OUT = 0;                                                                      // All P1.x reset

       P1SEL = BIT1 + BIT2 ;                                                  // P1.1 = RXD, P1.2=TXD
       P1SEL2= BIT1 + BIT2 ;                                                 // P1.1 = RXD, P1.2=TXD

       BCSCTL1 = CALBC1_1MHZ;                                      // Set DCO
       DCOCTL = CALDCO_1MHZ;

       UCA0CTL1 |= UCSSEL_2;                                          // CLK = SMCLK
       UCA0BR0 = 104;                                                           // 1MHz/9600 =104
       UCA0BR1 = 0x00;                                                          //
       UCA0MCTL = UCBRS1 + UCBRS0;                           // Modulation UCBRSx = 3
       UCA0CTL1 &= ~UCSWRST;                                      // **Initialize USCI state machine**
                                                                                                  // No interrupts

       for (i=97;i<123;i++)
       {
          while (!(IFG2&UCA0TXIFG));                                      // USCI_A0 TX buffer ready?
          UCA0TXBUF = i;
          P1OUT ^= RED;                                                            // Red LED toggles everytime a byte is sent
          _delay_cycles(100000);                                             // Observe LED toggling
       }
    }

    Should I have done something with jumper connections?
    Thanks
  • I am afraid I cannot be a whole lot of use here as a hardware UART isn't something I have dabbled with.

    However I know that the hardware UART has RXD = 1.1 and TXD = 1.2 however the Timer A example - and the connections to the USB - have TXD = 1.1 and RXD = 1.2 so you need to interchange these connections.

    On the rev 1.5 board:

    Jumpers 4 and 5 connect the UART interface of the emulator to the target device pins P1.1 and P1.2. The
    direction of the UART signal lines can be selected by the orientation of the attached jumpers. In horizontal
    orientation, the jumpers connect TXD to P1.1 and RXD to P1.2, as they are used for the software UART
    communication on the demo application (see Section 3.2). In vertical orientation, the jumpers connect the
    TXD signal to P1.2 and the RXD signal to P1.1, as required for the MSP430G2553 USCI.

    www.ti.com/lit/ug/slau318b/slau318b.pdf

    You should be able to check the box to see if you have the rev 1.5 board, but it should be easily identified as it came with male headers attached ( as well as with a 2553 so I am assuming you have this model)

    However if you have an older LP you'll need to do something like this:

    http://www.43oh.com/2011/10/dongle-swaps-serial-lines-on-the-launchpad/

  • With regards to HyperTerminal its been a while since I have used it. I assume a connection has been made on the correct COM port - its usually distinctly labelled?

    The baud rate will be 9600. Though even if it is wrong you should still be seeing gibberish coming through at the terminal.

  • Alan,

    That worked. Thanks a ton. That was so simple.

    By the way, why did TI change the configuration when they were following one format all these years? Anyways, never mind, and thanks again.

  • very helpful suggestion... and saved lot of time

**Attention** This is a public forum