Real Time Clock for ZX81

Discussion about ZX80 / ZX81 Software
Post Reply
David G
Posts: 44
Joined: Thu Jul 17, 2014 7:58 am

Real Time Clock for ZX81

Post by David G » Thu Jul 31, 2014 8:04 am

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 82 times

Moggy
Posts: 1704
Joined: Wed Jun 18, 2008 2:00 pm

Re: Real Time Clock for ZX81

Post by Moggy » Thu Jul 31, 2014 12:08 pm

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: 44
Joined: Thu Jul 17, 2014 7:58 am

Re: Real Time Clock for ZX81

Post by David G » Fri Aug 01, 2014 12:59 am

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 » Tue Jan 27, 2015 12:29 am

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: 378
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano » Mon Jul 13, 2015 10:17 am

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: 156
Joined: Wed Jan 08, 2014 12:29 pm

Re: Real Time Clock for ZX81

Post by olofsen » Tue Jul 14, 2015 9:08 am

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: 378
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano » Fri Jul 17, 2015 3:48 pm

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: 156
Joined: Wed Jan 08, 2014 12:29 pm

Re: Real Time Clock for ZX81

Post by olofsen » Sat Jul 18, 2015 8:06 am

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: 378
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Real Time Clock for ZX81

Post by stefano » Sat Jul 18, 2015 6:43 pm

A cool mesh-up of ideas and contributions, I like it !

User avatar
siggi
Posts: 875
Joined: Thu May 08, 2008 9:30 am
Location: Dauernheim, Germany
Contact:

Re: Real Time Clock for ZX81

Post by siggi » Thu Aug 02, 2018 12:22 pm

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
http://zx81-siggi.endoftheinternet.org/index.html

Post Reply