Time measuring with 16f877

Status
Not open for further replies.

PIC2PIC

New Member
Hi

I made a device that counts the time, something like a clock. And I use Watch Dog Timer to count seconds.But the problem is accuracy, i.e. for every minute my clock is fast about 1 second.

I use PIC 16f877.

So I have 2 questions:

1. Is there a better and more accurate way to count seconds or smaler fractions of seconds then to use WDT
2. In assembly code I try to improve accuracy in every minute by substracting one second after every 61
"Seconds" ,but strange thing happen. I regulate memory bank for each register, but in a
dissassembly listing in MPLAB is shown that the address of the memory register that I use is some other bank
diferent then I set, and that means some other memory register, and I can't do nothing to change that .
What could be reason for this?
 
hi,
Use Timer1 for your 'timed' interrupt, not the WD timer.

Whats the crystal frequency.?
 
1. Is there a better and more accurate way to count seconds or smaler fractions of seconds then to use WDT

There's no worse way - it will make an absolutely terrible clock, and isn't intended to be used in that way - the clue is in it's name.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…