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

Forum Post: RE: MSP430 UART

$
0
0
thanks for your information sir, in below code, i am unable to send the character '9' continuosly, sometimes random data also coming.... i don't know why?? and tell me how to get two digit and three digit numbers(ex. 78, 256) directly or is there any conversion?? #include void main(void) { WDTCTL = WDTPW + WDTHOLD; P5SEL |= BIT6 + BIT7; // TXD AND RXD P5DIR |= BIT6 + BIT7; P1DIR |= BIT0; P1OUT &= ~0x00; UCA1CTL1 |= UCSWRST; // ENABLE RESET UCA1CTL1 |= UCSSEL_2; // CLOCK SELECTION SMCLK UCA1BR0 = 109; // 1MHZ = 115200 UCA1BR1 = 0; // 1MHZ = 115200 UCA1MCTL |= UCBRS_2 + UCBRF_0; UCA1CTL1 &= ~UCSWRST; // RELEASE RESET UCA1IE = UCTXIE; __bis_SR_register(LPM0_bits + GIE); // Enter LPM4, Enable interrupts } #pragma vector=USCI_A1_VECTOR __interrupt void USCI_A1_ISR(void) { P1OUT ^= BIT0; // while(!(UCA1IFG&UCTXIFG)) UCA1TXBUF = '9'; // TX -> RXed character } thank you...

Viewing all articles
Browse latest Browse all 62309

Trending Articles



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