This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello,
My Application require a datalogger with time-stamp.I wanted to use the chip : MSP430F6779A and it's on chip RTC_C module in calender mode for the time -stamp part.
I am following the App Notes "Implementation of a Three-Phase Electronic Watt-Hour Meter Using the MSP430F677x(A)" SLAA577F and it's associated code library.
And connected a external 3.3V Battery on AUXVCC3 pin of the chip and also connected a 0.47uF capacitor as suggested in datasheet.32.768kHz crystal on xt1.
Form the ref. TI code library , i have seen that , on power up initialization it doesn't update "rtc" variables from the RTC h/w registers e.g RTCSEC , RTCMIN etc. on power-up ( don't know why it's skipped ?)
In my implementation i have modified (the referred library code) for the power up intialization for RTC. rest of the files are same.
Here i would prefer to read RTC h/w register and then update internal rtc variables.In library they are not doing this may be rtc variables are mapped to INFO memory.
RTCCTL0_H = RTCKEY_H; // Unlock RTC
rtc.second =RTCSEC;
rtc.minute =RTCMIN;
rtc.hour=RTCHOUR;
rtc.day=RTCDAY;
rtc.month=RTCMON;
rtc.year = RTCYEAR - 0x2000;
RTCCTL13 &= ~RTCHOLD; // Enable RTC
RTCCTL13 = RTCBCD+RTCMODE+RTCTEV_0; // Init RTC
RTCCTL0_H = 0; // LOCK RTC
in the main loop i would read and display rtc.sec , rtc.min , rtc.hour variables as they are updating as part of RTC_C 1 sec interrupt.Once i set a correct time and date , rtc structure variable would display the correct date & time.
But when i switch off the device ( assumed that 3.3V external battery would supply the crystal and RTC_C module) and switch on , say, after 3 minutes or so , i found that displayed time and date is exactly what i have seen at the time of switch off the device.My understanding is that BAT would backup the RTC_C module and internally RTCSEC,RTCHOUR, etc registers would be counting & so i have read those registers on power up. Even i have checked the AUXVCC3 voltage on the MCU pin to be 3.3V.
One point to mention that , I didn't set RTCDOW register. is that be a reason that RTC h/w registers were not updated during AUXVCC3 battery powered. I don't require any LPM mode also.
plz suggest where i have gone wrong and possible causes.
Appreciate your valuable response.
Regards,
Ars
Hi Michael,
Thanks for this information & for your support.
I was about to bring out this fact. I have already referred those App Notes and accordingly used RTCLOCK bit.I have set the RTCLOCK bit in the RTC_C initialization routine and as well as in the routine where user was setting RTC value from a GUI / Display.This bit helped me in solving the issue in only "MSP430F6779A"device as this bit is only available for this device ( luckily i had a sample of this "A" device).
"Non-A" device i.e MSP430F6779 has this "bit" Reserved and we can't access it.. So problem remains same with that device. I could able to solve the issue in MSP430F6779A only.
Does TI has any solution for MSP430F6779. ? or that I have to shift MSP430F6779A device to use the RTC_C ...
I too agree with you that RTCHOLD might have been set while power off ....so not counting up the the registers while power off mode ( but AUXVCC3 battery backup)... But then what is the solution?
1. Does this "Non-A" device has a bug for RTC_C module ?
2. TI should highlight the necessity of "RTCLOCK" bit with supported example code for MSP430F677x A device. My MSP430F677x A RTC code is not fully functional without this bit.
Again , Thank you very much and looking for a solution for MSP430F6779 ( without 'A') device , if any.
Regards,
ars...
Michael,
Thanks for your support on rtc issue.
But the thread , you mentioned , is not similar to my case on RTC_C not working, for the simple reason that I don't find any difficulty in running & getting into RTC 1 sec ISR routine nor do i face oscillator fault. As you can see from my previous posts , RTC_C on my device( MSP430F6779) just functions okay when DVCC or mains supply is available.But after a power cycle ( i kept the device off for 5 minutes then switched on ) i found that RTC didn't updated from it's last counted value( at the time of powering off) . That means it retains the value because of AUXVCC3 ( a battery connected in my case ) .so i am suspecting that during powering off , somehow RTCHOLD bit might have set to 1.I am using IAR c compiler.I even tried to reset RTCHOLD bit to zero in low_level_init() function.but no success.
Can you list what would be the probable reason that RTCHOLD bit set (let's say) while power off.
Plz check internally with your TI team, really RTC_C is functional in all respect on this "non-A" version of this chip.My experiment with the device says "NO".Correct me if i have missed out any steps in my experiment or suggest any work around.I don't even find any errata on this.Parallely I am building my application based on "A" device. i.e MSP430F6779A.Ofcourse RTC_C is functional in this chip with the help of RTCLOCK bit.
Regards,
Ars
Hi Ars,
i am getting the same problem as the rtc_c module is not getting updated after power off but i am using msp430f6779a as per this thread u had solve the issue for map430f6779a, so can u plzz send me the code snippet or tell me how to do it... i need urgent help i m on a project...
#if defined(RTC_SUPPORT)
if (!check_rtc_sumcheck())
{
rtc.year = 0x11;
rtc.month = 0x03;
rtc.day = 0x1C;
rtc.hour = 0x02;
rtc.minute = 0x03;
rtc.second = 0x04;
set_rtc_sumcheck();
#if defined(__MSP430_HAS_RTC_C__) || defined(__MSP430_HAS_RTC_CE__)
RTCCTL0_H = RTCKEY_H; // Unlock RTC
if (RTCCTL0 & RTCOFIFG){ // init if RTCOFIFG is set
RTCCTL13 = RTCBCD+RTCHOLD+RTCMODE+RTCTEV_0; // Init RTC
RTCCTL0_L &= ~RTCOFIFG_L; //RTCCTL0_L &= ~RTCOFIFG_L; // Clear Flag
RTCSEC = rtc.second;
RTCMIN = rtc.minute; //rtc.minute = RTCMIN;
RTCHOUR = rtc.hour; //rtc.hour = RTCHOUR;
// RTCDOW = rtc.DayOfWeek;
RTCDAY = rtc.day;
RTCMON = rtc.month;
RTCYEAR = rtc.year + 0x2000;
RTCCTL13 &= ~RTCHOLD; // Enable RTC
}
else
{
RTCCTL13 = RTCBCD+RTCMODE+RTCTEV_0; // Init RTC
}
RTCCTL0_H = 0; // LOCK RTC
#endif
}
#endif
plzz kindly help me ,,,,,,,,
thanxx..
regards,
sumit,,,,,
**Attention** This is a public forum