#include "msp430x26x.h"
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
if (CALBC1_1MHZ ==0xFF || CALDCO_1MHZ == 0xFF)
{
while(1); // If calibration constants erased
// do not load, trap CPU!!
}
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
UCA1CTL1|= UCSWRST; // **Initialize USCI state machine**
UCA1CTL0 &= ~UCSYNC; //UART mode selected
P3SEL = 0xC0; // P3.6,7 = USCI_A1 TXD/RXD
UCA1CTL1 |= UCSSEL_2; // CLK = SMCLK
UCA1BR0 = 0x6D; // 9600 (see User's Guide)
UCA1BR1 = 0x00; //
UCA1MCTL = 0x04; // Modulation UCBRSx = 3
UCA1CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UC1IE |= UCA1RXIE; // Enable USCI_A1 RX interrupt
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
}
// Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCIAB1RX_VECTOR
__interrupt void USCI1RX_ISR(void)
{
while (!(UC1IFG&UCA1TXIFG)); // USCI_A1 TX buffer ready?
UCA1TXBUF = UCA1RXBUF; // TX -> RXed character
}
the code is written for USCI UART A1 module that receives and loops back the received data.it is configured on 9600 baudrate
the problem is that the UART is not receiving any byte of data passed using hyperterminal and hence not no interrupt is raised.
USCI_A0 module is working but when configured for USCI_A1 it is not working.
Please tell me why?