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.

Direction Registers for UART and I2C Modes?

Other Parts Discussed in Thread: MSP430F5438, MSP430G2553

What are the settings for the direction register bits for the following pins/functions?

TXD

RXD

SDA

SCL

Cannot find this anywhere in the literature, and the pin diagrams don't show this expicitly as far as I can glean.

Thanks.

  • You didn't specify which device, and therefore which type of serial module, but the pin diagrams have a note along the lines of "The pin direction is controlled by the USCI module" along with showing the direction register bits as "don't care". e.g. from the MSP430F5438 datasheet:

      

  • Hi Chuck,

    Depending on your MSP430 model, you would need to change the IO configuration registers to set the pins to "peripherals" function.

    For example, with MSP430G2553 using the USCI_A0 in UART mode, you would do

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

    And for I2C

      P1SEL |= BIT6 + BIT7;                     // Assign I2C pins to USCI_B0
      P1SEL2|= BIT6 + BIT7;                     // Assign I2C pins to USCI_B0

    These can all be found in the G2xx3 code examples (slac485a).

    Tony

  • Thanks. I've set the SEL bits correctly, but could not find requirements for DIR bits. And I am using G2553. Also was wondering if OUT bits matter.

    Thanks again for response. Much appreciated.

  • Using G2553. Was also wondering if OUT bits matter.

    Thanks.

  • Since you are using the pins in peripheral mode, whatever you set as PxOUT will be overridden by the peripheral when it changes its output.

    Look into the example code I referenced, they are self contained examples of how to operate each individual peripheral with typical usage cases.

    Tony

**Attention** This is a public forum