Tool/software: Code Composer Studio
Hello,
I am receiving 3 messages from UART and loading the value into RTCMOD. But I am unable to receive them. I am getting same message for all the 3 as the first message. I have attached the UART interrupt below.
Regards,
Prudhvi Sagar
//******************************************************************************
// UART Interrupt ***********************************************************
//******************************************************************************
//Turn OFF UART everytime.....
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
switch(__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG))
{
case USCI_NONE: break;
case USCI_UART_UCRXIFG:
while(!(UCA0IFG&UCTXIFG));
if(RX_count == 0)
{
RX_temp = UCA0RXBUF;
RX_temp = (RX_temp << 8);
RX_count++; //Count = 1
}
if(RX_count == 1)
{
RX_temp |= UCA0RXBUF;
RTCMOD = RX_temp;
RX_count++; //Count = 2
}
if(RX_count == 2)
{
increment = UCA0RXBUF;
RX_count++; //Count = 3
}
//Implement for increment
if(RX_count >= 3) // check for all byte RX
{
RX_count = 0;
RTCCTL = RTCSS__XT1CLK | RTCSR | RTCPS__1024 | RTCIE; // Start RTC
__bis_SR_register_on_exit(LPM3_bits | GIE);
__no_operation();
}
break;
case USCI_UART_UCTXIFG: break;
case USCI_UART_UCSTTIFG: break;
case USCI_UART_UCTXCPTIFG: break;
}
}