Hi, I am having problem in receiving any char using the following code on MSP430-449STK2 board from OLIMEX.
This code is as it is taken from example "fet440_usart01_19200" given with IAR.
I have been struggling with this since ages.... :-(
Any help in this matter willbe appreciated.
Regards,
-mkh
#include
void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT FLL_CTL0 |= XCAP14PF; // Configure load caps UTCTL0 = SSEL1; // UCLK = SMCLK UBR00 = 0x36; // 1MHz 19200 UBR10 = 0x00; // 1MHz 19200 UMCTL0 = 0x00; // no modulation UCTL0 = CHAR; // 8-bit character *SWRST* ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD IE1 |= URXIE0; // Enable USART0 RX interrupt P2SEL |= 0x30; // P2.4,5 = USART0 TXD/RXD P2DIR |= 0x10; // P2.4 output direction _EINT(); // Enable interrupts
for (;;) // { _BIS_SR(CPUOFF); // Enter LPM0 _NOP(); // Required only for C-spy } }
interrupt[UART0RX_VECTOR] void usart0_rx (void) { while ((IFG1 & UTXIFG0) == 0); // USART0 TX buffer ready? TXBUF0 = RXBUF0; // RXBUF0 to TXBUF0 }