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.

MSP430F449: USART Peripheral Interface configured for SPI and UART in turn

Part Number: MSP430F449

Hi,

I need to use USART0 PI for both SPI and UART traffic. Of course not exactly the same time but once in a second I need to send some log data to UART and in turn it would need to be in SPI mode. There is a flash memory behind that SPI.

The problem is that whenever there is a SPI write to U0TXBUF register, the data will be echoed to UART as well even though USART PI is configured to SPI mode at that time. I've not checked but I'm afraid that UART data is also echoed to SPI line.

Any way it's not acceptable that SPI data is transferred to UART pins through that buffer. Have I done something wrong or is it impossible to use USART0 in turn for UART and SPI?

  • Hi Pauli,

    Looking at the USART black diagram (Fig 17-1 in User Guide SLAU056l), the TXBUF feeds the Transmit Shift Register, and ultimately ends up on a line that is hardwired to UTXD, so it is expected that anything output from that USART would be visible on the UART TX.

    However, the SIMO, URXD, and SOMI pins are all mux'ed. So, as long as you configure SYNC properly between transaction types , you should not see UART data on the SPI pins.

    It would appear that it is possible to use the USART for both SPI and UART, provided your system can tolerate non UART data on the TX pin.

  • Hi,

    Thank you! This confirms what I thought that there is no way to prevent SPI data to come out from UART TX. Guess I need to make some kind of encoding so I could tell valid data from rubbish.

    Br, Pauli

**Attention** This is a public forum