Changes

Real Time Clock

2,458 bytes added, 21:00, 19 December 2010
This Real Time Clock addon was published as a DIY project in a special edition of the the Germanmagazine: [[CPC Schneider InternationalSonderheft]](Sonderheft, issue #3-1986).
Like most other homecomputers of the era, the Amstrad CPC did not include a Real Time Clock. This project overcomes this limitation.
== 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 the device there is a jumper that determines the value bit3=24-hour) 6 W Day-of xx-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= Commercial versions 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)At least two companies In 24hour mode: range is 00:00 to 23:59 and the 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 general purpose 7-day counter (the Epson datasheet suggests 0=Sunday, the CPC magazine suggests 0=Monday). Leap years are known generated when "((Year + LeapYearOffset) MOD 4)=0", which can be matched to have produced their own Real Time Clock solutionsdifferent calendars: 1926..1989 Showa 1..64 (reign of japanese emperor Hirohito)[[Dobbertin Real Time Clock]] 1989..today Heisei 1..today (reign of japanese emperor Akihito) [[Dk'tronics Real Time Clock]]Ie. for Gregorian and Heisei calendars set LeapYearOffset=0, for Showa calendar set LeapYearOffset=1 (as described in the CPC magazine). Anyways, the article recommends to use Gregorian calendar, ie. using year=86 for 1986, so, if the battery survived, it wrapped to year=00 in year 2000.
== How to build a RTC interface (German) ==
Image:rtc s5.jpg|Page 5
Image:rtc s6.jpg|Page 6
File:NoPicture.gif|Schematic (the picture in the scanned article is too small to see anything)
</gallery>
 
== Datasheets ==
 
* [[Media:RTC-58321-58323 Datasheet.pdf|RTC-58321 Datasheet (Epson)]]
 
== Notes ==
 
Also in 1986, the same magazine released another RTC ([[Schneiderware Real Time Clock]]) as part of the [[Schneiderware]] series (published in the normal issues, not in the special Sonderheft issues). Both solutions used similar but not identical 4bit RTC chips (the chips have different pin-outs, and some of the 4bit registers aren't exactly the same, for example, the leap-year bits are different).
 
[[Category:Peripherals]] [[Category:DIY]]
4,585
edits