Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: getting problem in implementing uart communication using msp430f5529.

$
0
0
yes m trying to see the output on pc hyperterminal and also on putty but there is no luck. here is my code #include int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT P4SEL = BIT4+BIT5; // P4.4,5 = USCI_A1 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 } // Echo back RXed character, confirm TX buffer is ready first #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=USCI_A0_VECTOR __interrupt void USCI_A0_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void) #else #error Compiler not supported! #endif { switch(__even_in_range(UCA0IV,4)) { case 0:break; // Vector 0 - no interrupt case 2: // Vector 2 - RXIFG while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready? UCA0TXBUF = UCA0RXBUF; // TX -> RXed character break; case 4:break; // Vector 4 - TXIFG default: break; } } I'm using backchannel uart connection P4.4 and P4.5(rxd and txd pins)

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>