News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Amstrad PCW RTC

Started by torrind, 00:19, 25 December 18

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

torrind

Hi Jon,


Regarding Gunhed's comment on the GETRTC.COM to read the time and date - I notice that contained with uIDE is a DATE.COM command - Could this also be utilised? or his it redundant?


Following this all with great interest!


Darren

GeoffB17

No help.

DATE.COM will be the standard CP/M utility, which prompts for a date and time to be entered manually, and then sets the system clock.   It has no way of getting the date/time from anywhere else.   The point of the new prog, whatever it's called, will be to get the time/date from the RTC and then put this into the system, automatically, without any user action (although this might be possible as an option.

Geoff

JonB

#27
That's correct, Geoff.

I will provide a utility with the uTRC-8 board with the following facilities:

  • Get time & date from the RTC and display on screen
  • Set RTC time & date
  • Transfer RTC time & date to PcW clock

I wrote a similar thing for the Multicomp RTC (which uses a different clock chip, the DS1203). The following should give an idea of how it is used:

A>date
Tue 10 Nov 2017 12:42:36
A>date 18/12/18
Tue 18 Dec 2018 12:42:52
A>date 17:05
Tue 18 Dec 2018 17:05:00
A>date 17:05:55
Tue 18 Dec 2018 17:05:55
A>date
Tue 18 Dec 2018 17:05:13
A>date help
Multicomp DS1203 RTC date & time utility - JonB 2018

usage: date - show date and time
       date [[day] [dd/mm/yy] [hh:mm[:ss]]] - set date and/or time

A>date I am a teapot
Multicomp DS1203 RTC date & time utility - JonB 2018

usage: date - show date and time
       date [[day] [dd/mm/yy] [hh:mm[:ss]]] - set date and/or time

A>


So we will call it uRTC.com and add a new option (such as -t) to transfer RTC date / time to the PcW clock. Thereafter you'd just need to set the uRTC  date/time and put a call to c:uRTC -t in the profile.sub  and "job done".

I'll probably have a "base I/O address" option so you can configure the board as you like, and change the utility to suit, but it will have a default (probably C0h).

TynH


Quote from: TynH on 08:01, 16 April 19Me too! Haven't had the opportunity to actually fit the uIDE module yet but at least it's waiting for me back home on my desk.  :D
Quote from: JonB on 14:45, 18 April 19
Oh, you are in for fun...




Looking forward to what'll no doubt prove to be challenging. Unfortunately I'm still kinda stuck in here:





8)

JonB

Come on mate we are waiting to see if it works with your Schneider connector...!

;D

And by the way, it's pretty warm here in the UK: https://www.bbc.co.uk/news/uk-47996418

Palm trees? We don't need no steenkin' palm trees!

GUNHED

You know what I mean.  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)


GUNHED

#32
Good luck for the prototype boards!  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

JohnElliott

Quote from: JonB on 14:50, 24 April 19
Just prepping a Wiki page: http://www.cpcwiki.eu/index.php/URTC-8_Universal_RTC_for_Z80_computers
I don't think this will work:
QuoteuRTCTX.FID performs the same function as uRTCTX.COM, except as a FID (field installable driver). Use this to set the PcW system clock when booting into LocoScript
I'm pretty sure that time stamps and the system clock only exist under CP/M - I've never seen anything to suggest LocoScript supports either.

JonB

That's great news, John - means I do not need to build a FID for it.  :)

JonB
(a non user of Locoscript)

GeoffB17

Jon,

Now that John Elliott mentions it, I had a thought.   Some time back, there was a discussion here about problems with LocoScript disks being accessed within CP/M, and someone mentioned that CP/M disks ARE compatible with Loco as long as Initdir is NOT used.   So it would probably NOT be a good idea to even try using time/date etc within LS??

Is essence, CP/M does not support time/date stamping, EXCEPT via certain extensions to CP/M.   You need to use Initdir to prepare the disk directory area.   You need to use special options of DIR.COM, and I think SET.COM.   Locoscipt prob uses a somewhat cut down version of CP/M as far as files/dir facilities anyway, so it's never going to cope with the 'extras' required for date stamping.

Geoff

JonB

#36
Hi Geoff

As you know, I am not a LocoScript user and so I assumed it could support timestamps. It's a pity that it doesn't.  However, the device is generic and can be used on any computer with a socketed Z80 (CP/M or not), so I will proceed with it. CP/M 3 ("Plus") and MP/M do support file system timestamps, natively. The reason you need to use a utility to upgrade the file system is backwards compatibility.

