OpenCores

Project maintainers

Details

Name: rtcclock
Created: May 25, 2015
Updated: Nov 17, 2015
SVN Updated: Oct 17, 2016
SVN: Browse
Latest version: download (might take a bit to start...)
Statistics: View
Bugs: 2 reported / 0 solved
Star15you like it: star it!

Other project properties

Category:Library
Language:Verilog
Development status:Beta
Additional info:Design done, FPGA proven, Specification done
WishBone compliant: Yes
WishBone version: n/a
License: GPL

Description

This core offers a real-time clock capability to a device. Specific capabilities include 24-hour BCD time, a count down timer, a stop watch, an alarm, and an ability to precisely capture the time of an externally generated event. A second core, companion to this one, can be connected to this one to keep track of date as well. Both are cores may be found within this project.

Other outputs include drivers for 16 LED's that will count up to each minute, 32 bits to control four digits of a seven segment display, and an interrupt strobe line which can be used to set off and edge triggered interrupt whenever the countdown timer gets to zero or the alarm goes off.

The core is very versatile, depending internally on incrementing a 48-bit counter with a user controlled increment. This allows the clock to keep track of time no matter what fundamental speed your underlying clock is run at, from 66kHz all the way up to 250 THz.

The entire clock is controlled via 8 registers on a 32-bit wishbone bus, plus another register for the date core. Please see the spec.pdf sheet within the docs/ directory for more information.

20151117 Update: In practice, I am finding that this core needs to be customized for each project I've placed it into. For example, I now have an rtclight capability that offers no LED nor seven segment display capability. I'm using this on a XuLA2-LX25 board that (currently) has logic only. Further, if you fix the high order address bit you can get a less configurable clock which I hope to use on a Digilent Cmod S6 board. Finally, there's the GPS scholed version discussed below.

GPS Schooling

A version of this clock, rtcgps.v, is available that can be 'GPS schooled.' By this, I mean that I have taken the PPS output of the Digilent PmodGPS board, and used it to adjust the speed and phase of the clock (in a separate module). The rtcgps module now accepts the outputs of a GPS time tracking circuit, and locks its subsecond resolution to it. Fully utilizing this capability requires this tracking module (not included here), a UART processing module, and a bit of code to both update the clock to the correct time as well as to keep the time there.

Now all I need is a very accurate time piece which I can use to determine how accurate my time circuit is. Any volunteers?