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.

how to select each function in Pins mapped to multiple functions of MSP430F5635

Other Parts Discussed in Thread: MSP430F5635

Hi

Few pins in MSP430F5635 is mapped to multiple functions .

eg.

P8.6/UCB1SOMI/UCB1SC
P8.5/UCB1SIMO/UCB1SDA
P8.4/UCB1CLK/UCA1STE
P8.3/UCA1RXD/UCA1SOMI
P8.2/UCA1TXD/UCA1SIMO
P8.1/UCB1STE/UCA1CLK

For my design , I need to use the

1. UART for connecting to an RS232 port and

2. SPI for connecting to an external SPI device.

I decided to use the UCA1 UART and UCB1 SPI . I have to use the pins P8.2 and P8.3 for the UCA1TXD and UCA1RXD respectively.

How do I choose this functionality ?

I am confused as the same pin is assigned for 2 purposes . If I have to use P8.2 for UCA1TXD what should I do ?

If I have to use P8.2 for UCA1SIMO what should I do ?

When I do P8SEL = BIT2 , What happens ? which functionality of the pin is brought into action ?

I am very new to embedded programmng .

If my questions are silly  , please do not mind . Please do answer me .

Thanks in advance.

Jenitta

  • The USCI module handle the selection on their onw (as well as the direciton of the pot pins). Setting P8SEL only switches between port or USCI usage. Which function the pin then has depends on USCI programming.

    As you can see, only one funcitonality can be possible at one time. Either USCI A1 is used for UART (then P8.2 is TXD) or SPI (then it is SIMO) but not both a the same time.

    An exception is the STE pin. If P84/P8.1 are required as CLK for one sub-moduel (A or B), then the STE functionality is not available for the other sub-module.
    So on the bottom line, you cannot use 4-wire SPI on one sub module when you want to use SPI on the other one too.

    Jenitta Rex said:
    When I do P8SEL = BIT2 , What happens ? which functionality of the pin is brought into action ?

    "USCI1" functionality - whatever USCI is programmed to do :)
    Please keep in mind that using "=" operator means that you set BIT2, but also clear all other bits. To just set this bit and keep all others unchanged, use "|=" operator.

**Attention** This is a public forum