View Full Version : DS1216E source code

January 12th, 2018, 01:12 PM
Does anyone have any source code implementing a DS1216E in CP/M 2.2 or CP/M Plus? I have one and Matthew Reed's XTRS32 emulator also emulates one so I thought I'd add support in my CP/M Plus. Before I starting writing software to support it I thought I'd check to see if anyone has any source code I can use as a starting point.

January 12th, 2018, 04:21 PM
i"ve written code for the DS1215, but it was for x86 (V40) not Z80.

However, the Maxim guide is very nicely detailed. You should have no problem spinning code in an evening.


January 12th, 2018, 05:00 PM
http://www.brutman.com/PCjr/DS1216E.html has a link to source code you can use.

January 12th, 2018, 05:21 PM
Mike, I think Alphasite was looking for Z80 source--I've got x86 source, but that's set to handle int 1A BIOS serivice.

The Maxim doc has pseudo code as well as 8051 code, which might also be helpful. In any case, it isn't difficult.

January 12th, 2018, 05:26 PM
I linked him to source code; it will be helpful with the application notes even if it is a different architecture.

January 12th, 2018, 06:08 PM
Thanks, I'll look through the application notes and the source. I was mainly concerned about any pitfalls around the serial reading and writing.

January 12th, 2018, 07:38 PM
Okay, looking at the pseudo code in the application note what I need to do to read the clock is:

1) Map in the ROM
2) Read from the base ROM address 65 times (ROM base is 0000H)
3) Write the eight bytes of the trigger one bit at a time to the base ROM address
4) Read the eight bytes of the stored time one bit at a time from the base ROM address
5) Map out the ROM

To do a write change step 4 to a write.

January 12th, 2018, 08:14 PM
Yup--be sure to disable interrupts (if you're using them) while you're giving the magic incantation.

January 14th, 2018, 06:14 PM
Back in the day, Dwayne Saylor wrote Smartwatch software for the TRS80 Models 1, 3 and 4.
A search of the usual suspects should find the code.

This zip has the code for SMART/CMD but not for CLK/CMD

I modified CLK4/CMD to run on the TRS80 Model 2, so I know I have the source code 'somewhere', just have to find it.:confused:

January 15th, 2018, 05:14 AM
The Southern Cross Z-80 had and option for Smart Watch a down load of the firmware is here www.kitsrus.com/zip/sc1.zip (http://www.kitsrus.com/zip/sc1.zip) look at the SCMV1.prn file.
The Clock.prn could also be looked at to see how to access the smart watch.

January 15th, 2018, 05:36 PM
Thanks, Gazza and James0555.

January 15th, 2018, 09:58 PM
Tis amazing what you can find if you dig deep enough.:D
CLK4/TXT is attached below.
I had to make some changes to kill the Y2K bug and to get it running on the Model II but this is Duane Saylor's original unaltered code.
Should give you a few ideas and a pic of how it looks running on the Model II.