Hi,
We have this development board.
We want to use MSP430F2410 chip. Initially we had MSO430F2619 chip on this board and the following code which just echoes character on to UART port works with MSP430F2619chip. When we replace the chip with MSP430F2410, the receive does not work. Transmit works, because we do see that first message – “Welcome “ . Any ideas?
Thanks
#include <msp430.h>
void print_line(char *buf, unsigned int len)
{
unsigned int i =0;
while (i<len){
UCA1TXBUF = buf[i];
while (UCA1STAT&UCBUSY );
i++;
}
UCA1TXBUF = 0x0a;
while (UCA1STAT&UCBUSY );
UCA1TXBUF = 0x0d;
while (UCA1STAT&UCBUSY );
}
char wel[] = “Welcome to UART”;
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
P3SEL = BIT6 | BIT7; //Set P3.6 as UART 1 TXD and P3.7 as UART 1 RXD
UCA1CTL1 |= UCSWRST; //put the state machine in RESET
UCA1CTL0 = 0; //select UART MODE NO PARITY 8 bits Asynchronous
//MCLK
UCA1CTL1 |= UCSSEL_2; //choose 1MHz SCLK
//Baud rate 9600 settings
UCA1BR0 = 104; //settings for 19200 baud
UCA1BR1 = 0;
UCA1MCTL = 2;
UCA1CTL1 &= ~UCSWRST; //put UART in operation mode
UC1IE |= UCA1RXIE; // Enable USCI_A1 RX interrupt
print_line(wel,10);
__bis_SR_register( GIE); // interrupts enabled
}
// Echo back RXed character, confirm TX buffer is ready first
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCIAB1RX_VECTOR
__interrupt void USCI1RX_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCIAB1RX_VECTOR))) USCI1RX_ISR (void)
#else
#error Compiler not supported!
#endif
{
while (!(UC1IFG&UCA1TXIFG)); // USCI_A1 TX buffer ready?
UCA1TXBUF = UCA1RXBUF; // TX -> RXed character
}