Hai all
Iam trying to display the RTC value of msp430fr5739 on LCD and UART
Iam using CCS v6. I test RTC and uart but problem is that when reading second and minute the value display as ASCII character. How to convert it to decimel?
Can I directly access RTCSEC reg anywhere?
When I display it on lcd only one decimel place is print example as when we want to print 23 , it print only 2 but the RTC incrimented correctly and minut interrupt works properly.
The main configuration are below
RTCCTL01 |= RTCTEVIE + RTCRDYIE +RTCHOLD+RTCBCD; //register config
//ISR
#pragma vector=RTC_VECTOR
__interrupt void RTC_ISR(void)
{
switch(__even_in_range(RTCIV,16))
{
case RTC_NONE: // No interrupts
break;
case RTC_RTCRDYIFG: // RTCRDYIFG
P1OUT ^= 0x01; // Toggles P1.0 every second
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF =RTCMIN;
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF =RTCSEC;
break;
case RTC_RTCTEVIFG: // RTCEVIFG
__no_operation(); // Interrupts every minute
break;
case RTC_RTCAIFG: // RTCAIFG
break;
case RTC_RT0PSIFG: // RT0PSIFG
break;
case RTC_RT1PSIFG: // RT1PSIFG
break;
case 12: break; // Reserved
case 14: break; // Reserved
case 16: break; // Reserved
default: break;
}
}