Hi All,
I have connected external MCU to MSP430F5152 and they are sending data through SPI communication. Currently MSP430F5152 is acting as master and external MCU as slave. Now MSP430 cannot received data from external MCU and when I measured the clock pin (P1.3) there are no clock signal. Does this means MSP430 is not properly setup? Thank you. The code is below:
void config_spi(void)
{
// Configure ports
P1SEL |= (BIT3|BIT4|BIT5); // P1.0,1,2 option select USCI SPI pins
UCB0CTL1 |= UCSWRST; // **Put state machine in reset**
UCB0CTL0 |= UCMST+UCSYNC+UCCKPL+UCMSB; // 3-pin, 8-bit SPI master
UCB0CTL1 |= UCSSEL_2; // SMCLK //
UCB0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
}
int msif_rcv_data(unsigned char *buf, unsigned int len)
{
unsigned int i = 0;
for (i = 0; i < len; i++)
{
buf[i] = UCB0RXBUF;
}
return 0;
}