chipKIT® Development Platform

Inspired by Arduino™

chipkit oscillator

Created Tue, 16 Apr 2013 14:34:42 +0000 by orly_andico


orly_andico

Tue, 16 Apr 2013 14:34:42 +0000

hello all,

I have a Max32 and it looks like it has an 8MHz crystal on it.

is this correct? or is it some form of crystal oscillator?

i am having problems with clock stability on my mega2560 due to the :twisted: ceramic resonator :oops: on it.

but when i used the Max32 instead, I got an even bigger clock skew (am just using the millis() function), so am not sure if the oscillator is really a crystal or not.


majenko

Tue, 16 Apr 2013 23:09:52 +0000

The part listed on the schematic is a FQ7050-8.000, which is an "All Quartz SMD Crystal". ±30PPM.

However, the data sheet specifies a load capacitance of 10pF, but the schematic is showing 30pF capacitors on there - that could be skewing the clock frequency slightly. I don't have an accurate enough scope to test the frequency (mine is an old analogue one), but if someone has a nice fancy new digital one that can see if that crystal is actually resonating at 8MHz, that would be good to know.

That said, I never recommend millis() for accurate timing. On the chipKIT it should be better than the Arduino as it runs from the "core" timer, which is more designed for this kind of thing than an arbitrary timer peripheral that could be affected by other interrupts firing (the pic32 has multiple interrupt priority levels, but I'm not sure what level the core timer is running at off hand). The core timer is a free-running counter that runs at the frequency of the CPU - basically counts clock ticks - so should maintain accuracy despite interrupts and other things happening. Getting it right though, and handling rollovers and delays in reading the counter value, is not an easy task. In the RetroBSD project we have for some time had an issue with clock drift that is related to calculating the number of core "ticks" we have missed while doing other things (how do you cope with 2 rollovers?)


Jacob Christ

Sun, 05 May 2013 10:15:10 +0000

I'm looked at the clocks before with my fancy digital Tek scope (thank you eBay) and they look pretty good.

What do you mean by clock skew? I think of clock skew as a timing problem due to propagation delay in a digital circuit. What exactly are you trying to do and what is going wrong?

Jacob