| |
TWW
Registered: Jul 2009 Posts: 545 |
Excact Vertical Frequency / Refresh Rate
I am making a clock by using a CIA timer. Basically I calculate how many cycles are executed each second by calculating lines x cycles/line x vertical refresh rate.
I then want to make the clock run correct on all systems (NTSC/PAL/DREAN/NTSC_Old) and in this context, I was wondering what is the EXACT vertical refresh rates for these systems (50 and 60 plus 3 decimals or more)?
(I've found conflicting information around the web so that's why I'm asking) |
|
... 20 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
the TOD uses the power grid frequency - so you need to set it up according to that. if you want it to be 100% correct always, you need to measure the power grid frequency first, then set up the TODs 50/60Hz bit correctly. see this test program for inspiration: https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/CIA.. - you cant rely on the video system because eg on the SX64 its always 60Hz. |
| |
Style
Registered: Jun 2004 Posts: 498 |
I wouldnt use the power frequency (and thus the TOD) for anything that requires any accuracy at all.
Power grids are notoriously bad in terms of frequency. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
ehrm, no they are not. please read up on the topic. they are putting a lot of effort into keeping all grids in sync and keeping the frequency stable.
edit: to make it clear.... shorttime this is correct, the frequency may drift up and down quite a bit, sth like +/- 1% or so at max (it usually does so during the day - you can use the mentioned test program to examine this). however, the number of periods for long time periods (a weeek, a month... i dont remember what is guaranteed) is very accurate, and certainly ok to use for a wall clock. |
| |
soci
Registered: Sep 2003 Posts: 480 |
Not all C64s are running on the original brick any more. Some replacements use an inverter or are DC only except those with a small 9V transformer bolted on the side.
I didn't bothered to do an inverter and just installed a 555 next to the CIA and hand tuned it to ~50 Hz or so to keep the TOD running. Wondering how much ppm can it be ;)
Also the pre-scaler can't be reset so starting it accurately is problematic.
Therefore I rarely use the TOD and go with the timers instead, those always work.
Btw. is it possible to make a centisecond longer by switching it from 60 to 50 Hz pre-scaling at the right time? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
if you are running the C64 with some half-broken PSU... yeah no guarantees then =P
trying to confuse the centiseconds counter like you said SHOULD work imho ... kinda like opening the borders =) it should count to $f then and wrap around. make a test program and have a look (it will break on every emulator right now, i guess ....) |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
What about using NTP via RRNet? Sounds fun to do. |
| |
soci
Registered: Sep 2003 Posts: 480 |
I thought about that too.
But it'd be more fun to connect a RS232 GPS time receiver to the user port at 9.6 kbit/s with it's PPS output on CNT input of CIA.
Once synchronized it stays so without further effort ;) The NTP synchronization on the other hand needs to be repeated to compensate for any drift. |
| |
Style
Registered: Jun 2004 Posts: 498 |
Quote: ehrm, no they are not. please read up on the topic. they are putting a lot of effort into keeping all grids in sync and keeping the frequency stable.
edit: to make it clear.... shorttime this is correct, the frequency may drift up and down quite a bit, sth like +/- 1% or so at max (it usually does so during the day - you can use the mentioned test program to examine this). however, the number of periods for long time periods (a weeek, a month... i dont remember what is guaranteed) is very accurate, and certainly ok to use for a wall clock.
Dude. I work in power generation :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
burning speccies i hope :)
edit: care to give the exact numbers then? IIRC its worse in north america than in central europe (and its really terrible in other, less developed areas, i guess) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: burning speccies i hope :)
edit: care to give the exact numbers then? IIRC its worse in north america than in central europe (and its really terrible in other, less developed areas, i guess)
There are real time data for it: UK f.e. http://www2.nationalgrid.com/uk/Industry-information/electricit.. |
Previous - 1 | 2 | 3 - Next |