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.

MSP430G2553 Changing pins on UART

Other Parts Discussed in Thread: MSP430G2553, MSP430WARE

Hello, I would like to control 2 different devices via serial, and would like to know how I would go about switching the output to another set

I have tried changing bit1 and bit2 to bit3 and bit4 with no luck.

Also is there anything I need to mind when switching between them?

Cheers

John

void msp430Initialisation(void)

{

  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT

  BCSCTL1 = CALBC1_1MHZ;                    // Set DCO

  DCOCTL = CALDCO_1MHZ;

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

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

  UCA0CTL1 |= UCSSEL_2;                     // SMCLK

  UCA0BR0 = 104;                            // 1MHz 9600

  UCA0BR1 = 0;                              // 1MHz 9600

  UCA0MCTL = UCBRS0;                        // Modulation UCBRSx = 1

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

  IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

}

  • The MSP430G2553 doesn't have the ability to map peripherals to different I/O pins. The P1SEL.x and P1SEL2.x bits can only select a fixed set of peripheral functions per pin.

    To be able to switch peripherals to different pins you need a 5xx or 6xx series device which contains the Port Mapper module.

    The MSP430G2553 only contains a single USCI_A (UART/LIN/IrDA/SPI), which means you are stuck with using the UART peripheral on P1.1 for RXD and P1.2 for TXD (as shown by Table 16 Port P1 (P1.0 to P1.2) Pin Functions in the MSP430G2553 data sheet).

    The MSP430ware_1_00_00_00\examples\devices\2xx\MSP430G2xx3 Code Examples\C\msp430g2xx3_ta_uart9600.c example uses a timer to implement a UART in software, which might allow you to communicate with a second serial device (with the pins restricted to ones connected to a timer module).

  • Cheers for the response-

    I think as I'm just doing a proof of concept for my uni I'll just multiplex the signal and call it a day.

    Thanks again

**Attention** This is a public forum