Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Excact Vertical Frequency / Refresh Rate
2017-07-18 21:22
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....
 
2017-07-19 23:01
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.
2017-07-20 09:44
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.
2017-07-20 12:31
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.
2017-07-20 19:01
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?
2017-07-20 19:12
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 ....)
2017-07-20 19:29
Compyx

Registered: Jan 2005
Posts: 631
What about using NTP via RRNet? Sounds fun to do.
2017-07-20 20:53
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.
2017-07-21 07:19
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 :)
2017-07-21 12:20
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)
2017-07-21 20:52
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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
LightSide
St0rmfr0nt/Quantum
Flashback
Paladin/G★P
RetroGL
Nith/TRIɅD
CreaMD/React
pcollins/Quantum
Guests online: 87
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.