Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

An accurate seconds counter in VHDL

Status
Not open for further replies.

omerysmi

Member level 5
Joined
Oct 10, 2014
Messages
91
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
1,128
Hi,
I want to make a counter which counts seconds in VHDL, so first of all i make 1 Hz clock by clock divider, and then I count the clocks of the 1Hz signal.
The problem is that the 1Hz clock is not so accurate and I need it to be very accurate..

Do you have some advices for making an accurate seconds counter?

**By the way, I use altera DE1 with 50Mhz main clock.
 

Use 2 counters (not 2 clocks).
One fast and one slow.
The fast counter increments with every tick of the 50MHz clock.
Every time it reaches 50,000,000 - it becomes 0 and the slow counter is incremented +1.

The accuracy of your system will always depend on the accuracy of the system clock - there's no avoiding that.
But what accuracy are you looking for? A 300ppm (not too accurate) 50MHz Abracon oscillator will still outperform your average Rolex...
 

The accuracy of your system will always depend on the accuracy of the system clock - there's no avoiding that.
But what accuracy are you looking for? A 300ppm (not too accurate) 50MHz Abracon oscillator will still outperform your average Rolex...
Unless I'm off with my calculation +/-300 ppm would result in about 2.6 hours off target for an entire year. Seems to me your average Rolex does better than that.

50MHz +/- 15000Hz (50E6 * 300/1E6)

so 1 sec would result in a range of 0.999700089975 to 1.00030009002, as there are 31536000 seconds in a year (365 days) the error is -9463.6389s to 9457.9625s or approximately +/- 2.6 hours per year.
 

Even at 5 seconds per month the Rolex will only gain/lose ~30 min per year unlike the 300 ppm oscillator design. You would need to use a 50 ppm oscillator to exceed the capabilities of the typical Rolex.
 

how much do you want to pay for your accuracy?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top