Tandy 200 Timer: Difference between revisions

From Bitchin100 DocGarden
Jump to navigationJump to search
 
(8 intermediate revisions by 2 users not shown)
Line 4: Line 4:


It is not complete yet
It is not complete yet
== Accessing the Timer in the T200 ==
"The timer is accessible via port 9X.  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.
ex.
2E14H  (DBH) IN D8H ; GET CURRENT BANK DATA
2E16H  (D3H) OUT 90H ; STORE 4 BITS IN THE RAM LOCATION 0
"
== Remote block copy code at  2FC5 ==
; this routine copies B bytes from (HL) in source to (DE) in target
; enter with source RAM visible
2FC5H  (C5H) PUSH B
2FC6H  (46H) MOV B,M ; load B with (HL)
2FC7H  (DBH) IN 91H ; get target data
2FC9H  (D3H) OUT D8H ; switch to target
2FCBH  (78H) MOV A,B ;
2FCCH  (12H) STAX D ; store (HL) in (DE)
2FCDH  (DBH) IN 90H
2FCFH  (D3H) OUT D8H ; switch to source
2FD1H  (C1H) POP B
2FD2H  (23H) INX H
2FD3H  (13H) INX D
2FD4H  (0BH) DCX B ; decrement BC
2FD5H  (79H) MOV A,C ;
2FD6H  (B0H) ORA B
2FD7H  (C2H) JNZ 2FC5H ; loop back until B copies are performed....
2FDAH  (C9H) RET


== RP5C01: Real Time Clock with Internal RAM ==
== RP5C01: Real Time Clock with Internal RAM ==
Line 53: Line 9:
From the [[Media:Rp5c01 T200 timer.pdf|Datasheet]]:
From the [[Media:Rp5c01 T200 timer.pdf|Datasheet]]:


"The RP/RF5C01A are real-time clocks for microcomputers that can be connected directly to buses of microcom-
"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
puters 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.
for the Read/Write operation for memory.


Line 71: Line 26:
* Outputs alarm signals or timing pulse of 16Hz or 1Hz.
* Outputs alarm signals or timing pulse of 16Hz or 1Hz.
* Packages : 18pin DIP (RP5C01A)
* 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.
ex.
2E14H  (DBH) IN D8H ; GET CURRENT BANK DATA
2E16H  (D3H) OUT 90H ; STORE 4 BITS IN THE RAM LOCATION 0


[[Category:Model T Developer Reference]]
[[Category:Model T Developer Reference]]

Latest revision as of 13:47, 19 March 2009

Overview

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.

ex.

2E14H  (DBH) IN D8H		; GET CURRENT BANK DATA
2E16H  (D3H) OUT 90H		; STORE 4 BITS IN THE RAM LOCATION 0