Dallas RTC drivers (beta)

General Discussion, STOS.

Moderator: troed

User avatar
agranlund
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

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
(16.85 KiB) Downloaded 194 times

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!
troed
Moderator
Moderator
Posts: 908
Joined: Mon Aug 21, 2017 10:27 pm

Re: Dallas RTC drivers (beta)

Post by troed »

agranlund wrote: Thu Oct 08, 2020 8:33 pm 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: 23488
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Dallas RTC drivers (beta)

Post by exxos »

Sounds great! Now wheres @rubber_jonnie ....
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
kodak80
Posts: 370
Joined: Sat Oct 21, 2017 1:14 am
Location: Brisbane,QLD Australia
Contact:

Re: Dallas RTC drivers (beta)

Post by kodak80 »

Looking forward to testing this on the weekend on my H4s. :D
Atari Falcon 030 | Atari 1040 STE | Atari 1040 STFM | Atari 1040 STF | Kryoflux & Supercard Pro Flux boards
Creator of the Atari ST Review magazine archive: https://www.chillichai.com/atari-st-review
User avatar
rubber_jonnie
Site Admin
Site Admin
Posts: 10462
Joined: Thu Aug 17, 2017 7:40 pm
Location: Essex
Contact:

Re: Dallas RTC drivers (beta)

Post by rubber_jonnie »

exxos wrote: Thu Oct 08, 2020 9:30 pm 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
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: Dallas RTC drivers (beta)

Post by agranlund »

kodak80 wrote: Thu Oct 08, 2020 10:00 pm 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
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: Dallas RTC drivers (beta)

Post by agranlund »

troed wrote: Thu Oct 08, 2020 9:21 pm 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: 5
Joined: Sat Feb 10, 2018 6:14 pm

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: Sun Apr 08, 2018 1:14 am
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: 370
Joined: Sat Oct 21, 2017 1:14 am
Location: Brisbane,QLD Australia
Contact:

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.
Atari Falcon 030 | Atari 1040 STE | Atari 1040 STFM | Atari 1040 STF | Kryoflux & Supercard Pro Flux boards
Creator of the Atari ST Review magazine archive: https://www.chillichai.com/atari-st-review
Post Reply

Return to “SOFTWARE”