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 do i communicate SPI to UART

Other Parts Discussed in Thread: MSP430F149

I am using TRF960evm with msp430 (http://www.ti.com/tool/trf7960evm) to communicate with OLIMEX webserver easyweb 3 (http://www.olimex.com/dev/MSP430/MSP430-EASYWEB3/MSP430-EasyWeb3.pdf) . the only problem is TRF960EVM only has SPI to send data and OLIMEX only has UART to recieve the data. What can i do to resolve this problem? Will it work if I directly send data from SPI to UART or will i have to purchase an addition interface that converts SPI to uart and then send it ? 

Any suggestion would be greatly appreciated,

KC

  • Hello Prabal,

    the olimex board should allow you to communicate via SPI since there is a MSP430F149 on it which has two USART modules on chip and from a quick view over the datasheet of the olimex board those seem to be available on the headers. So even if you need one UART you can have one SPI in parallel without using software driven SPI von normal pins (which is possible but costs cpu cycles).

    The USART supports synchronous SPI (3 or 4 pin) and asynchronous UART communication protocols, using double-buffered transmit and receive channels.

    Maybe you simply overlooked the SPI capability since the module on the MSP430 is named USART which is very close to UART :-)

  • HI, TRF7960evm has serial interface connected to an UART USB bridge, to connect both board is necessary to unconnect TRF side UART from cp210x and wire to serial rx and tx of Easyweb ttl port or add a level translator to TRF side.

     May be just EW processor can be used to both TRF and network, but using just the serial link is more simple and free from errors.

     Regards

  • Hi Jan,

    P3.4 - 3.7 are available on the headers, but 3 pin SPI needs a clock. I don't see a header pin that can be used as the clock. Can P4.7 (TBCLK) be used in this case? Will it work as SPI clock?

    Thanks.

  • Hi James,

    do you mean P3.4 - 3.7 of your MSP430? Than have a closer look at P3.3 also and read the pin descriptions carefully, this pin on your device has also the name UCLK0 and is used to provide the clock for SPI when USART0 is used in SPI master mode. And I bet you wanted to you look for P3.0 to P3.3 as these pins are used in SPI mode (rather than the P3.4-3.7 which are for UART mode) ;-) Simple to overlook and I don't remember how often I did something like that.

  • Jan,

    P3.0 to P3.3 on the MSP430 are already connected to the CS8900A in this schematic:

    http://www.olimex.com/dev/MSP430/MSP430-EASYWEB3/MSP430-easyweb3-sch.gif

    All of P5 are connected this way as well, so the only available pins we have that we can access on the headers are P3.4 to P3.7. In the user guide it says these pins are USART pins which means they should be SPI capable correct? But for 3-pin SPI we need a clock, so I'm wondering if we can use P4.7/TBCLK for it? Can we just use timers and interrupts on a normal GPIO pin or should it be a dedicated pin like the UCLK0?

    Thanks!

**Attention** This is a public forum