Launch pad: Uart: MSP controller: terminal: problem in working

Status
Not open for further replies.

karthiprime

Member level 2
Joined
Mar 19, 2012
Messages
42
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,526
Hi,

I am working with Launch pad: MSPG2553 controller and CCS.

I wrote the following program: UART: to send a character and just reply it back.

Code:
/*
 * main.c
 */
#include  "msp430g2553.h"

void main(void)
{
	WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
	BCSCTL1 = CALBC1_1MHZ;                    // Set DCO
	DCOCTL = CALDCO_1MHZ;
	P1SEL = BIT1 + BIT2 ;                     // P1.1 = RXD, P1.2=TXD
	P1SEL2 = BIT1 + BIT2 ;                    // P1.1 = RXD, P1.2=TXD
	UCA0CTL0=0;
	UCA0CTL1 |= UCSSEL_2;                     // SMCLK
	UCA0BR0 = 104;                            // 1MHz 9600
	UCA0BR1 = 0;                              // 1MHz 9600
	UCA0MCTL = UCBRS0;                        // Modulation UCBRSx = 1
	UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**

	IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
	 __bis_SR_register(LPM0_bits + GIE);      // Enter LPM0, interrupts enabled
	while (1);
}

// Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
	while (!(IFG2 & UCA0TXIFG));              // USCI_A0 TX buffer ready?
	UCA0TXBUF = UCA0RXBUF;                    // TX -> RXed character
}

I used the hyperterminal(tera term) and configured it.

Q: The character is not displaying in the terminal when i type.

I guess i made my question clear. I like to know where i lag.

Thanks
 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…