Dk'tronics Real Time Clock

From CPCWiki - THE Amstrad CPC encyclopedia!
Revision as of 10:57, 12 January 2010 by Nocash (Talk | contribs) (I/O Ports)

Jump to: navigation, search

Contains a rechargeable battery, five chips, a quartz crystal, a 8bit general-purpose I/O port (9pin DSUB), and a few odds and ends. The RTC chip is a HD146818 (which is also used in IBM PCs).

Info Fragment

Reportedly: DK-Tronics RTC module used a Z80 PIO chip to address the RTC itself as Port A of the PIO, with a 9-pin user i/o port as Port B.

I/O Ports

Contains HD146818P (RTC) and TMPZ84C20P chips.

 FBE0h  Dk'tronics Real Time Clock - probably Z80 PIO Port A Data (RTC Data bus)
 FBE1h  Dk'tronics Real Time Clock - MAYBE    Z80 PIO Port B Data (General Purpose 8bit I/O Port)
 FBE2h  Dk'tronics Real Time Clock - MAYBE    Z80 PIO Port A Control
 FBE3h  Dk'tronics Real Time Clock - probably Z80 PIO Port B Control
 FBE8h  Dk'tronics Real Time Clock - (unknown purpose)

Not sure if above addresses are correct, for example, A0 and A1 may be swapped...?

PIO Port A seems to be the plain RTC Data Bus, there should be also RTC Read and Write signals, which are maybe found in the unknown purpose port?

Software

Included BASIC and CP/M+ drivers:

  • RSX.BAS and RSX.BIN - allows to change the time under BASIC
  • CLOCK.COM - installs the clock under CP/M+ (thereafter, it should be accessible with standard DATE command, and, it should add timestamps to files).

Unknown how the timestamps are stored on disk? The normal AMSDOS filesystem / directory entries don't include timestamps.

Timestamps

Time stamps - P2DOS and CP/M Plus support time stamps, which are stored in each fourth directory entry.

This method uses Directory Entries with User Number 31 for Timestamps. Which should be incompatible with AMSDOS, so it is probably NOT used in the CPC. On the CPC, the timestamps <might> be maybe stored in the bootstrap sectors...?

This entry contains the time stamps for the extents using the previous three directory entries. Note that you really have time stamps for each extent, no matter if it is the first extent of a file or not. The structure of time stamp entries is:

 1 byte status 0x21
 8 bytes time stamp for third-last directory entry
 2 bytes unused
 8 bytes time stamp for second-last directory entry
 2 bytes unused
 8 bytes time stamp for last directory entry

A time stamp consists of two dates: Creation and modification date (the latter being recorded when the file is closed). CP/M Plus further allows optionally to record the access instead of creation date as first time stamp.

 2 bytes (little-endian) days starting with 1 at 01-01-1978
 1 byte hour in BCD format
 1 byte minute in BCD format

Review

Photos