Dallas RTC drivers (beta)

General Discussion, STOS.
User avatar
agranlund
Site sponsor
Site sponsor
Posts: 1752
Joined: 18 Aug 2019 22:43
Location: Sweden

Dallas RTC drivers (beta)

Post by agranlund »

I've made a driver for older ROM based Dallas RTCs and I'd love some feedback if someone finds it useful and if it works on their machine or not :)
RTCX.zip

It supports DS1216E/F and DS1315 in ROM mode and it can be located in the cartridge port or any of the TOS ROM sockets.
A1 is assumed to be the data input, and /WE should be either A2 or A3
Tested on a 520STM with a "Forget Me Clock 2" cartridge under TOS2.06 and EmuTOS1.0. Your milage may vary, this is beta so use at your own risk, etc etc :)

To use it just put DALLAS1.PRG in the AUTO folder. If it's running you should have an 'RTCx' cookie with the address where the chip was found.
It's designed to work seamlessly with TOS so you'll set time and date using XControl as usual.

Using any other clock driver, Y2K type fixes or 3rd party Dallas applications at the same time may cause interference - especially those that still rely on the IKBD and work by adjusting the year back and forth.


It comes with sourcecode and is made as an extendible system with a common core, and separate hardware drivers.
The idea was that it should be easy to create additional drivers for other RTCs without having to worry about all the TOS boilerplate and just focus on the hardware specifics.
At the moment it's just that one Dallas driver though, and a dummy template to use when making a driver for some other RTC hardware.

Big thanks to @troed of SYNC fame for code example on how to talk to the DS1216!
You do not have the required permissions to view the files attached to this post.
troed
Posts: 936
Joined: 21 Aug 2017 22:27

Re: Dallas RTC drivers (beta)

Post by troed »

agranlund wrote: 08 Oct 2020 20:33 I've made a driver for older ROM based Dallas RTCs and I'd love some feedback if someone finds it useful and if it works on their machine or not :)

To use it just put DALLAS1.PRG in the AUTO folder. If it's running you should have an 'RTCx' cookie with the address where the chip was found.
It's designed to work seamlessly with TOS so you'll set time and date using XControl as usual.
Love your solution replacing the TOS code solving the Y2K problem properly! Will definitely install this on my own machines.

/Troed
User avatar
exxos
Site Admin
Site Admin
Posts: 28364
Joined: 16 Aug 2017 23:19
Location: UK

Re: Dallas RTC drivers (beta)

Post by exxos »

Sounds great! Now wheres @rubber_jonnie ....
User avatar
kodak80
Posts: 536
Joined: 21 Oct 2017 01:14
Location: Brisbane, QLD, Australia

Re: Dallas RTC drivers (beta)

Post by kodak80 »

Looking forward to testing this on the weekend on my H4s. :D
Creator of the Atari ST Review and ST Action magazine archives: https://www.chillichai.com/
User avatar
rubber_jonnie
Site Admin
Site Admin
Posts: 14898
Joined: 17 Aug 2017 19:40
Location: Essex

Re: Dallas RTC drivers (beta)

Post by rubber_jonnie »

exxos wrote: 08 Oct 2020 21:30 Sounds great! Now wheres @rubber_jonnie ....
I suppose I'd better try it at some point!
Collector of many retro things!
800XL and 65XE both with Ultimate1MB,VBXL/XE & PokeyMax, SIDE3, SDrive Max, 2x 1010 cassette, 2x 1050 one with Happy mod, 3x 2600 Jr, 7800 and Lynx II
Approx 20 STs, including a 520 STM, 520 STFMs, 3x Mega ST, MSTE & 2x 32 Mhz boosted STEs
Plus the rest, totalling around 50 machines including a QL, 3x BBC Model B, Electron, Spectrums, ZX81 etc...
User avatar
agranlund
Site sponsor
Site sponsor
Posts: 1752
Joined: 18 Aug 2019 22:43
Location: Sweden

Re: Dallas RTC drivers (beta)

Post by agranlund »

kodak80 wrote: 08 Oct 2020 22:00 Looking forward to testing this on the weekend on my H4s. :D
Oh, I would be interested in knowing if there are any issues with it and the H4 - it has a DS1315 on it right?
User avatar
agranlund
Site sponsor
Site sponsor
Posts: 1752
Joined: 18 Aug 2019 22:43
Location: Sweden

Re: Dallas RTC drivers (beta)

Post by agranlund »

troed wrote: 08 Oct 2020 21:21 Love your solution replacing the TOS code solving the Y2K problem properly! Will definitely install this on my own machines.
Thanks! Yeah that naive idea did work in the end.
The sourcecode will probably make a demo coder like yourself throw up a little though :)
I was pretty fluent in Z80 assembly way back when but I'm only now trying out 68k some 20 odd years after and haven't fully gotten my head around all those fancy addressing modes and instructions :lol:

But it sure is fun to sit on the actual ST with Devpac3.

Ultimately I plan on fitting some kind of RTC on one of my custom boards but I'm not sure which one yet, so I made it easy to write additional drivers for other hardware.
User avatar
bj_kock
Posts: 6
Joined: 10 Feb 2018 18:14
Location: Sweden

Re: Dallas RTC drivers (beta)

Post by bj_kock »

Great work!

Tested and works perfectly on my STE 4MB with "Forget Me Clock 2" cartridge under both TOS 1.62 and 2.06 :D
User avatar
PaulJ
Posts: 1568
Joined: 08 Apr 2018 01:14
Location: USA

Re: Dallas RTC drivers (beta)

Post by PaulJ »

Just tried it on the H4 with 2.06 and EmuTOS .9.1.2 and it works with both. Nice.... Real pleasure not needing to adj. the clock when changing os's. Nice job.
User avatar
kodak80
Posts: 536
Joined: 21 Oct 2017 01:14
Location: Brisbane, QLD, Australia

Re: Dallas RTC drivers (beta)

Post by kodak80 »

Couldn't wait until the weekend, so powered up an H4 with a Gotek boot floppy and this worked fine with the DS1315 chip. Initially, it read the date from the Dallas chip which was set previously with the FMII fixed PRG solution and the date was incorrect but once I set it in XControl with this new driver, the date was then correct from that point forward. Testing was with EmuTOS 1.0 and TOS 1.04. I have now updated my hard disk AUTO folder to use this new driver.
Creator of the Atari ST Review and ST Action magazine archives: https://www.chillichai.com/

Return to “SOFTWARE”

Who is online

Users browsing this forum: ClaudeBot and 7 guests