Hi all,
I am currently having problem sending SPI MOSI data output from eZ430-RF2500 (MSP430F2274). I have checked the Clock and CS output is correct. But, the problem is the output of MOSI always in the range of 220mV, which is very small.
Basically, I just need to investigate the output of the SPI. Can anyone help me what is wrong with my code?
Note: CLOCK pin connected to channel 1 oscilloscope, MOSI pin connected to channel 2 oscilloscope. CS and MISO are floating.
#include <msp430f2274.h>
int main(void) {
volatile unsigned int i;
unsigned char x;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P3SEL |= 0x0C; // P3.3,2 USCI_B0 option select
P3DIR |= 0x01; // P3.0 output direction
DCOCTL |= DCO1;
BCSCTL1|= RSEL0;
UCB0CTL0 |= UCMSB + UCMST + UCSYNC; // 3-pin, 8-bit SPI mstr, MSB 1st
UCB0CTL1 |= UCSSEL_2; // SMCLK
UCB0BR0 = 0x02;
UCB0BR1 = 0;
UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
while(1)
{
P3OUT &= ~0x01; // /CS reset
while (!(IFG2 & UCB0TXIFG)); //
UCB0TXBUF = 0xFF; //
x = UCB0RXBUF; // data = 00|DATA
P3OUT |= 0x01; // /CS set
for(i=0;i<20;i++);
}
}
