Dave sent me this link http://home.comcast.net/~kr.baker/rtc.txt on connectiog the smaller DS1287 to a ZX81.
Obviously for the MTX full decoding is needed, so I modified the circuit to us an ATF16V8 instead of the 74 series parts.
For some "strange" reason, I chose to use ports 070h and 071h for the clock, OUT to 070h sets up the register address, then IN or OUT 071h to access the location. it works from both basic and assembler.
The WINCUPL code for the PLD is:
Code: Select all
Name RTC ;
PartNo 00 ;
Date 30/05/2014 ;
Revision 01 ;
Designer Engineer ;
Company none ;
Assembly None ;
Location ;
Device G16v8 ;
/* *************** INPUT PINS *********************/
PIN 1 = A0 ; /* */
PIN 2 = A1 ; /* */
PIN 3 = A2 ; /* */
PIN 4 = A3 ; /* */
PIN 5 = A4 ; /* */
PIN 6 = A5 ; /* */
PIN 7 = A6 ; /* */
PIN 8 = A7 ; /* */
PIN 9 = M1 ; /* */
PIN 11 = IORQL ; /* */
PIN 12 = RD ; /* */
/* *************** OUTPUT PINS *********************/
PIN 16 = DS ; /* Active high data strobe */
PIN 17 = RW ; /* inverted read signal */
PIN 18 = AS ; /* Active high address strobe */
PIN 19 = CS ; /* Active low data strobe */
/* Address port &70. Data port &71 */
DS =
!IORQL & M1 & !A7 & A6 & A5 & A4 & !A3 & !A2 & !A1 & A0 ;
!RW =
RD;
AS =
!IORQL & M1 & !A7 & A6 & A5 & A4 & !A3 & !A2 & !A1 & !A0 ;
!CS =
!IORQL & M1 & !A7 & A6 & A5 & A4 & !A3 & !A2 & !A1 & A0 ;
ASCII "schematic" of the 2 chip's connections, I have them mounted in opposite directions to make the hook up neater
Code: Select all
+-------+
5v | o| 5v
+-----+ NC | | NC
0v | |iorq NC | |NC
M1 | |RD NC | |D0
A7 | |NC NC | |D1
A6 | |NC NC | |D2
A5 | |NC NC | |D3
A4 | |ds DS | |D4
A3 | |rw NC | |D5
A2 | |as R/W | |D6
A1 | |cs AS | |D7
A0 |o |5v *CS | |0v
+-----+ +-------+
16V8 DS12887