6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 11:52 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Tue May 19, 2020 8:36 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
Not really a big issue, and not really looking to 'solve' it, just a peculiar observation.

Two SBCs of the same design, same board. One 65C02, one 65SC02.

Both systems running identical software, same hardware other than the CPU.

4.000 MHz can oscillators in both.

Time is kept with a 10ms timer from a 6522 triggering an NMI.

One system has lost 1s of time vs the other over the last 48 hours or so.

Very peculiar, and of no consequence to anyone or anything.

This seems well outside of the normal tolerance for Crystals to me, but checking the math again, maybe not!

Maybe I will hook the clock from one to the 2nd and run them off the same clock signal to see what happens.


Last edited by thedrip on Tue May 19, 2020 9:51 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue May 19, 2020 8:52 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
thedrip wrote:
One system has lost 1s of time vs the other over the last 48 hours or so.

Very peculiar, and of no consequence to anyone or anything.

This seems well outside of the normal tolerance for Crystals to me, but checking the math again, maybe not!

If they're truly specified for 4.000MHz, that's only four significant figures, whereas 1s after 48 hrs is more than five significant figures. Even if the oscillator frequency error were spec'ed to be <0.001%, 1s after 48 hrs would still be within spec. If it does become a problem, your time-keeping ISR could take in a correction factor where it adds or subtracts one tick for every so many.

Edit: Did you mean to make the title, "Re: When [not 'which'] is 4.000MHz not 4.000MHz?"? You can still edit it.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue May 19, 2020 9:53 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
GARTHWILSON wrote:
Edit: Did you mean to make the title, "Re: When [not 'which'] is 4.000MHz not 4.000MHz?"? You can still edit it.


Yes, yes I did. Thanks for the math clarification.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 12:23 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
thedrip wrote:
Two SBCs of the same design, same board. One 65C02, one 65SC02...One system has lost 1s of time vs the other over the last 48 hours or so.

That's an error rate of 1 second in a 172,800 seconds period, or a drift of approximately 0.0005 percent. If you are using a 100ppm oscillator (a common part) that drift rate would be out-of-spec—maximum drift in a 100ppm oscillator would be 0.0001 percent. Just for grins, try swapping oscillators between the two units and note if the "error" moves with the one oscillator.

BTW, are you sure the interrupt generated by the VIA is being correctly processed? A occasional missed interrupt would cause your clock to gradually slow down.

Also, note that a 100ppm spec doesn't guarantee the oscillator is operating at the stated frequency. That spec refers to drift. The oscillator could be within its rated drift and just be oscillating a bit too slowly. Take a look at the data sheet and see what the percent accuracy is for the oscillator you are using.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 12:45 am 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
I have 1 oscillator from Jameco, it kept perfect time for over 6 months. This 2nd oscillator is a China special. I think I know which one to suspect!

Like I said, no impact to anything, just funny to see two "identical" SBC's turn out to be not quite identical.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 3:33 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
thedrip wrote:
I have 1 oscillator from Jameco, it kept perfect time for over 6 months. This 2nd oscillator is a China special. I think I know which one to suspect!

Like I said, no impact to anything, just funny to see two "identical" SBC's turn out to be not quite identical.

As with everything else, you only get what you pay for. You might be a little surprised to learn that the oscillator you got from Chinese vendor is a 500ppm part with questionable frequency accuracy.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 6:10 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
Found a data sheet for what it's labelled as. I of course don't trust the label at all, but the datasheet calls it a +- 0.1% part, so no surprise that the time keeping isn't very accurate!

I have a 5 pack of these, some day I will put a them on a frequency counter and see just how far off nominal they are.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 6:21 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
It makes sense to me: for a lot of purposes, 1000ppm is enough, and it'll be easier to make, so it can be cheaper.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 6:29 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
If I didn't have two displays side by side, I wouldn't have noticed.

1 minute fast over 3-4 months? Close enough!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 6:38 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
thedrip wrote:
If I didn't have two displays side by side, I wouldn't have noticed.

1 minute fast over 3-4 months? Close enough!


Close enough, indeed! My microwave oven gains a minute a week...

Aaaaannndddd.... 3-4 months without hitting reset? That's (a) impressive, and (b) means you need to tinker more ;-)

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 8:44 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
thedrip wrote:
If I didn't have two displays side by side, I wouldn't have noticed.

1 minute fast over 3-4 months? Close enough!

That much drift isn't bad. I have a digital alarm clock here that loses about 5 minutes per month. Now, you'd think a clock plugged into line power would refer to the (very accurate) line frequency for a time base, but apparently not in this case.

BTW, I must've gotten lucky with the 3.6864 MHz oscillator that's in my POC V1.2 unit. According to the logic analyzer, the actual output frequency is 3686397 Hz, based upon a sample rate of 5ns. That's an accuracy of 99.9999 percent. That oscillator is the time base for both DUARTs, one of which generates a 100 Hz jiffy IRQ, which in turn, drives the system uptime and time-of-day software clocks. Assuming the oscillator doesn't drift, the uptime and time-of-day will be about 32 seconds slow over a one year period, an average loss of 2.67 seconds per month. Based upon past experience, that's actually better than the real-time clock accuracy of most server motherboards.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 9:05 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
drogon wrote:
thedrip wrote:
If I didn't have two displays side by side, I wouldn't have noticed.

1 minute fast over 3-4 months? Close enough!

Close enough, indeed! My microwave oven gains a minute a week...

That means when you pop some popcorn it gets done a little sooner. :D

Quote:
Aaaaannndddd.... 3-4 months without hitting reset? That's (a) impressive, and (b) means you need to tinker more ;-)

http://forum.6502.org/viewtopic.php?f=4&t=1457&start=270#p29284

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 9:13 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
My uptimes aren't nearly as impressive. My machine sits in a BASIC loop redrawing Mandelbrot sets in different colors.

My not nearly as impressive or informative Youtube video.
https://www.youtube.com/watch?v=5WBXG1EIiCY


Top
 Profile  
Reply with quote  
PostPosted: Wed May 20, 2020 9:25 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
thedrip wrote:
My uptimes aren't nearly as impressive. My machine sits in a BASIC loop redrawing Mandelbrot sets in different colors.

My not nearly as impressive or informative Youtube video.
https://www.youtube.com/watch?v=5WBXG1EIiCY

The Mandelbrot display looks pretty good. Considering the math that is involved and the fact that the grunt work is being done in a BASIC interpreter, performance is certainly acceptable for a 4 MHz machine.

A fun exercise would be to work out how to do the same in assembly language and see how much of a speed-up occurs.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 17, 2020 3:37 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
Borrowed a frequency counter, just to see...

The original oscillator I was using comes out at 3,999,940+-20 Hz.. max error of 15PPM is pretty acceptable.

The "questionable" Chinese oscillator has never been lower than 3,999,980 and usually hangs out in the 3,999,998 range, depending on room temp. I would say that 5PPM in a 20 degree temp range (65-85F) is perfectly good for ebay possibly-relabeled parts!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 65 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: