Pause Function - useful for a Clock?
-
- Posts: 34
- Joined: Tue May 03, 2016 12:42 pm
Pause Function - useful for a Clock?
Hi guys (gals),
I wrote a small program to (sort of) be a clock.
The idea is you have to enter the current time and then the clock should "go" on it's own.
How reliable is the Pause command for something like this? Or is there a better way? Pause 120 seemed to be as close to 1 second as I could get using ZX81 with my laptop.
I'm a bit of a newbie so thanks for bearing with me!
Thanks!
John
I wrote a small program to (sort of) be a clock.
The idea is you have to enter the current time and then the clock should "go" on it's own.
How reliable is the Pause command for something like this? Or is there a better way? Pause 120 seemed to be as close to 1 second as I could get using ZX81 with my laptop.
I'm a bit of a newbie so thanks for bearing with me!
Thanks!
John
Re: Pause Function - useful for a Clock?
Run for 30 minutes check your time and you will see how accurate 'tis.
If you add anymore lines in your loop, will the duration of it increase and the clock slow?
If you add anymore lines in your loop, will the duration of it increase and the clock slow?
5-TS1000,UK ZX81<-Sheelagh, US ZX81, 2-TS1500/KDLX , 3-TS2040 printer, 2-TS2020 cassette decks, ZXPAND+AY, ZeddyNET, ZXBlast, UDG, ZX8CCB, AERCO, BUILDS/REPAIRS ZX Spectrum, ZX80 Minstrel, ZXMAX48 v1 v2, 2-TS-2068, ROM, 16kRAM
Re: Pause Function - useful for a Clock?
In Wilf's NOVA the clock is hooked into the display routine and is updated with 50/60 Hz AND runs concurrently to the BASIC program (and can be read and set by the BASIC program):johnnyrockets wrote:Hi guys (gals),
How reliable is the Pause command for something like this? Or is there a better way?
Code: Select all
1. Increased horizontal line length with up to 34 characters per line.
2. Increased number of lines with up to 29 lines (in 50Hz mode)
3. No N/L character (CHR$ 118) required to terminate video lines.
4. Sliding display window on memory permits horizontal and vertical scrolling.
5. Rapid switching of Display files facilitates screen animations.
6. Increased execution speed with smaller screen displays for fast action.
7. View contents of large A$ string array directly
In addition to these display features, NOVA1000 includes several new system
utilities such as
1. Repeating keys.
2. 100 Hour clock/timer
3. BASIC line number trace.
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
http://zx81.ddns.net/ZxTeaM
- 1024MAK
- Posts: 5118
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Re: Pause Function - useful for a Clock?
Keep in mind that a real ZX81 or TS1000 uses a resonator rather than a quartz crystal, so the 6.5MHz ULA clock signal is not very accurate over long time periods. So a real machine will lose or gain a surprising amount over 12 hours, let alone a few days
Mark
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp
Standby alert
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb
Looking forward to summer later in the year.
Re: Pause Function - useful for a Clock?
1024MAK wrote:Keep in mind that a real ZX81 or TS1000 uses a resonator rather than a quartz crystal, so the 6.5MHz ULA clock signal is not very accurate over long time periods. So a real machine will lose or gain a surprising amount over 12 hours, let alone a few days
Mark
Agreed as anyone who has tried the "real time clock" listing in the Skywave forth ROM manual will testify, unreal time clock would be a more fitting description.
Inaccurate over the space of two hours let alone twelve.
-
- Posts: 34
- Joined: Tue May 03, 2016 12:42 pm
Re: Pause Function - useful for a Clock?
1024MAK wrote:Keep in mind that a real ZX81 or TS1000 uses a resonator rather than a quartz crystal, so the 6.5MHz ULA clock signal is not very accurate over long time periods. So a real machine will lose or gain a surprising amount over 12 hours, let alone a few days
Mark
Maybe not such a good clock then!
Thanks! I did not know that!
JR
-
- Posts: 34
- Joined: Tue May 03, 2016 12:42 pm
Re: Pause Function - useful for a Clock?
Moggy wrote:1024MAK wrote:Keep in mind that a real ZX81 or TS1000 uses a resonator rather than a quartz crystal, so the 6.5MHz ULA clock signal is not very accurate over long time periods. So a real machine will lose or gain a surprising amount over 12 hours, let alone a few days
Mark
Agreed as anyone who has tried the "real time clock" listing in the Skywave forth ROM manual will testify, unreal time clock would be a more fitting description.
Inaccurate over the space of two hours let alone twelve.
Funny what one gets themselves "into". I thought writing the clock would be simple. It is an exercise that I have done with many other modern languages, just for fun, but never with a retro computer.
Additionally, it is funny what one takes for "granted" in the modern computing world. Like Windows/Linux supplying the time and getting it right from the BIOS.
JR
Re: Pause Function - useful for a Clock?
Wilf's clock is "flex"-timeclock! It is ok for people on flextime... like myself. I am sometimes early... sometimes late!
5-TS1000,UK ZX81<-Sheelagh, US ZX81, 2-TS1500/KDLX , 3-TS2040 printer, 2-TS2020 cassette decks, ZXPAND+AY, ZeddyNET, ZXBlast, UDG, ZX8CCB, AERCO, BUILDS/REPAIRS ZX Spectrum, ZX80 Minstrel, ZXMAX48 v1 v2, 2-TS-2068, ROM, 16kRAM
Re: Pause Function - useful for a Clock?
You need some external hardware for a clock.
Maybe you could use ZeddyNet to sync the clock with an Internet server.
Maybe you could use ZeddyNet to sync the clock with an Internet server.
Re: Pause Function - useful for a Clock?
You may write a clock program and give some correction factor manually based on your specific ZX81.
So let it run 1 hour, count the mismatch in seconds, divide 3600 seconds with your determined deviation and you adjust your time every 200 seconds or what it is by adding or subtracting one second. I think the frequency of your personal Zeddy won't change and can be treated more or less as constant.
So let it run 1 hour, count the mismatch in seconds, divide 3600 seconds with your determined deviation and you adjust your time every 200 seconds or what it is by adding or subtracting one second. I think the frequency of your personal Zeddy won't change and can be treated more or less as constant.