Real Time Clock for ZX81

Discussion about ZX80 / ZX81 Software
Post Reply
David G
Posts: 387
Joined: Thu Jul 17, 2014 7:58 am
Location: 21 North, 156 West

Real Time Clock for ZX81

Post by David G »

K. Murta wrote a nice app that shows a real-time clock on the ZX81 then proceeds to run a BASIC app in the foreground.

RELOGIO (2004) http://zx81.eu5.org/toddysofte.html

I have adapted it to English. The source code shows the machine language.
Attachments
RELOGIOE.zip
RELOGIO English P file and ASM file
(2.55 KiB) Downloaded 378 times
Moggy
Posts: 3231
Joined: Wed Jun 18, 2008 2:00 pm

Re: Real Time Clock for ZX81

Post by Moggy »

A nice idea but like the "real time clock" used with the Husband or H4th ROM it's not really very accurate due to the varying oscillation rates between different ZX81's ceramic timepieces.
Just tried this on one zeddy and it lost 10 seconds in the first three minutes so a nice novelty but not very practical. :D
Last edited by Moggy on Tue Jan 27, 2015 1:40 pm, edited 2 times in total.
David G
Posts: 387
Joined: Thu Jul 17, 2014 7:58 am
Location: 21 North, 156 West

Re: Real Time Clock for ZX81

Post by David G »

It also demonstrates how to run two "apps" at the same time. Very interesting.
User avatar
user@lab1
Posts: 60
Joined: Thu Apr 14, 2011 6:20 pm

Re: Real Time Clock for ZX81

Post by user@lab1 »

Speaking of watches, this maybe you'll find it interesting...
Even if (maybe) "off-topic". :)

http://www.pictureviewerpro.com/hosting/zx81/wilfr.htm
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano »

I'm wondering if such interrupt drivers could hold a parallel counter to handle some sort of experimentally determined bias.
So the ZX81 user could POKE somewhere a value to be added or subtracted to the actual FRAMES counter after a given number of ticks. Determining the right setting for such values could be done with a test application looping long enough, asking the user for his own time measurements and computing the optimal values for the 2 parameters (hoping the thermal drift impact and the components age effect are low enough).
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Real Time Clock for ZX81

Post by olofsen »

This is a version that uses z88dk, ZeddyNet, and ntp, with a very simple algorithm: http://rullf2.xs4all.nl/sg/clock.zip

ZeddyNet may be emulated (under Linux) with http://rullf2.xs4all.nl/sz81
Last edited by olofsen on Thu Aug 02, 2018 9:36 pm, edited 1 time in total.
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano »

Very professional !
You might integrate the graphics too, borrowing my clock.c example in the z88dk tree.
The default look-and-feel is naked to permit the low resolution devices to act good, but it is possibe to pass a #define and get a graceful HR quadrant.
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Real Time Clock for ZX81

Post by olofsen »

Thank you - I've added a hires version to the above zip, incorporating your clock example :) There is some room for improvement; for example, It crashes not too gracefully if there is no network. The timer interrupt routine is a bit different to obtain 1% control.
User avatar
stefano
Posts: 542
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano »

A cool mesh-up of ideas and contributions, I like it !
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Real Time Clock for ZX81

Post by siggi »

This would also be a nice version of a ZeddyNet clock (at least in German speaking countries):

https://www.monsterzeug.de/Wortuhr.html

:mrgreen:
Siggi

Addendum: English version
https://www.amazon.de/WORTUHR-Tisch-Wor ... word+clock
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
Post Reply