Tandy 200 Timer
From Bitchin100 DocGarden
This article is intended to provide sufficient information to allow you to access the RP5C01 Timer chip in the Tandy 200 without necessarily using any ROM routines.
It is not complete yet
RP5C01: Real Time Clock with Internal RAM
From the Datasheet:
"The RP/RF5C01A are real-time clocks for microcomputers that can be connected directly to buses of microcomputers with such CPUs as the 8085A or Z80 and allow setting or reading of the clock with the same procedures as for the Read/Write operation for memory.
These products have various features such as clock and calendar counters, alarm functions, and 26 ́ 4bits RAM which can be backed up by batteries. They can then be used as non-volatile RAM."
- Connected directly to CPU
- 4bit bidirectional data bus : D0 - D3
- 4bit address input : A0 - A3
- Built-in clock counter (hour, minute, second) and calendar counter (leap year, year, month, day, day-of-the-week)
- Supports both 12-hour AM/PM clock and 24-hour clock
- All clock data expressed in BCD codes
- ±30 second adjustment function
- Built-in 26 X 4bits RAM
- Backed up by batteries (minimum:2.2V)
- Outputs alarm signals or timing pulse of 16Hz or 1Hz.
- Packages : 18pin DIP (RP5C01A)
Interaction Between Timer and Memory Subsystem
The timer is accessible via port $9X.
Uniquely on the T200, the timer is used as scratchpad for copying data from bank to bank in the memory subsystem.
The code below illustrates how to change the mode on the timer to allow RAM access.
2E0CH (DBH) IN 9DH ; get current TIMER CHIP MODE 2E0EH (E6H) ANI 0CH ; and with 0c 2E10H (F6H) ORI 02H ; or with 02 2E12H (D3H) OUT 9DH ; SET TIMER CHIP MODE- LEAVE ALARMS ALONE, BUT SET TO RAM MODE
Now the timer is ready to be read/written. Note, the typical value for port $9D is 1000b or 8d.
Port $90 is used to store the source bank location, and port $91 is used to store the target.
2E14H (DBH) IN D8H ; GET CURRENT BANK DATA 2E16H (D3H) OUT 90H ; STORE 4 BITS IN THE RAM LOCATION 0