Minimig RTC

Real time clock that keeps the time over power cycling. Advantages:
 * Disc files get correct date
 * Any software dependent on date will work correctly (astronomy/satellite?)

Commodore: A501 Rev5, 512k + RTC
 * RAM organised as 16 x (Sanyo LM33256G-12 DIP16) 1 x 256kbit Dynamic RAM
 * RTC 5 Volt "OKI M6242B" U9 DIP18 clocked with a 32768 Hz crystal, backed up by a 3,6V NiCd battery


 * M6242B datasheet


 * Register table:
 * {| class="wikitable"

! rowspan=2 colspan=1 align="center" | Address Input ! rowspan=2 colspan=1 align="center" | Register name ! rowspan=1 colspan=4 align="center" | Data ! rowspan=2 colspan=1 align="center" | Count value ! rowspan=2 colspan=1 align="center" | Description !        D3  !! D2   !! D1  !! D0
 * align="center"| 0 || S1  || S8  || S4    || S2   || S1   || 0-9 ||  1-second digit register
 * align="center"|1 || S10 || *   || S40   || S20  || S10  || 0-5 || 10-second digit register
 * align="center"|2 || MI1 || mi8 || mi4   || mi2  || mi1  || 0-9 ||  1-minute digit register
 * align="center"| 3 || MI10 || *  || mi40  || mi20 || mi10 || 0-5 || 10-minute digit register
 * align="center"| 4 || H1  || h8  || h4    || h2   || h1   || 0-9 ||  1-hour digit register
 * align="center"| 5 || H10 || *   || PM/AM || h20  || h10  || 0-2 or 0-1 || PM/AM 10-hour digit register
 * align="center"| 6 || D1  || d8  || d4    || d2   || d1   || 0-9 ||  1-day digit register
 * align="center"| 7 || D10 || *   || *     || d20  || d10  || 0-3 || 10-day digit register
 * align="center"| 8 || MO1 || mo8 || mo4   || mo2  || mo1  || 0-9 ||  1-month digit register
 * align="center"| 9 || MO10 || *  || *     || *    || MO10 || 0-1 || 10-month digit register
 * align="center"| A || Y1  || y8  || y4    || y2   || y1   || 0-9 ||  1-year digit register
 * align="center"| B || Y10 || y80 || y40   || y20  || y10  || 0-9 || 10-year digit register
 * align="center"| C || W   || *   || w4    || w2   || w1   || 0-6 || Week register (0=Sunday)
 * align="center"| D || CD  ||  30 sec. ADJ || IRQ FLAG || BUSY || HOLD || -   || Control Register D
 * align="center"| E || CE  || t1  || t0    || ITRPT /STND || MASK || -   || Control Register E
 * align="center"| F || CF  || TEST|| 24/12 || STOP || REST || -   || Control Register F
 * }
 * REST = RESET
 * ITRPT/STND = INTERRUPT/STANDARD
 * Note 1) Bit * does not exist (unrecognized during a write and held at "0" during a read).
 * Note 2) Be sure to mask the AM/PM bit when processing 10's of hour's data.
 * Note 3) BUSY bit is read only. The IRQ FLAG bit can only be set to a "0". Setting the IRQ FLAG to a "1" is done by hardware.
 * Note 4) PM at 1 and AM at 0 for PM / AM bit.
 * align="center"| B || Y10 || y80 || y40   || y20  || y10  || 0-9 || 10-year digit register
 * align="center"| C || W   || *   || w4    || w2   || w1   || 0-6 || Week register (0=Sunday)
 * align="center"| D || CD  ||  30 sec. ADJ || IRQ FLAG || BUSY || HOLD || -   || Control Register D
 * align="center"| E || CE  || t1  || t0    || ITRPT /STND || MASK || -   || Control Register E
 * align="center"| F || CF  || TEST|| 24/12 || STOP || REST || -   || Control Register F
 * }
 * REST = RESET
 * ITRPT/STND = INTERRUPT/STANDARD
 * Note 1) Bit * does not exist (unrecognized during a write and held at "0" during a read).
 * Note 2) Be sure to mask the AM/PM bit when processing 10's of hour's data.
 * Note 3) BUSY bit is read only. The IRQ FLAG bit can only be set to a "0". Setting the IRQ FLAG to a "1" is done by hardware.
 * Note 4) PM at 1 and AM at 0 for PM / AM bit.
 * Note 1)</B> Bit * does not exist (unrecognized during a write and held at "0" during a read).
 * Note 2)</B> Be sure to mask the AM/PM bit when processing 10's of hour's data.
 * Note 3)</B> BUSY bit is read only. The IRQ FLAG bit can only be set to a "0". Setting the IRQ FLAG to a "1" is done by hardware.
 * Note 4)</B> PM at 1 and AM at 0 for PM / AM bit.
 * Note 4)</B> PM at 1 and AM at 0 for PM / AM bit.

Micronik: Realtime Clock for Clockport, RTC

Pin maps:
 * MCU pins
 * FPGA pins