80-Bus News |
January–March 1982 · Volume 1 · Issue 1 |
Page 19 of 55 |
---|
A further point to note is that the clock’s interrupt system is not reset on a computer reset. This will cause problems if an attempt is made to run another interrupt-using program which does not expect clock interrupts, unless the clock’s interrupt system is first reset by software. This can be done by outputting zero to the interrupt register and then reading the register.
The listing of a demonstration program Timedate 1 is given below. This is written for use with NAS-SYS and is entered at 1000H. The program then requests that the starting time (hh mm) and date (dd mm yy) be keyed in – e.g.:
23 59 31 1 82
The clock will be started from this time when ENTER is hit. If the line entered starts with a space (e.g. if no time is provided}, the existing clock time will be retained.
Timedate 1 then returns to NAS-SYS, from which a user program can be entered if required. However, NAS-SYS or the user program will be interrupted at intervals of 514.4 ms while the interrupt routine updates a time and date display on the top line of the screen.
Note that a separate stack is used by the interrupt program, because the interrupted program (such as NAS-SYS) may not have enough spare stack space for the interrupt routine. The interrupt pointer address defined by the contents of the I register and the vector (00H) returned by the clock is loaded with the start address of the interrupt routine.
Resistors:
R1=220R
R2=4.7K
R3,R4,R5=10K
R6=1K
R7,R8=10K
Capacitors:
C1,C2=10nF
C3=10uF 16V
C4=6-36pF
Integrated circuits:
IC1=MM58174N
IC2=74LS00
IC3=74LS01
IC4=74LS00
IC5=74LS00
IC6,IC7=74LS05
IC8=74LS145
Transistors and diodes:
Tr1=BC178
Tr2=BC108
ZD1=BZX83C 3V3
Miscellaneous:
XTAL= 32.768 KHz crystal
Batt.= 2 AA NiCad cells in series
Page 19 of 55 |
---|