BATTERY BACKED CLOCK
Before I get into the battery backed clock for the QL, let me just mention something I found in an electronics magazine. BABANI is offering two books for the QL. Here are the extracts of the advertisements.
BP:150 AN INTRO TO PROGRAMMING THE SINCLAIR QL $7.80 Helps the reader make the best use of the Sinclair QL’s almost unlimited range of features. Compliments the manufacturer’s handbook.
BP:156 AN INTRODUCTION TO QL MACHINE CODE $10.00 The powerful Sinclair QL microcomputer has some outstanding capabilities in terms of its internal architecture, the QL has a large address range, advanced instructions which include multiplication and division. These features give the budding machine code programmer a good start at advanced programming methods. This book assumes no previous knowledge of either the 68008 or machine code programming.
These books may be ordered by telephone (416) 445-5600, or write to: MOOSEHEAD PUBLICATIONS, 1300 DON MILLS RD., NORTH YORK, ON., M3B 3M8. That’s right in town! (and not too expensive either).
On to the clock. The following is NOT original. It is a compilation of two other articles. The battery-backed part was written by Dennis Briggs, and the clock write protect was written by Steve Papierowski. Each appeared in Quanta about a year ago.
Most changes involved in running your clock continuously are minor. One of the many jobs of the ZX8302 is to provide the clock for the QL. If this chip can be powered by battery, then the clock would retain it’s (not always proper – I’ll get into that later) time. Fortunately, the 8302 has two 5V power pins, pin 40, and pin 11, and only one has to be kept active to work. For issue 5 boards, replace the link in position D22 with a small diode together with a further diode in D23. A small 3.8 volt battery connected to the points marked BATTERY (under the heat-sink) and fastened with sticky pads under microdrive 2 does the trick. For issue 6 boards, this simple approach is not possible due to tracing changes. A practical solution is to bend pin 40 out of it’s pad. A 3.8 volt battery can be connected by soldering POS(+) to pin 40, and NEG(-) to regulator common. If possible check that te current is less that 2 microamp with the main power OFF. Keep in mind that the clock will be corrupted when a system crash occurs!
After you get the battery backed clock to work, you may find that it is sometimes reset on power-up. This is because the computer has wrote to the 8302’s clock set line. You may have also noticed that when running some programs, the clock will lose alot of time. All these problems are because the write line to the clock in the 8302 has been triggered. The solution to these problems is found in the second article by Steve.
Steve has found that the only way to ensure TOTAL reliability of the real-time clock under ALL circumstances, is to provide a switchable write-protect function to the ZX8302. This will even eliminate the potential of coruption during system crashes!
What follows is essentially a re-write.
The real-time clock write registers are found at address $18000/1 ($10000-$1FFFF) depending on board issue. Anyway, the important address lines are A1 & A5, which are both active low during write access to the clock registers. The 74LS138 chip uses A1, A5, and R/W to provide a disable signal (hold high) via a fast switching transistor to the 8302 enable line (PCENL) during all potential writes to the clock. Switch S1 allows the user to set the clock when necessary. All connections are made to the 8302 only, pin 10 of which must be lifted, and a 680 ohm resistor carefully added in series between pad and pin. For S1, a two pole DIP switch can be brought out to the rear panel. See circuit diagram for details. He states, “The above mod. works perfectly on my previously unreliable (40% failure rate) QL, which uses the battery backup detailed in QUANTA (Sep 86).” The editor added the last line of the article, “I tried this on one of my QL’s – it certainly write protects the clock but it was not a 100% cure for the clock failing on power up. It looks better than just adding a battery and will probably help in many cases. “. I’ve got the battery working, and I am currently working on the write protect circuit. If anyone has any other articles of this sort, please get in touch with me.
Senen Racki
[address omitted]
[phone number omitted]
