Changes

URTC-8 Universal RTC for Z80 computers

7,451 bytes added, 08:56, 2 December 2020
/* Prices */
uRTC-8 is a universal RTC that can be connected via a [[UIDE_Universal_IDE_adapter_cards_for_Z-80_computers#Z80_Shims|Z80 Shim]] to any Z80 computer that has a socketed CPU. It is also compatible with the [[UIDE_Universal_IDE_adapter_cards_for_Z-80_computers#Machine-specific_expansion_port_adapters|uIDE-8 PcW expansion port adapters]]. Both of these connectivity options present a 40 way "Z80 Bus" and you can connect uRTC-8 to this bus, in parallel with other devices on the bus.
uRTC-8 uses an 8 bit comparator and a set of jumpers to enable I/O base address selection, just like uIDE-8. The RTC used is an Epson RTC72421 which has 16 registers, directly accessible via IN and OUT instructions. As a result, the base I/O address is a four bit number between 0000 and 1111 (0-15), putting the device at any of the I/O addresses 00h, 10h, 20h, 30h, 40h, 50h, 60h, 70h, 80h, 90h, A0h, B0h, C0h, D0h, E0h or F0h. From any of these base addresses to [base address + 0Fh] are the 16 registers of the Epson RTC. The default base address is 80h, and this is what uRTC.COM expects. Contact me if you need to set a different I/O base address.
uRTC-8 is powered by the host computer, but also has a battery backed supply to maintain the time and date when the host is powered down. The battery is a common CR2032 3v button cell.
uRTC-8 is designed to work on the Z80 bus implemented by uIDE-8. The intention is that the board is connected to the Z80 bus in parallel to uIDE-8 to provide a means to set the host computer's clock at boot time, automatically. The uRTC-8 board is exactly the same size as uIDE-8 with matching mounting holes, so they can be stacked one above the other using PCB standoffs.
 
Refer to the [[UIDE_Universal_IDE_adapter_cards_for_Z-80_computers|uIDE CPC Wiki page]] for further details on connectivity options. You don't need uIDE-8 in order to use uRTC-8 but you will need to choose a way to connect it to your computer. PCWs can use Z80 shim or the expansion port adapter; other Z80 computers can use the Z80 shim.
 
=== Video Demonstrations ===
 
* Hardware description and Superbrain demo: https://youtu.be/POBRlgAFxmo
* PCW (CP/M Plus) demo: https://youtu.be/CDJlPLYHUEA
 
=== Pictures of the finished board ===
[[File:URTC-8.jpg]]
 
Single board with no battery fitted yet.
 
 
[[File:URTC-8 stacked.jpg]]
 
A uRTC-8 stacked on a uIDE-8 board using plastic stand offs.
 
=== Aux PWR and Aux Batt connectors ===
As supplied, I do not provide header pins for Aux PWR or Aux Batt pads. If you want to use either of them, solder standard 2.54mm pitch header pin pairs and connect to those.
 
* Aux PWR is a 5v power line that is fed from the host computer. It is supplied as a convenience to allow you to provide power to other devices. Do not attempt to use it as a power input.
* Aux Batt is an alternative battery connector, to be used if you do not want to use the built in CR2032 button cell. If you use Aux Batt, you *must* remove the button cell first, and the voltage you need to apply is 3v - 5v. The clock chip can tolerate up to 7v but it is not advisable to go this high as you risk damaging it.
 
For both connectors, observe the connection polarity printed on the PCB.
== Project status ==
=== uRTC.COM ===
 Download the latest variant that matches your host computer, rename to uRTC.COM and transfer to your computer. ==== CP/M Plus variant ==== Version 0.2 https://drive.google.com/open?id=1biJngbF-HsDswufP4QZSDSKqk6e34a54 Version 0.1 https://drive.google.com/open?id=1Er7WKz09m9ctzeEk3jxSyDXjDc1OzInK Note: When you set the system time on the PCW (-t option), the second is always set to 0. ==== Superbrain variant ==== Version 0.2 https://drive.google.com/open?id=1UZq4VTQw32Y4G1tUflGlZpAKdPz19NY9 ==== Usage ====Use to set or display the time and date on uRTC-8, and / or transfer it to the host computer.
usage: uRTC - show date and time from the RTC clock"
uRTC [[dd/mm/yy] [hh:mm[:ss]]] [-ts|p] [-q] - set RTC day/date/time"
-tp t transfer uRTC date/time to CP/M Plus system clock" -ts transfer uRTC date/time to Superbrain host machine system clock"
-q quiet mode, reports errors only"
A>uRTC
Tue 18 Dec 2018 17:05:13
A>uRTC -tpt
CP/M Plus system time set: Tue 18 Dec 2018 17:05:13
You can combine functions as well; so for example
A>uRTC 19/12/18 -tpt
..would set the day of the week to Wednesday and the date to the 19th Dec 2018 on the RTCuRTC's clock, then transfer the new date and current uRTC time to the host computer's system clock.
==== Y2K handling ====
The clock chip itself does not store the century.
 
==== Setting the system time automatically on the PCW ====
 
Use the CP/M Plus / PCW version of uRTC.COM.
 
To automatically set the PCW system time, add the following line to the PROFILE.SUB file of the boot disk:
 
uRTC -t
 
Before first use, set the uRTC-8 clock time as shown in the usage section. Now, at each boot, the CP/M Plus system time is set automatically from the battery backed clock on the uRTC-8 board.
 
==== Setting the system time automatically on the Superbrain ====
 
Use the Superbrain version of uRTC.COM.
 
The Superbrain has no automatic boot command capability; however, if you are using uRTC-8 you can use the XSETCMD.COM program to set an initial boot command. The one you want is:
 
uRTC -t
 
If you are not using uIDE-8 on your Superbrain, you will have to remember to enter the command manually each time you boot. Advanced users may patch the CCP on the boot disk directly to inject the command.
 
Before first use, remember to set the uRTC-8 clock time as shown in the usage section. Now, at each boot, the Superbrain system time is set automatically from the battery backed clock on the uRTC-8 board.
=== Additional CP/M software required ===
You will need the Y2K compliant versions of DATE.COM, DIR.COM and SHOW.COM in order to use uRTC fully. You can download these from [http://www.gaby.de www.gaby.de]specifically, here: [http://www.cpm.z80.de/download/cpm3bin.zip www.cpm.z80.de/download/cpm3bin.zip]. You will also need a copy of INITDIR.COM: [https://drive.google.com/open?id=1EJOk6i24IxBluL8gx61bsn-a5Gl5MGnY Download link] == Using timestamps with CP/M plus files ==A full description of how to configure a CP/M Plus system for timestamps can be found on page 592 of the [[http://www.cpm.z80.de/manuals/cpm3-usr.pdf CP/M 3 user guide]]. In a nutshell: First, use INITDIR [drive] to create space in the drive's directory for the timestamps. For example:  A>INITDIR A: It will ask you if you want to reformat the directory. Don't worry, no files will go missing, but if you attempt this on a drive with many files, it may run out of directory space. Once the directory is reformatted, you use SET to set the sort of timestamps you want. For example:  A>SET A: [CREATE=ON] ..will turn on file creation timestamps (the time is recorded when a file is created)  A>SET A: [UPDATE=ON] ..will turn on update timestamps (the time is recorded when a file is updated)  A>SET A: [ACCESS=ON] ..will turn on access timestamps (the time is recorded when a file is opened). This option disables CREATE - the two options are mutually exclusive. Now, use DIR with option [FULL] to see the timestamps (after you've created / updated / accessed any files). You will see the timestamps on the far right of the directory listing. Where a timestamp is missing, it means that the file hasn't been accessed / created / updated since the INITDIR operation. ==== Locoscript considerations ====For PCW users, be aware that Locoscript does not support datestamps on CP/M file systems properly, so it is not recommended to use INITDIR on any disk that is used to store Locoscript files (including CP/M disks you want to read files from within Locoscript).
== Technical info ==
== Prices ==
This is a summary of the prices I have posted to the forum so far.
I am sorry that the assembled prices are what they are, but it is a time consuming and dreary job, not to mention the effort and cost to acquire the parts. [Update Dec 2020] Sadly, the clock chip used in this design has become much more expensive (the last one I bought cost over £10) and there are many counterfeits coming out of China, so it is risky to buy cheaply from there. My last three orders of clock chips turned out to be fake parts - not one of them worked. So I have to buy from the expensive UK vintage chip suppliers. As a result, I have had to put the price of the uRTC up to compensate.
{| class="wikitable"
! Item !! Price
|-
| uRTC-8 assembled || £34£44.00
|-
| Z80 Shim assembled (LHS or RHS) || £17.50
Please note, you will also need a Z80 bus cable. This is a standard 40 way IDC female to female ribbon commonly found in PCs to connect the motherboard to an IDE HDD, so if you have one lying around you don't need to buy one. If you already use a uIDE card, you can add a connector to the existing cable.
 
== Copyright ==
 
'''All designs presented here are copyrighted works.'''
 
'''Copyright (C) Jon Bradbury 2017.'''
 
* VCF Forum http://www.vcfed.org/forum/forum.php member "JonB"
* CPCWiki Forum http://www.cpcwiki.eu/forum/forum/ member "JonB"
* Amstrad.ES Forum member "JonB"
 
== Disclaimer ==
As I am a hobbyist, not a big business, I need to make a few things clear.
 
You are free use these designs for personal or commercial purposes, on the following conditions:
* You do not attempt to take credit for the work I have put into designing and / or building any device offered here.
* You acknowledge my right to assert copyright and ownership of these designs.
* You agree to indemnify me and the CPCWiki web site against damage to your computer or other connected hardware or data contained on any attached media.
* All work is undertaken at your own risk. I am not liable for any hardware damage or data loss, loss of your homework, your dog getting sick, etc.
* All devices and/or PCBs I offer are supplied as-is and there is no warranty that they are fit for any particular purpose.
* Your agreement to these conditions is implicit on ordering any of these devices or PCBs from me.
 
== Support ==
I will support your use of these designs via the appropriate forum by offering help and advice as necessary. Please review the content of this Wiki page before asking for help, though, and contact me via the channels described below.
 
== How to contact me. ==
I am member "JonB" of the VCF and CPC Wiki and Amstrad.ES Forums. If you need support or have any comments,
please start a new thread on the VCF CP/M forum here:
 
http://www.vcfed.org/forum/showthread.php?56162
 
Or on the relevant CPCWiki / Amstrad.ES forum linked to above. You could also PM me.. :)
 
Note: Forum registration is required.
 
== Salutation ==
Cheers!
 
CPCWiki Forum Member "JonB" (Jon Bradbury) 01/10/2019
 
[[Category:DIY]]
[[Category:Peripherals]]
[[Category:Hardware]]
410
edits