Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430



Ads

Discussion Groups

Discussion Groups | MSP430 | USCxTxBuf

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

USCxTxBuf - ken_and_wanda - Aug 30 4:01:27 2008

I load a byte into the USCxTxBuf of an MSP430F2330. It gets shifted
out by eight edges of the SPI clock onto the SOMI line. Will the same
byte get shifted out when the next eight edges of the SPI clock occur
even if I didn't reload the USCxTxBuf with the same byte? If not, what
will get shifted out? All 0's?
Here's my code which shows how I poll the UCA0TXIFG before loading the
transmit buffer.

while (!(UC0IFG & UCA0TXIFG)); // Is the SPI transmit buffer
// ready to accept a byte ?

UCA0TXBUF = Byte_To_Send_To_AFE; // Load transmit buffer with
// byte.

while (!(UC0IFG & UCA0RXIFG)); // Byte received ?

Byte_Received_From_AFE = UCA0RXBUF; // Store received byte.
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )


Re: USCxTxBuf - zhentoron - Aug 31 10:46:30 2008

--- In m...@yahoogroups.com, "ken_and_wanda" wrote:
>
> I load a byte into the USCxTxBuf of an MSP430F2330. It gets shifted
> out by eight edges of the SPI clock onto the SOMI line. Will the same
> byte get shifted out when the next eight edges of the SPI clock occur
> even if I didn't reload the USCxTxBuf with the same byte? If not, what
> will get shifted out? All 0's?
> Here's my code which shows how I poll the UCA0TXIFG before loading the
> transmit buffer.
>
> while (!(UC0IFG & UCA0TXIFG)); // Is the SPI transmit buffer
> // ready to accept a byte ?
>
> UCA0TXBUF = Byte_To_Send_To_AFE; // Load transmit buffer with
> // byte.
>
>
> while (!(UC0IFG & UCA0RXIFG)); // Byte received ?
>
> Byte_Received_From_AFE = UCA0RXBUF; // Store received byte.
>

In hardware aspect (similar with I2C, UART), a writing into USCxTxBuf
will activate a sequential 7 or 8 bits transmitting. The CLK pin
toggles 7/8 cycles respectively, and then stop swing. So the receiver
only acknoledges a byte that transmitter sent. Nothing happens after
that till software writes new content to the buffer.
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )

Re: USCxTxBuf - ken_and_wanda - Sep 1 8:45:11 2008

--- In m...@yahoogroups.com, "zhentoron" wrote:
>
> --- In m...@yahoogroups.com, "ken_and_wanda" wrote:
> >
> > I load a byte into the USCxTxBuf of an MSP430F2330. It gets shifted
> > out by eight edges of the SPI clock onto the SOMI line. Will the same
> > byte get shifted out when the next eight edges of the SPI clock occur
> > even if I didn't reload the USCxTxBuf with the same byte? If not, what
> > will get shifted out? All 0's?
> >
> >
> > Here's my code which shows how I poll the UCA0TXIFG before loading the
> > transmit buffer.
> >
> >
> >
> > while (!(UC0IFG & UCA0TXIFG)); // Is the SPI transmit buffer
> > // ready to accept a byte ?
> >
> > UCA0TXBUF = Byte_To_Send_To_AFE; // Load transmit buffer
with
> > // byte.
> >
> >
> > while (!(UC0IFG & UCA0RXIFG)); // Byte received ?
> >
> > Byte_Received_From_AFE = UCA0RXBUF; // Store received byte.
> > In hardware aspect (similar with I2C, UART), a writing into USCxTxBuf
> will activate a sequential 7 or 8 bits transmitting. The CLK pin
> toggles 7/8 cycles respectively, and then stop swing. So the receiver
> only acknoledges a byte that transmitter sent. Nothing happens after
> that till software writes new content to the buffer.
>
But in my case my device is the slave. It receives a byte from the SPI
master which supplies the clock. My device, the slave, doesn't
initiate communicatons but just responds to communication started by
the master.
------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )