Other Parts Discussed in Thread: MSP430FR2475
Tool/software: Code Composer Studio
Dear Sir,
Part No : MSP430F67791A. We designed our own board for your reference circuit and also added a uart to the usb interface circuit (this circuit is working well). We are testing your uart example code(msp430f677xa_uscia0_uart_03.c). It doesn't transmit and receive data. but debug mode only one character is send in one time, then stopped this line(while (!(UCA0IFG & UCTXIFG)); but sd24 adc code is working well. here attached code and debug result. kindly reply soon. Thank you.
#include <msp430.h>
void UART_init()
{
// Setup P3.0 UCA0RXD, P3.1 UCA0TXD
P3SEL0 |= BIT0 | BIT1; // Set P3.0, P3.1 to non-IO
P3DIR |= BIT0 | BIT1; // Enable UCA0RXD, UCA0TXD
// Setup LFXT1
UCSCTL6 &= ~(XT1OFF); // XT1 On
UCSCTL6 |= XCAP_3; // Internal load cap
// Loop until XT1 fault flag is cleared
do
{
UCSCTL7 &= ~(XT2OFFG | XT1LFOFFG | DCOFFG);
// Clear XT2,XT1,DCO fault flags
SFRIFG1 &= ~OFIFG; // Clear fault flags
} while (SFRIFG1 & OFIFG); // Test oscillator fault flag
// Setup eUSCI_A0
UCA0CTLW0 |= UCSWRST; // **Put state machine in reset**
UCA0CTLW0 |= UCSSEL_1; // CLK = ACLK
UCA0BRW_L = 0x03; // 32kHz/9600=3.41 (see User's Guide)
UCA0BRW_H = 0x00; //
UCA0MCTLW = 0x5300; // Modulation UCBRSx=0x53, UCBRFx=0
UCA0CTLW0 &= ~UCSWRST; // **Initialize USCI state machine**
// UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
// __bis_SR_register(LPM3_bits | GIE); // Enter LPM3, interrupts enabled
// __no_operation();
}
void UART_Tx(unsigned char a)
{
while (!(UCA0IFG & UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = a;
}
void UART_Str(unsigned char *a)
{
while(*a!='\0')
{
UART_Tx(*a); a++;
}
}
void main(void)
{
int i=0;
WDTCTL = WDTPW | WDTHOLD; // Stop WDT
UART_init();
while(1)
{
UART_Str("ABCD");
}
}


