Part Number: MSP430FR2633
Hi,
I am new to the MSP430FR2633 device. In my application I need two UART so I have choose it.
Right now I have a interface XBee with UCA1 port of UARTs pin and working on 9600 Baud.
The data from XBee to uC on UART receive perfectly. but the data what I wana to send from uC to Xbee is unable to do. Can any one check my code I have a written perfect or not ?
I have also seen on Oscilloscope, in oscilloscope the Tx and Rx data I can see. All Helps are welcome.
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate 1previously configured port settings
P2SEL0 |= BIT6 | BIT5; // set 2-UART pin as second function
// Configure UART
UCA1CTLW0 |= UCSWRST;
UCA1CTLW0 |= UCSSEL__SMCLK; // set ACLK as BRCLK
// Baud Rate calculation. Referred to UG 17.3.10
// (1) N=32768/4800=6.827
// (2) OS16=0, UCBRx=INT(N)=6
// (4) Fractional portion = 0.827. Refered to UG Table 17-4, UCBRSx=0xEE.
UCA1BR0 = 6; // INT(32768/4800)
UCA1BR1 = 0x00;
UCA1MCTLW = 0x2000 | UCOS16 | UCBRF_8;
UCA1CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA1IE |= UCRXIE; // Enable USCI_A0 RX interrupt
//__bis_SR_register(GIE); // Enter LPM3, interrupts enabled
while(1)
{
__bis_SR_register(LPM0_bits | GIE); // Enter LPM3, interrupts enable
}
}
#pragma vector=USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
{
switch(__even_in_range(UCA1IV,USCI_UART_UCTXCPTIFG))
{
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
{
uart_received_frame();
}
//UCA0IE &= ~UCTXIE;
break;
case USCI_UART_UCTXIFG:
{
Trasnmit_Frame();
}
UCA1IE |= UCRXIE;
break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
default: break;
}
}
void Trasnmit_Frame()
{
UCA1TXBUF = Send_Data[Pointer++];
if(Pointer > 18)
{
UCA1IE &= ~UCTXIE;
Pointer = 0;
Reading = 0;
Checksum = 0;
}
}