Other Parts Discussed in Thread: MSP430F5529
Hi all,
I am working on a project in which i am using the MSP430f5529 Launchpad. I am trying to send some data through the UART of the MSP to a XBEE. The data is then transmitted to another XBEE which is connected to a pc. When i try to view the data in the pc by using hyperterminal, some garbage values(different kinds of symbols) keeps coming. The following is the code in the microcontroller.
#include <msp430f5529.h>
/*
* main.c
*/
int main(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
// DC0CTL = 0;
// BCSCTL1 = CALBC_1MHZ;
// DC0CTL = CALDCO_1MHZ;
// UCSCTL1 |=
P3SEL |= BIT3 + BIT4; // P3.3,4 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // Reset the state machine
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0CTL0 &= ~UCPEN + ~UCMSB + ~UC7BIT + ~UCSPB; // Disable parity, SET LSB first, Set8 data bits, Set 1 Stop bit
UCA0BR0 = 109; // 1.048MHz/9600
UCA0BR1 = 0; //
UCA0MCTL &= ~UCOS16;
UCA0MCTL |= UCBRS_2 + UCBRF_0; // Modulation UCBRSx=2, UCBRFx=0
//UCA0STAT |= UCLISTEN;
UCA0CTL1 &= ~UCSWRST; // Initialize the state machine
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
while (!(UCA0IFG&UCTXIFG)); // Is the USCI_A0 TX buffer ready?
UCA0TXBUF = 0x41; // TX -> A
//while (!(UCA0IFG&UCTXIFG));
//UCA0TXBUF = 0x42; // TX -> B
//while (!(UCA0IFG&UCTXIFG));
//UCA0TXBUF = 0x43; // TX -> C
__bis_SR_register(GIE); //interrupts enabled
//__no_operation();
return 0;
}
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
{
//Insert Code for the RX interrupt
// int received = UCA0RXBUF;
}
Both the Xbee's have been configured and are working properly. The completion of my project depends on this so any kind
of help will be greatly appreciated.
~Ram