Things I couldn’t find elsewhere

Dallas RTC sync + TOS Y2K fix

5 minutes

This page describes how a still produced little piece of hardware can add real time clock (RTC) functionality to our old favourite computer systems. In this case it’s an Atari STE, but any ST with ROM sockets will work. Why? I can’t speak for everyone, but personally I’ve become quite accustomed to being able to look at file creation dates to see when I worked on what. It’s not something that bothered me too much 25 years ago when I used my Ataris extensively - although I did acquire a TimeKey cartridge a little while later. Also - it’s just good fun to extend the old machines for nostalgic reasons.

How - hardware: Maxim Integrated has a series of ICs named Dallas 1216x - where x denominates whether they’re intended for use in RAM or ROM situations, and the amount of pins. For the Atari ST line of computers, the easiest way to add the ICs to the systems is either through a cartridge or as a pass-through in an existing ROM socket. Many Atari STEs have their ROM chips already socketed. Depending on the ROM version and whether they’ve been upgraded to a later TOS the chips are either 28 pin or 32 pin. The matching Dallas chips are thus the Dallas 1216E or Dallas 1216F version. (Do not try using any of the others - the functionality is very different) The chips are available from various reputable online dealers at a somewhat steep price (~€45). They also seem to be available from slightly more risky sources at much lower prices, although it’s possible those would suffer from issues with battery life lengths etc.

Once you have the IC, removing one of the existing ROM chips is a matter of using a flat screwdriver and carefully nudging it upwards little by little switching sides a few times. All you have to do then is to insert the Dallas chip in the existing socket and re-seat the ROM into the pass-through connector. It will look something like this (maybe less dusty though): Mounted Dallas 1216F (Never mind the yellow cables - as can be seen on the ROM chip stickers I have a dual TOS installation and the cables go to a switch)

I use an HxC Floppy SD emulator myself and haven’t tried putting back the internal disk drive. I believe it would still fit, although tight. It’s also not important which ROM socket you put the Dallas chip in (HI or LO). With this, the actual hardware installation is done.

Next up is the software - there’s a bit of magic involved in how an RTC inserted into a ROM socket can be accessed by the Atari. How - software: The Dallas chips work by closely monitoring the ROM accesses, and if a special hard coded sequence of 64 reads is detected (which will never happen by chance) it’s possible to either read out the contents with a further 64 reads - or by reading ROM in a different way write to the chip. Luckily for us, Bill Penner wrote a software suite back in the late 90s that contains a graphical configuration program as well as a clock display .acc and a program meant to go into an AUTO folder setting the correct time and date in TOS at boot. It’s downloadable from various places, including here.

Unfortunately, even though the release history says it’s Y2K-fixed, neither I nor the person I bought my Dallas chip from were able to get the boot program working as it should. The year became 2028, even though the .acc and the configuration program displayed everything correctly. This is well known as the Atari TOS Y2K problem, where year 2,000 and later are unable to be set and retrieved by TOS.

Enter Ingo Linkweiler, who early in the year 2,000 released a software TOS fix that works by intercepting calls to two TOS routines (datetime set and get) and wind them 20 years back and forth making it possible for TOS to work fine again up until the year 2020. It’s likely, although I didn’t try, that the AReal boot program would work if Ingo’s Y2K fix had been run beforehand.

How - Troed: So, since the main reason why I’m playing around with old Ataris isn’t purely for nostalgia, but because it’s a nice system to write low level code on - I realised there was something here that I could do. While the configuration program in AReal works perfectly to set the time in the Dallas RTC - apparently at least I had the need for a utility that not only initialised the TOS clock to its values at boot, but did so in a Y2K compatible way.

Additionally, I dislike having to create AUTO folders and take care of the order I add programs into them. Attached here is Dallas RTC v1.0 - containing not only a replacement boot program for AUTO usage instead of the one in AReal, including a Y2K fix that works up until year 2030, but also the same code optimised for small size making it fit into a boot sector (=<480 bytes). By writing this onto your disks (or disk images, as in the case with my HxC Floppy emu) - or using the AUTO program - your Dallas RTC will now be transparently read by your Atari at boot. Have fun - and let me know if you find any bugs! The source code is included, and can also be found at Github.

/Troed