Last modified on 7 January 2010, at 08:15

Dk'tronics Real Time Clock

Revision as of 08:15, 7 January 2010 by Nocash (Talk | contribs) (I/O Ports)

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

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

PIO Port A seems to be the plain RTC Data Bus, there should be also Read and Write signals, which are maybe found in one (or both) of the unknown purpose ports?

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