Other Parts Discussed in Thread: MSP430G2553,
Hello,
I am trying to implement SPI communication using MSP430FR2155 microcontroller by setting the SPI frequency to 8MHz. But I am not able implement it. I have found some SPI code related to MSP430G2553 microcontroller and that code working fine on MSP430G2XL.
But I want implement that on MSP430FR2155. I have tried the same code by changing the SPI pin declarations and some registers but its now working.
Can anyone tell how different MSP430G2553 AND MSP430FR2155 register coding.
This is the working code of MSP430G2553. Kindly tell me what changes need to be done for working on MSP430FR2155.
#include <msp430.h>
unsigned char MST_Data,;
int main(void)
{
volatile unsigned int i;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1OUT = 0x00; // P1 setup for LED & reset output
P1DIR |= BIT0 + BIT5; //
P1SEL = BIT1 + BIT2 + BIT4;
P1SEL2 = BIT1 + BIT2 + BIT4;
UCA0CTL0 |= UCCKPL + UCMSB + UCMST + UCSYNC; // 3-pin, 8-bit SPI master
UCA0CTL1 |= UCSSEL_2;
UCA0BR0 |= 0x02; // /2
UCA0BR1 = 0; //
UCA0MCTL = 0; // No modulation
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
P1OUT &= ~BIT5; // Now with SPI signals initialized,
P1OUT |= BIT5; // reset slave
__delay_cycles(75); // Wait for slave to initialize
MST_Data = 0xAA; // Initialize data values
while(1)
{
UCA0TXBUF = MST_Data; // Transmit first character
__delay_cycles(50000);
}
}