Dear sir,
I am trying with msp4305529 UART program,but i am not getting the output on hyperterminal.Please go throgh the attachment.
thank you
#include "msp430.h"
char data1[]={"lets play \r\n"};
char data2[]={"hello guys how are you \r\n"};
void uart_init( void )
{
P3SEL |= BIT3+BIT4; // P3.3,4 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 9; // 1MHz 115200 (see User's Guide)
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL |= UCBRS_1 + UCBRF_0; // Modulation UCBRSx=1, UCBRFx=0
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
}//Initialize USCI state machine
void uart_send_byte( unsigned char data )
{
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = data;//The transmit data buffer holds the data waiting to be moved into the transmit shift register
}
void main(void)
{
unsigned int i=0,j=0;
WDTCTL = WDTPW + WDTHOLD; // Stop Watchdog timer
uart_init();
while( 1 )
{
for (i=0; i<14; i++)
{
uart_send_byte( data1[i] );
}
for(j=0;j<25;j++)
{
uart_send_byte(data2[j]);
}
__bis_SR_register( LPM3_bits + GIE );
}
}