Dallas RTC drivers (beta)

General Discussion, STOS.

Moderator: troed

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

Dallas RTC drivers (beta)

Post by agranlund » 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 :)
RTCX.zip
(16.85 KiB) Downloaded 93 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: 761
Joined: Mon Aug 21, 2017 10:27 pm

Re: Dallas RTC drivers (beta)

Post by troed » Thu Oct 08, 2020 9:21 pm

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: 16056
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: Dallas RTC drivers (beta)

Post by exxos » Thu Oct 08, 2020 9:30 pm

Sounds great! Now wheres @rubber_jonnie ....
https://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxoshost.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 ~

User avatar
kodak80
Posts: 317
Joined: Sat Oct 21, 2017 1:14 am
Location: Brisbane,QLD Australia
Contact:

Re: Dallas RTC drivers (beta)

Post by kodak80 » Thu Oct 08, 2020 10:00 pm

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
Moderator
Moderator
Posts: 4641
Joined: Thu Aug 17, 2017 7:40 pm
Location: Essex
Contact:

Re: Dallas RTC drivers (beta)

Post by rubber_jonnie » Thu Oct 08, 2020 10:42 pm

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 old Atari things:
800XL + Ultimate 1MB, 2x 1010 cassette, 1050 + Happy mod, 65XE (128k +APE Warp) & XC12, SIO2SD, 2600jr, 7800 and Lynx II
Atari 520ST (1Meg), 1040STF long button floppy, 2x 1040 STFMs + Gotek, 2x 4160STE with 32Mhz booster, ROM switcher, Mega ST1, Mega ST4, not to mention various bare ST boards for testing including a PAK 68/2 :)
Plus the rest..
Amiga stuff, Mac stuff, Sinclair stuff etc...
www.electronicnothingness.co.uk

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

Re: Dallas RTC drivers (beta)

Post by agranlund » Thu Oct 08, 2020 10:46 pm

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: 492
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: Dallas RTC drivers (beta)

Post by agranlund » Thu Oct 08, 2020 10:59 pm

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: 4
Joined: Sat Feb 10, 2018 6:14 pm

Re: Dallas RTC drivers (beta)

Post by bj_kock » Thu Oct 08, 2020 11:31 pm

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: 1566
Joined: Sun Apr 08, 2018 1:14 am
Location: USA

Re: Dallas RTC drivers (beta)

Post by PaulJ » Fri Oct 09, 2020 1:02 am

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: 317
Joined: Sat Oct 21, 2017 1:14 am
Location: Brisbane,QLD Australia
Contact:

Re: Dallas RTC drivers (beta)

Post by kodak80 » Fri Oct 09, 2020 3:50 am

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”