EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Best way to reset USART in SPI mode?

Started by gmannigel December 18, 2006
Hello,

i want to use a SPI connection to a peripheral.
I am worried that if the MSP430 as SPI slave would get a stray clock
pulse, it could be off by one until eternity.
What is the best way to reset the SPI bit counter?
SWRST? Full initialisation of the USART? Any other way?

cheers
Gunther

Beginning Microcontrollers with the MSP430

As a comment. I 've asked TI because I wanted to avoid using a RESET IO LINE
FROM MASTER TO SLAVE. THey've told me that spi internal hardware must be
reset that way to ensure the spi reset state.

Of course I've asked if it could be by software and they told me NO.

maybe is any way, but I couldn`t get any.

_____

From: m... [mailto:m...] On Behalf Of
gmannigel
Sent: Lunes, 18 de Diciembre de 2006 02:40 p.m.
To: m...
Subject: [msp430] Best way to reset USART in SPI mode?

Hello,

i want to use a SPI connection to a peripheral.
I am worried that if the MSP430 as SPI slave would get a stray clock
pulse, it could be off by one until eternity.
What is the best way to reset the SPI bit counter?
SWRST? Full initialisation of the USART? Any other way?

cheers
Gunther

--


--
I do not know the best way. But using SWRST works.

You simply set and than clear SWRST. This will reset the
SPI internal state machine, including the shift register bit
counter you worried about. It also clears the flags and the
interrupt enable bits associated with SPI.

There is a TI example that resets the entire chip in order to
reset the SPI. It seems too drastic to me.

--- In m..., "gmannigel" wrote:
>
> Hello,
>
> i want to use a SPI connection to a peripheral.
> I am worried that if the MSP430 as SPI slave would get a stray clock
> pulse, it could be off by one until eternity.
> What is the best way to reset the SPI bit counter?
> SWRST? Full initialisation of the USART? Any other way?
>
> cheers
> Gunther
>

Memfault Beyond the Launch