Changes

Real Time Clock

1,842 bytes added, 21:50, 3 January 2010
/* Technical specs */
== Technical specs ==
Based aroundUses a RTC-58321 chip (with 4bit databus and built-in 32.786kHz oscillator), four 74LSxx chips, and a rechargeable battery. Port addresses are jumper-selectable (the defaults, used in the included example program, are FBE2h/FBE3h): SUWA FBE2h FBE6h FBEAh FBEEh FBF2h FBF6h FBFAh FBFEh - RTC-58321Index (W) FBE3h FBE7h FBEBh FBEFh FBF3h FBF7h FBFBh FBFFh - RTC-58321 Data (R/W)Ports All registers are 4bit wide (Bit0-3 used, Bit4-7=don't care/garbage): FBxx 0 S1 Seconds units (0..9) 1 S10 Seconds tens (0..5) (bit3=unused) 2 MI1 Minutes units (0..9) 3 MI10 Minutes tens (0..5) (bit3=unused) 4 H1 Hours units (0..9) 5 H10 Hours tens (0..1 or 0..2) (bit2=PM, on bit3=24-hour) 6 W Day-of-week (0..6) (bit3=unused) (Epson datasheet: 0=Sunday) 7 D1 Day units (0..9) 8 D10 Day tens (0..3) (bit2-3=Leap year offset, usually zero) 9 MO1 Month units (0..9) A MO10 Month tens (0..1) (bit1-3=unused) B Y1 Year units (0..9) C Y10 Year tens (0..9) D RES Reset register (strobe) (bit0-3=unused) E REF Reference signal (bit0=1024Hz, bit1=1sec, bit2=1min, bit3=1hour) F REF Reference signal (bit0=1024Hz, bit1=1sec, bit2=1min, bit3=1hour)In 24hour mode: range is 00:00 to 23:59 and the device there PM flag is always zero. In 12hour mode: range is 12:00 AM to 11:59 PM. Day and month start counting with one (ie. 01..31 and 01..12). Day-of-Week is a jumper that determines general purpose 7-day counter (the value Epson datasheet suggests 0=Sunday, the CPC magazine suggests 0=Monday). Leap years are generated when "((Year + LeapYearOffset) MOD 4)=0", which can be matched to different calendars: 1926..1989 Showa 1..64 (reign of xxjapanese emperor Hirohito) 1989..today Heisei 1..today (reign of japanese emperor Akihito)Ie. for Gregorian and Heisei calendars set LeapYearOffset=0, for Showa calendar set LeapYearOffset=1 (as suggested in the CPC magazine).
== Commercial versions ==
6,388
edits