MSP430 SPI Double TX

I have an MSP430F169, and I am trying to use USART1 as a SPI master. I am no stranger to writing SPI bus drivers, but I am new to using the MSP430.

My first write to the U1TXBUF results in the the expected SPI transfer. However, subsequent writes to the U1TXBUF result in two identical octets being transferred.

I'm using a logic analyzer to "see" the SCLK and MOSI behavior.

Has anyone seen/solved this problem? Here's a little test code for my Olimex board that reproduces the problem nicely.

Here's the "distilled" code that reproduces the problem, and yes, I've got a problem report pending with TI.

#include

int main(int argc,char *argv[]){ WDTCTL = 0x5A00 + 0x0080; DCOCTL = 0xE0; BCSCTL1 = 0x10; BCSCTL2 = 0x88; U1CTL = (unsigned char)0x01; U1BR0 = 4; U1BR1 = 0; U1CTL = (unsigned char)0x17; U1TCTL = (unsigned char)0xA3; U1RCTL = (unsigned char)0x00; U1MCTL = (unsigned char)0x00; ME2 |= (1

Reply to
Michael N. Moran
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.