Mike's PCjr Page Logo

Installing the Dallas Semiconductor DS1216E on the PCjr


The DS1216E is a wonderful little chip that can add clock and calendar functions to your ancient machine. Several companies sold it under different names; Radio Shack used "SmartWatch" with catalog number 25-1033, Synectics called it the "ROM-CLOCK", and PC Enterprises called it the jrROM-Clock. The instructions here are general instructions that can be applied to most older PC and XT class machines, including the PCjr. The only thing specific to the PCjr about this page is the location of the correct system ROM to use, which is detailed below.

(Note: When I originally wrote this page in 2003 you could still order new DS1216E chips. That time has long since passed, so if you find one it is either used or very old new-old-stock. My DS1216E is still working but at some point the battery will die. See http://minuszerodegrees.net/5160/ds1216e/ds1216e_battery_warning.htm for a deeper discussion of the problem.)

Introduction

Older PC and XT class machines designed before the arrival of the IBM PC AT generally did not have a built-in clock and calendar function. You manually set the date and time each time you turned on the computer. Many add-in boards added a clock and calendar, but your system may not have room for such a board. The Dallas Semiconductor DS1216E chip can be used to add a clock and calendar function to many old machines without requiring an add-in board. This is especially important for machines where an add-in board can not be located or there is not space for one.

The DS1216E is a hybrid device. It contains a 28 pin DIP socket, a small chip and a long life non-rechargeable lithium battery. You install it underneath a 28 pin ROM chip, re-installing the system ROM chip in the DIP socket provided by the DS1216E. The price of the chip is steep, but it is worth it. Once installed you use a command line utility to read or set the date.


How it works

Normally you only read the date and time from a clock and calendar chip, which makes installing it in a ROM chip socket ideal. However, you do need to set the date and time occasionally. How is this accomplished when there is no circuitry to write data to the chip? (ROM chips can be read, but not written to, so motherboard circuitry generally can not write to sockets designed for ROM chips - it would be useless.) Dallas has a neat trick to get around the fact that you are in a ROM socket; the DS1216E constantly monitors the address lines going to the ROM chip. If a certain sequence is detected, the DS1216E disconnects the ROM chip and starts to interpret the next part of the sequence. The effect is to use the address lines as data lines for programming the clock and calendar chip. After programming is complete, the DS1216E re-connects the ROM chip and then begins to monitor the address lines for the next occurrence of the special sequence.

The sequence is relative long - 64 bits on one of the address pins. The 64 bits are chosen such that they would never look like valid memory accesses. Your chances on tripping the DS1216E accidentally are 2^64, which is quite unlikely.


Hardware Installation

Dallas 1216E installed in a PCjr

This isn't a complete document that will hand-hold you through the process. If you are uncomfortable, find help.

First, find a 28 pin ROM chip that the DS1216E can be installed underneath. Most often this will be a BIOS chip on your motherboard. The DS1216E will add some height so make sure that the original ROM chip will fit when it is reinstalled with the DS1216E under it. (Plan for about one half inch of additional height.)

Although the DS1216E can work under any ROM chip, it still needs software to talk to it by "wiggling" the address lines and the software needs to know what addresses to use to do that. I have two programs linked below; SWATCH.EXE will scan for the DS1216E and find it wherever you put it while DS1216E.ZIP requires it to be under a ROM chip addressed at F800:0000. If you are using different software you'll need to figure out where to place the DS1216E chip by experimenting or reading your machine's schematics.

On a PCjr the ROM chip closest to the cartridge ports is addressed at F800:0000; a DS1216E will work with both programs linked here. (Pictured to the right.) The other ROM chip closer to the CPU is addressed at F000:0000. A cartridge that replaces one of the system ROM chips might disable the ROM clock, so if you have such a cartridge you might notice the DS1216E disappears when the cartridge is installed.

Remove the ROM chip from the motherboard. Use an IC puller to avoid bending the pins, and take precautions against static. Remember the orientation of the chip - it will have a notch on one end.

Install the ROM chip in the socket on the DS1216E. One end of the DS1216E is notched, and that notch should line up with the notch of your ROM chip. Ensure that you do not accidently bend a pin the wrong way when installing.

Install the combined ROM chip/DS1216E package back in the ROM chip socket on the motherboard. Mind the pins again ... you really don't want to find a replacement for a 20 year old ROM chip, do you?


Software Installation

There are two programs to choose from - DS1216E.ZIP and SWATCH.EXE. I've been using DS1216E.ZIP for a long time but recently I discovered SWATCH.EXE which is more flexible.

DS1216E.ZIP

Boot the machine to DOS and run the TESTCLK.EXE program. This will ensure that the DS1216E can be found and programmed.

Next, use the DOS software to set the current date and time on the DS1216E chip, and add the software to your AUTOEXEC.BAT file. The program is called CLOCK.COM, and it does not stay resident in memory.

If you change the date and time using the DOS DATE and TIME commands, it will *not* update the DS1216E - you need to use CLOCK.COM to update the DS1216E. However, you should not have to do this often.

An alternative design for the software would have been a device driver that stays resident and integrates with the DOS DATE and TIME commands. I generally don't like that approach, as you rarely want to set the date and time - you are more interested in reading it at bootup.

DS1216E.ZIP has a wonderful little bug; it is hardcoded to expect a DS1216E chip at F000:0000 but due to an overflow bug it is actually using FF00:0000 as the base address for the chip. The DS1216E chip doesn't particularly care about the exact segment so it works if you put it in a ROM chip that is getting the address lines wiggled by the software. For years I thought that I had installed the DS1216E chip at F000:0000 and it was only recently that I was alerted that the technical reference manual said that the chip was at F800:0000 and that something did not add up. (Thank you Modem7 - that was a fun rabbit hole!)

SWATCH.EXE

SmartWatch is the Radio Shack branded version of the DS1216E and SWATCH.EXE is their utilities, complete with source code. This is a self unpacking ZIP file so you can just use ZIP against it if you don't want to execute it or can't because your operating system won't tolerate 16 bit executables.

SmartWatch is smart enough to scan for DS1216E chips so it will find your chip in whichever ROM socket you installed it in. It does have a year 2000 bug in the program, but I don't think that affects the overall operation of the program and chip; it is just a display bug.  It uses 19Ax for years 200x and 19Bx for years 201x. (Instead of rolling over the 3rd digit they treated it as hexadecimal and incremented it.)

Use "SMWCLOCK" C to write the current DOS date and time to the clock and "SMWCLOCK S" to read the clock and set the current DOS date and time.


Credits

This page is my work. Nothing else is. I was tempted to write code to do this but I was lucky enough to find some code that already worked well.

Special thanks to 'RailDavid' for the DS1216E.ZIP code, which originally comes from Zenith Data Systems. It is copyrighted code. They did *not* provide licensing information or embed it in the comments of the provided source code.

SWATCH.EXE was found on a spammy driver download site - I endured the download process and I am making it available here so you don't have to go through that too. This code is presumably copyrighted by Radio Shack.

Created in March 2003, Last updated January 8th, 2017
(C)opyright Michael B. Brutman, mbbrutman at gmail.com

Return to Mike's IBM PCjr Page main page