bc6526tod - 6526 Compatible Time of Day Core

© 2004 Bird Computer

Overview

bc6256 is a 6526 register compatible time of day core that can easily be integrated into a larger core.  It keeps track of the time in hours / minutes / seconds and 10 ths of seconds.
 

All signals are active high unless otherwise noted.

Download bc6526tod.v

 

Performance values are approximate (Spartan 2e-6):

71MHz / 152 LUTs

bc6526tod

module bc6526tod(rst, clk, ce, rdy, tod, tod_freq, cs, wr, addr, din, dout, alarm, midnight);

 

Signal Description
rst This signal is normally connected to the system reset signal. It resets the clock.

rst is sampled on the positive edge of the clock

clk this is usually connected to the system clock and is used as a base timing clock.
ce This is a system clock enable. Data will be latched into the clock on the rising edge of clk when ce is high. This signal may be tied high in systems where data is transfered from the system in a single clock cycle.
rdy This signal indicates the circuit is ready. It is internally tied to the circuit select signal meaning the circuit is ready as soon as it is connected.
tod This signal connects to a 50 / 60 Hz timing source. The signal may be connected to an asynchronous source as this signal is internally synchronized before being used.
tod_freq This signal is indicates the frequency of the clock source (1=50 or 0=60 Hz)
cs circuit select - this is how the core identifies a valid bus transfer to / from this circuit.
wr This signal is used to signify a write operation to the clock.
addr This is a three bit address vector used to address one of eight available clock registers. (Registers are described below).
din This is the eight bit data input bus to the clock core.
dout This is the eight bit data output bus from the clock core.
alarm This signal pulses high for a single clock cycle when the alarm registers match the current time.
midnight This signal pulses high for a single clock cycle at midnight.

Register Description

Reg. No. Function Description
0 10ths of second

read / write - 10ths of second register

bit 3-0 = 10ths of a second in BCD format

1 seconds

read / write - seconds register

bit 6-0 = seconds in BCD format

2 minutes

read / write - minutes register

bit 6-0 = minutes in BCD format

3 hours

read / write - hours register

bit 7 = am / pm indicator

bit 5-0 = hours in BCD format

4 10ths of second

read - 10ths of second register (same as r0)

write - 10ths of second alarm register

bit 3-0 = 10ths of a second in BCD format

5 alarm seconds

read - seconds register (same as r1)

write - seconds alarm register

bit 6-0 = seconds in BCD format

6 alarm minutes

read  - minutes register (same as r2)

write - minutes alarm register

bit 6-0 = minutes in BCD format

7 alarm hours

read - hours register (same as r3)

write - hours alarm register

bit 7 = am / pm indicator

bit 5-0 = hours in BCD format