Author Topic: Amstrad PCW RTC  (Read 5954 times)

0 Members and 2 Guests are viewing this topic.

Offline torrind

  • CPC664
  • ***
  • Posts: 67
  • Country: gb
  • Liked: 17
  • Likes Given: 34
Re: Amstrad PCW RTC
« Reply #25 on: 01:07, 19 April 19 »
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

Offline GeoffB17

  • 6128 Plus
  • ******
  • Posts: 654
  • Country: gb
  • PCW since '85
  • Liked: 145
  • Likes Given: 7
Re: Amstrad PCW RTC
« Reply #26 on: 01:55, 19 April 19 »
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

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #27 on: 11:05, 19 April 19 »
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:

Code: [Select]
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).
« Last Edit: 11:14, 19 April 19 by JonB »

Offline TynH

  • CPC664
  • ***
  • Posts: 131
  • Country: de
  • Liked: 28
  • Likes Given: 18
Re: Amstrad PCW RTC
« Reply #28 on: 17:12, 19 April 19 »

Me 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

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)

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #29 on: 18:23, 20 April 19 »
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!

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.870
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 848
  • Likes Given: 2103
Re: Amstrad PCW RTC
« Reply #30 on: 03:41, 21 April 19 »
You know what I mean.  :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #31 on: 16:50, 24 April 19 »

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.870
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 848
  • Likes Given: 2103
Re: Amstrad PCW RTC
« Reply #32 on: 03:00, 25 April 19 »
Good luck for the prototype boards!  :)
« Last Edit: 15:37, 25 April 19 by GUNHED »
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline JohnElliott

  • CPC664
  • ***
  • Posts: 76
  • Country: gb
  • Liked: 30
  • Likes Given: 0
Re: Amstrad PCW RTC
« Reply #33 on: 09:50, 25 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:
Quote
uRTCTX.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.

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #34 on: 11:10, 25 April 19 »
That's great news, John - means I do not need to build a FID for it.  :)

JonB
(a non user of Locoscript)

Offline GeoffB17

  • 6128 Plus
  • ******
  • Posts: 654
  • Country: gb
  • PCW since '85
  • Liked: 145
  • Likes Given: 7
Re: Amstrad PCW RTC
« Reply #35 on: 18:46, 25 April 19 »
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

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #36 on: 19:50, 25 April 19 »
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
« Last Edit: 19:57, 25 April 19 by JonB »

Offline JohnElliott

  • CPC664
  • ***
  • Posts: 76
  • Country: gb
  • Liked: 30
  • Likes Given: 0
Re: Amstrad PCW RTC
« Reply #37 on: 02:51, 26 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.

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #38 on: 14:51, 09 May 19 »
Quick update: Clock chips arrived today from China, five of them. Only took a month! Still waiting for the boards...

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.870
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 848
  • Likes Given: 2103
Re: Amstrad PCW RTC
« Reply #39 on: 19:06, 09 May 19 »
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 (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #40 on: 10:33, 10 May 19 »
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.

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #41 on: 13:22, 27 June 19 »
Another update: Boards still not here, so have declared them lost and the PCB fab house is redoing them (for free).

Chinese shipping...  :picard:

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #42 on: 12:28, 30 July 19 »
One month later...

 

* IMG_5642.jpg
(755.07 kB, 2016x1512 - viewed 183 times)


Hooray!

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.870
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 848
  • Likes Given: 2103
Re: Amstrad PCW RTC
« Reply #43 on: 23:15, 30 July 19 »
Excellent! They look good!  :)
http://futureos.de --> Get the revolutionary FutureOS (Recent update: 2019.08.07)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2019.08.14)

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #44 on: 11:03, 31 July 19 »
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.


* IMG_5643.jpg
(110.2 kB, 640x480 - viewed 146 times)

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #45 on: 11:09, 31 July 19 »
Test fitting onto a uIDE-8 board..

 

* IMG_5644.jpg
(93.69 kB, 596x373 - viewed 151 times)


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.
« Last Edit: 11:19, 02 August 19 by JonB »

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #46 on: 19:50, 14 August 19 »
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!

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #47 on: 21:33, 14 August 19 »
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!

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #48 on: 14:32, 15 August 19 »
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:

 

* IMG_5679.jpg
(400.61 kB, 2016x847 - viewed 97 times)



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


 

* IMG_5678.jpg
(264.36 kB, 2002x846 - viewed 89 times)


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.

Offline JonB

  • 6128 Plus
  • ******
  • Posts: 758
  • Country: gb
  • Liked: 206
  • Likes Given: 48
Re: Amstrad PCW RTC
« Reply #49 on: 19:09, 15 August 19 »
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.
« Last Edit: 19:13, 15 August 19 by JonB »