All the things you might use a system clock for can be implemented in a CP/M Plus system without having a uRTC device fitted - but you'd have to enter time and date each time you cold boot the machine, which is what I want to get away from (also, if the date and time is set automatically, there is more incentive to use these features).

I think I will experiment a bit with it, see what happens in LocoScript.

Cheers
JonB

JohnElliott

Quote from: GeoffB17 on 16:46, 25 April 19
Locoscipt prob uses a somewhat cut down version of CP/M as far as files/dir facilities anyway, so it's never going to cope with the 'extras' required for date stamping.
LocoScript doesn't use any CP/M code - it uses an independently-written module (which I've heard called PCWDOS) for file access. This module is also used by LocoLink, and a derivative (+3DOS) provides disk access on the Spectrum +3.

JonB

Quick update: Clock chips arrived today from China, five of them. Only took a month! Still waiting for the boards...

GUNHED

Never mind, gives you time to do other parts of the project.  :)  We did wait so long, now we can wait some months more too.  ;) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

JonB

Well, I could build a prototype and write the software but it's a lot of work (the prototyping I mean).

As usual, there are little stumbling blocks along the way. I ordered a bunch of 74LS688s or so I thought - when they turned up they were 74HC688 and not compatible. Other items still to arrive include the battery holders, but I can build one at least for software testing.

JonB

Another update: Boards still not here, so have declared them lost and the PCB fab house is redoing them (for free).

Chinese shipping...  :picard:

JonB

One month later...

[attach=1]

Hooray!

GUNHED

Excellent! They look good!  :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

JonB

Now, if only I could remember what collection of cables and adapters I used to connect the PCW to my PC. I need to copy a utility across to identify some spare ports for the uRTC to reside on. I've built the first one ready for some testing, though.

[attach=1]

JonB

#45
Test fitting onto a uIDE-8 board..

[attach=1,msg176721]

Problem now is I cannot get my CPS8256 serial port to work. It's sending data to the PC but not receiving anything. Until I can work out what is wrong I'm stuck.

In the meantime I am developing the utilities for it on my Superbrain.

JonB

Quick update: It's bad news so far. I can't get the stupid thing to output any data other than 08h on any of its ports. Hmmm, it might be a bad design, or my assembler code. I am investigating!

JonB

Having a bit of a senior moment! Found a bug or five in my code - so now I am initialising, setting and reading the clock OK (although the read bit needs fixing properly). I can see the second / minute values incrementing!

JonB

OK, time for another update. uRTC is working on the Superbrain with uIDE. The utility program can set and read the time, but needs extra features added - such as parsing the date and time from the command line and setting the time from that, changing the clock mode (12/24hr), and transferring the clock time to the computer's system time (this feature is the main difference between Superbrain and PCW versions). I've had some problems with cabling, but the board seems to be working perfectly (and the backup battery circuit is good, too).

So, here we are:

[attach=1]


The uIDE-8 board is on the left and on the right hand a uRTC board with backup battery installed.


[attach=2]

Test run of the uRTC.COM utility. At the moment it just prints the time as found (hence the odd "YY MM DD" ordering for the date segment) but there is code to do all the other things I mentioned previously; it needs hooking up and modifying for the Epsom clock chip, but most of the donkey work is done.

JonB

#49
Well, colour me surprised. A day of Z80 hackery and I have a fully working uRTC with comprehensive software utility on the Superbrain. Rather like the program I showed in a previous post, you can:

       
  • Set the time, date and day of week (either all at the same time or individually).
  • Ask the uRTC what date time it is - it reports in the format Day Date Month Year HH:MM:SS so for example, "Thu 15 Aug 2019 17:01:02".
  • Transfer the date / time to the system clock (-t argument) after setting any date or time specified in the argument list (note, this function is system dependant).
  • Ask it to perform the requested function quietly (-q argument) - particularly of use when using the -t argument in a profile.sub.
  • Ask it to give usage instructions (-h argument).
The uRTC module connects to the uIDE Z80 bus cable by virtue of adding a second 40 way header to the ribbon. If you do not have uIDE you can connect uRTC to a computer via a Z80 shim and bus cable or (for the PCW) one of the expansion port adapters and bus cable. You don't need uIDE to use the uRTC.

Next steps.

       
  • Get my PCW serial adapter working.
  • Provide a PCW variant of the utility program uRTC.com.
  • Work out a price for the uRTC unit.
  • Update the CPCWiki uRTC page with details, downloads and prices
..at which point they can be ordered.

Powered by SMFPacks Menu Editor Mod