Dragon 64 internal DS1315 RTC board

For the discussion of all hardware related topics.
bluearcus
Posts: 109
Joined: Wed Sep 07, 2016 4:45 pm

Dragon 64 internal DS1315 RTC board

Post by bluearcus »

Hi all,

Documentation dump on the Real Time Clock stuff I had at the Dragon meet.
OS9pretty-small.jpg
OS9pretty-small.jpg (16.15 KiB) Viewed 2579 times
The attached zip file contains:
* An overview RTC.pdf document
* KiCad schematic pdf and a board gerbers zipfile
* The DS1315 data sheet
* Assembly language source for the RTC.BIN get/set routines (callable from Dragon BASIC).
* Assembly language source for the getrtc OS9 command
* A DragonDOS 40 track single sided headerless DSK image with the Basic and machine code access routines
* An OS9 40 track single sided headerless .os9 image with the getrtc command, source, plus the nulldr and null device driver and descriptor
D64DS1315RTC.zip
(956.12 KiB) Downloaded 132 times
I still have one complete board, and a few PCBS but am out of DS1315s, and they are getting more difficult to find at sane prices. If anyone wants the last assembled board, let me know, or if there are a few people who are interested, I'll try and get the parts to make more. A saner option may be to redesign with the SOP version of the part which seems to still be relatively low cost.

Kind regards,

Mike
sorchard
Posts: 513
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: Dragon 64 internal DS1315 RTC board

Post by sorchard »

That's some pretty tenacious coding you've pulled off there to access the rtc :)
Stew
bluearcus
Posts: 109
Joined: Wed Sep 07, 2016 4:45 pm

Re: Dragon 64 internal DS1315 RTC board

Post by bluearcus »

Cheers Stew, it was brute force (and ignorance) mostly :lol:
sorchard
Posts: 513
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: Dragon 64 internal DS1315 RTC board

Post by sorchard »

Just some proof of concept code to access the rtc without switching roms.

Should help with getting one of these working in a Dragon 32.
Attachments
test.zip
(1.53 KiB) Downloaded 98 times
Stew
bluearcus
Posts: 109
Joined: Wed Sep 07, 2016 4:45 pm

Re: Dragon 64 internal DS1315 RTC board

Post by bluearcus »

Nice work Stew! I had thought about the compiling approach, but disregarded it because it would mean throwing code into the process storage space under os9 which seemed a bit dirty. Fast work to get an implementation out ;-)

I'm now thinking throwing code into that space is the only sane way to get your banked 256k board fully working as a ram disk under os9 though! 8-)

This leaves just the "third way" for the DS1315 RTC (a fully safe routine using conditional branching with jmp ,reg) but that's going to be so messy only a madman would try it :lol:

I'm away from my Dragons at the moment but will check Phil's D32(64) ROM board in my original D32(64) for which enable line it uses... 50/50 chance. Fingers crossed I'll be able to try this out!
sorchard
Posts: 513
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: Dragon 64 internal DS1315 RTC board

Post by sorchard »

Not quite sure where this lies on the filthometer, but one code trick I'm fond of is using rts with a preloaded stack as a fast loop counter or sequencer. A similar thing can be done with puls regs,pc to quickly make a series of function calls with parameters. This approach is nicer because it respects the distinction between code and data regions.

Of course, rts and puls won't work with the rtc but RTI might be nice (V) (°,,,,°) (V)
Attachments
test_rti.zip
(1.99 KiB) Downloaded 100 times
Stew
bluearcus
Posts: 109
Joined: Wed Sep 07, 2016 4:45 pm

Re: Dragon 64 internal DS1315 RTC board

Post by bluearcus »

Doesn't RTI spit a dead cycle at the end though?!
sorchard
Posts: 513
Joined: Sat Jun 07, 2014 9:43 pm
Location: Norwich UK

Re: Dragon 64 internal DS1315 RTC board

Post by sorchard »

bluearcus wrote: Fri Dec 03, 2021 8:03 pm Doesn't RTI spit a dead cycle at the end though?!
It does, but the beautiful thing is that it emits the stack pointer during that cycle rather than FFFF :ugeek:

Something similar happens to allow say LDA ,X to work. It runs for four cycles: First two cycles are opcode and postbyte, then there is a dead cycle but the 6809 is speculatively fetching another index postbyte, while the fourth cycle is of course the effective address.
Stew
bluearcus
Posts: 109
Joined: Wed Sep 07, 2016 4:45 pm

Re: Dragon 64 internal DS1315 RTC board

Post by bluearcus »

Ah... That's different from the cycle reference info on Arto Salmi's page which suggests FFFF! Interesting.

http://atjs.mbnet.fi/mc6809/Information/6809cyc.txt
KenH
Posts: 179
Joined: Fri Oct 12, 2012 9:50 am

Re: Dragon 64 internal DS1315 RTC board

Post by KenH »

Thanks for posting this Mike.
I've attempted to build this board, but the attached D64RTC.dsk seems empty (or at least I can't read it). Can you share the DragonDos files again?
thanks
Post Reply