Digital Clock with only PIC16F628A

Embedded Systems Topics
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Digital Clock with only PIC16F628A

Post by Neo » Mon Mar 18, 2013 5:42 pm

Tip: There are two common ways to maintain accurate timing at the moment.
GPRS chip <-> Time Server
GPS chip <-> GPS Time

Both Time server and GPS time are known to be very accurate. So the usual scenario is, use an RTC synchronized with one of the two above methods.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Digital Clock with only PIC16F628A

Post by Rksk » Tue Mar 19, 2013 12:02 am

SemiconductorCat wrote:May be this would be your next hobby project to decode that signal and extract clock info from it.
Yes, it may be. Thanks for this info.


SemiconductorCat wrote: I think they have special 10PPM crystals. But even it will leap around 5 minutes per
a one year.A normal crystal is around 20PPM in the market. So nothing much difference in high cost crystals
as I think.
I used a normal crystal for this and I saw around 3-5 minutes leap per a day.
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Digital Clock with only PIC16F628A

Post by SemiconductorCat » Sun Mar 24, 2013 11:46 am

Rksk wrote:
SemiconductorCat wrote: I think they have special 10PPM crystals. But even it will leap around 5 minutes per
a one year.A normal crystal is around 20PPM in the market. So nothing much difference in high cost crystals
as I think.
I used a normal crystal for this and I saw around 3-5 minutes leap per a day.


This is completely an anomaly. I could not guess why this is happening?
It's 48hrs gone by now. You could ask this why happening this your schematic diagram submitted at
http://electronics.stackexchange.com/

There could be many reasons for this. but 5 minutes per a day is something abnormal.
I could not think why that is happening.

--Thank You--
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Digital Clock with only PIC16F628A

Post by Neo » Mon Mar 25, 2013 1:32 pm

A suggestion for improvement for Rksk.

Remove all codes from interrupt (EEPROM write and calculations) and make it only for counting seconds based on the TIMER.

Within the main(), do everything else. So your clock will become accurate than this. At the moment, calculations, if-else conditions, EEPROM writes are disturbing the interrupt. Let's see how it goes.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Digital Clock with only PIC16F628A

Post by Rksk » Thu Mar 28, 2013 12:50 am

I used this code in another project with 16f877. There was nearly just 1.5seconds leap per hour.

5-6min leap per day may be a mistake.

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Digital Clock with only PIC16F628A

Post by Neo » Thu Mar 28, 2013 6:47 am

Still Rksk, it would be advantageous to keep the interrupt only with counter and move the rest to main(). In embedded programming, there is a theory to keep the interrupts as clean as possible so they are serviced quickly.
Post Reply

Return to “Embedded Systems”