Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 21927

Configuring the UART(USCI_A0)

$
0
0

Hi

Just would like to make sure that I am setting the MSP4302553 UART to 12 MHZ and 115200 bps. So would you please check this code?

IE2 &= ~(UCA0TXIE | UCA0RXIE | UCB0TXIE | UCB0RXIE); // Disable all USCIx0 TX & RX interrupts
//  UCA0CTL1 = UCSWRST;           // Set UCSWRST (hold USCI in Reset state)
  UCA0CTL1 |= UCSSEL_2;                     // CLK = SMCLK

   //------------ Configuring the UART(USCI_A0) ----------------//
    // 115200 BAUD, CLK=12MHz
    		  UCA0BR0 = 6;
    		  UCA0BR1 = 0;
//    		//*ours: UCBRF = 8, UCBRS = 0, UCOS16 = 1
//    		  // BITS| 7 6 5 4 | 3 2 1  |   0    |
    		  // UCAxMCTL = | UCBRFx  | UCBRSx | UCOS16 |
    		  UCA0MCTL = 0x81; 

    UCA0CTL1 &= ~UCSWRST;             // Clear UCSWRST to enable USCI_A0-UART

  IFG2 |= UCA0TXIFG;            // preset IFG flag always left on

  IE2|=UCA0RXIE;  /


Viewing all articles
Browse latest Browse all 21927

Trending Articles



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