Clock
Moderator: BigEvilCorporation
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
Clock
(I posted this on another forum, but that forum is a tad slow.. so hopefully someone here can help-----and for the record, im basing time from vertical blanks)
I made a clock a while ago for the Genesis, but I'm getting complaints that it looses times, like, within 10 minutes.. This didn't happen on my emulator (Genesis Plus for Macintosh)..
Can someone else test it for me on real hardware? I don't have a flash cart.. I wrote it on Basiegaxorz a while ago, I might have the source code still on my laptop...
http://blackevilweredragon.spymac.com/s ... index.html
Also, if this does have a problem, then that means my other application GenTimer would also have a problem, as it was based on the source of my clock..
I made a clock a while ago for the Genesis, but I'm getting complaints that it looses times, like, within 10 minutes.. This didn't happen on my emulator (Genesis Plus for Macintosh)..
Can someone else test it for me on real hardware? I don't have a flash cart.. I wrote it on Basiegaxorz a while ago, I might have the source code still on my laptop...
http://blackevilweredragon.spymac.com/s ... index.html
Also, if this does have a problem, then that means my other application GenTimer would also have a problem, as it was based on the source of my clock..
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
-
- Very interested
- Posts: 159
- Joined: Sat Feb 24, 2007 11:35 pm
- Location: San Antonio, TX
That's probably the problem, that it's not exactly 50 or 60 Hz. You either need to figure out what it really is, and hope that it doesn't vary much between consoles, or add a real-time clock chip.
But it's probably going to vary too much. I was looking at a bunch of the old Rex Sabio docs and noticed a tech note about the Xband modem. It said that any two average MD consoles can be expected to have their vertical sync counters go out of sync within two minutes.
Maybe if there was some way to configure it with a joypad to run faster or slower (add or remove one out of every few thousand vertical blanks), and display the tuning so you could re-enter it when you wanted to use it later.
It won't be useful here, but I know that you can get away with an inaccurate high-resolution counter if you have an accurate low-resolution counter like a real-time clock chip. I wrote a program on the Macintosh long ago which needed to have accurate timing for video subtitling, and I found out that setting up an interrupt handler for millisecond interrupts gave me somewhere between 1000 and 1100 interrupts per second. So I kept track of how long it was between real-time clock seconds changes and kept a running average over the last 10 seconds to get the scaling factor.
But it's probably going to vary too much. I was looking at a bunch of the old Rex Sabio docs and noticed a tech note about the Xband modem. It said that any two average MD consoles can be expected to have their vertical sync counters go out of sync within two minutes.
Maybe if there was some way to configure it with a joypad to run faster or slower (add or remove one out of every few thousand vertical blanks), and display the tuning so you could re-enter it when you wanted to use it later.
It won't be useful here, but I know that you can get away with an inaccurate high-resolution counter if you have an accurate low-resolution counter like a real-time clock chip. I wrote a program on the Macintosh long ago which needed to have accurate timing for video subtitling, and I found out that setting up an interrupt handler for millisecond interrupts gave me somewhere between 1000 and 1100 interrupts per second. So I kept track of how long it was between real-time clock seconds changes and kept a running average over the last 10 seconds to get the scaling factor.
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
evildragon wrote:perhaps if i take one of those old Dallas RTC "blocks" from an old motherboard, I can use one of those? I'd have to figure out how they work though..
I think they contain a crystal, IC, memory, AND a battery.. not sure..
Yeah you can, Just look at the datasheet, it explains how to use it, and they don't contain batteries or crystals, but they are nearby on the motherboard, but forget about emulation.
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
actually, the old Dalas RTC do have a battery, check the datasheetJorge Nuno wrote:evildragon wrote:perhaps if i take one of those old Dallas RTC "blocks" from an old motherboard, I can use one of those? I'd have to figure out how they work though..
I think they contain a crystal, IC, memory, AND a battery.. not sure..
Yeah you can, Just look at the datasheet, it explains how to use it, and they don't contain batteries or crystals, but they are nearby on the motherboard, but forget about emulation.
http://www.mcamafia.de/mcapage0/dsrework.htm
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
-
- Very interested
- Posts: 159
- Joined: Sat Feb 24, 2007 11:35 pm
- Location: San Antonio, TX
8bitwizard, you said that master clock frequency can vary on different SMD units? How that can be possible, with master clock which driven by quartz generator with very exactly known frequency?
Last edited by Shiru on Fri Aug 03, 2007 3:08 pm, edited 1 time in total.
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Hmm, my 20year old Dallas RTC brick that I got from a 286 still works, never had to set the time again... but these have these stupid Address+Data lines which will make getting data out from them little more difficult...
Use of YM2612 timers give very stable results... but I want to know what results NTSC machines give... they have slightly different master clock... PAL machine has 53.203424(or 242)MHz OSC...
Use of YM2612 timers give very stable results... but I want to know what results NTSC machines give... they have slightly different master clock... PAL machine has 53.203424(or 242)MHz OSC...
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
-
- Very interested
- Posts: 374
- Joined: Mon Jun 11, 2007 3:09 am
- Location: Azeitão, PT
I saw it, but it's kinda risky, at the first glance, well you are ripping/drilling/cutting the chip's package, if your hand shakes or slippers->probably RTC dead...evildragon wrote:Read the link I posted, shows how to hack an external battery for it....
But mine still work anyway.......luckily...
still works? then learn how to read the time from it, and you're set.
-
- Very interested
- Posts: 326
- Joined: Mon Mar 12, 2007 1:53 am
- Contact:
the block isn't a chip.. there's a chip IN the block.. the block is a chunk of potted plastic..Jorge Nuno wrote:I saw it, but it's kinda risky, at the first glance, well you are ripping/drilling/cutting the chip's package, if your hand shakes or slippers->probably RTC dead...evildragon wrote:Read the link I posted, shows how to hack an external battery for it....
But mine still work anyway.......luckily...
still works? then learn how to read the time from it, and you're set.