Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I am developing a data logger based on PIC controller. The PIC has internal RTC but does not have pins for connecting battery so I am using pic's internal RTC to generate interrupt every second and external battery backed RTC to keep exact timing. but the problem is that they both do not get in sync. So after every 5 second when I read time from external RTC it gives value 6 (or) 7. So how should I sync both RTC to get proper value from external RTC? We dont have pin from external RTC connected to MCU so cant get interrupt from external RTC.

share|improve this question
Why is there no interrupt line between the two? – jippie Apr 20 at 11:35
Actually I have no prior requirement of RTC so I haven't added it but now when the requirement is there I dont have free pin on MCU for interrupt. – Jimit Apr 20 at 11:53

2 Answers

actually I have solved the problem. What I have done is that whenever device starts I read date and time from external RTC and update the internal RTC with same so now I have to monitor only internal RTC which keeps all the timing requirement till the device turns off. again when device starts I again read from the external RTC. So this solves the problem of synchronization.

share|improve this answer

Forget the internal RTC. Configure an internal timer for a frequency 10 to 1000 Hz and check the external RTC on timer interrupt. Then only when you read a different external time, do your thing.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.