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.

MSP430FR6043: Getting unstable SPI MOSI data

Part Number: MSP430FR6043
Other Parts Discussed in Thread: MSP-FET, UNIFLASH

Hello all,

I'm sending a byte of data through SPI and checked in the oscilloscope but i got undesired output. 

In debugging, the value of Tx Buffer is updated but in oscilloscope i'm getting some random pulses.

Please guide me where i'm doing mistake.

I'm attaching the code..

#include <msp430.h> 


/**
 * main.c
 */
int main(void)
{
	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
	
	// RESET BY SOFTWARE
	
	UCA2CTLW0 |= UCSWRST;

	// CONFIGURE CTLWO
	
	UCA2CTLW0 |= UCSSEL__SMCLK;
	UCA2BRW = 10;

	// 3-PIN AND MASTER MODE
	
	UCA2CTLW0 |= UCSYNC;
	UCA2CTLW0 |= UCMST;

	// Configure ports
	//-----------------

	// SCLK
	
	PJSEL1 &=~ BIT0;
	PJSEL0 |= BIT0;

	//SIMO
	
	PJSEL1 &=~ BIT2;
	PJSEL0 |= BIT2;

	//SOMI
	
	PJSEL1 &=~ BIT3;
	PJSEL0 |= BIT3;

	//Disable the GPIO power-on default high-impedance mode
	
	PM5CTL0 &=~ LOCKLPM5;

	// Clear the reset through software

	UCA2CTLW0 &=~ UCSWRST;

	int i=0;

	while(1)
	{
        UCA2TXBUF = 0x4e;
        while(!(UCA2IFG & UCTXIFG));

       
	}

	return 0;
}
  

Thanks and Regards,

Ashok Kumar.

**Attention** This is a public forum