Other Parts Discussed in Thread: MSP-EXP430F5529LP
Hello everyone,
I tried to interface Uart with msp430f5529, but I have not got any output in the serial monitor.I have pasted my code below .Kindly look into this problem.
#include <msp430.h>
void uart_string(char *p);
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3SEL = BIT4+BIT3; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 6; // 1MHz 9600 (see User's Guide)
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS_0 ;
// over sampling
UCA0CTL1 &=~UCSWRST; // **Initialize USCI state machine**
uart_string("Edgate Technologies India");
}
void uart_string(char *p)
{
while(*p)
{
UCA0TXBUF=*p;
while(UCA0STAT&UCBUSY);
p++;
}
}
#include <msp430.h>void uart_string(char *p);int main(void){ WDTCTL = WDTPW + WDTHOLD; // Stop WDT P4SEL = BIT4+BIT5; // P3.4,5 = USCI_A0 TXD/RXD UCA0CTL1 |= UCSWRST; // **Put state machine in reset** UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 = 6; // 1MHz 9600 (see User's Guide) UCA0BR1 = 0; // 1MHz 9600 UCA0MCTL = UCBRS_0 ;//+ UCBRF_13 + UCOS16; // Modln UCBRSx=0, UCBRFx=0, // over sampling UCA0CTL1 &=~UCSWRST; // **Initialize USCI state machine** // UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
// __bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled// __no_operation(); // For debugger uart_string("Edgate Technologies India");}
void uart_string(char *p) {
while(*p) { UCA0TXBUF=*p; while(UCA0STAT&UCBUSY);
p++;
}
}