I am looking for a good method to determine my calibration settings for the CY14B064 using an existing micro processor
I have the INT/SQW pin connected to an interrupt pin of the processor and I can measure the 512 calibration square wave but i battle to tell the difference between the correct 512hz and the actual frequencey of the square wave as the micro controller has a 80nS time per instruction and if i am correct i need to be able to detect 1.953nS per PPM drift.
Is there a way to do this cleverly? I thought of counting 100 cycles of the 512hz signals and then dividing that by 100 to get the average?
Ideally i would to have the micro do this for me to avoid having each board checked with a frequency counter and then manually "calibrated"
Can i use the 1hz signal to try and measure the error of the clock?
It would be difficult to measure with the onboard micro controller mainly due to the uncertainty over the controller clock accuracy. When the 512Hz is averaged over say 100 cycles, this error adds up in each cycle. Can you use an external oscillator to the microcontroller so that the reference is fixed ? If yes, then you can use timer/counter module of the microcontroller to average the 512Hz signals.
Otherwise I guess you would need a fixed/calibrated external measuring equipment to calibrate all boards.
Thank you for the feedback
I have a fixed controller clock so that may be a good option
I would prefer not to calibrate the clock using calibrated equipment as the temperature at time of calibration will not be the same as the temperature at time of operation
I have also seen that that the 32KHZ clock signal used for the clock is not a very good waveform and this may be the issue
I have attached a scope pic, would you be able to suggest where i should look to solve such issues?
To add information to the question
We started off with Y1 = 32.768 KHz (12pF), XOUT C1 = 12 pF, XIN C2 = 68 pF
Which are as close to the datasheet as possible
I set the SQWE to 1 and SQ1, SQ0 both to 1 to have the CY14C064PA output set to 32768Hz
I have two boards with identical software but different layouts
Board 1 measures 32768Hz and board 2 measures 32766Hz
I have swapped all components between both boards and the accuracy follows the CY14C064PA device
Is this a valid test as i am not using the prescribed 512Hz signal?
I am not using the 512Hz signal as my resolution on the frequency counter does not show enough significant digits
On the 32768Hz signal, you can still use it instead of 512Hz.
I don't have experience of using controller to calibrate the RTC.
If the controller clock is accurate enough across all boards,
using a timer/counter module to count atleast 10000 positive or
negative edges of 32768Hz might give good ppm error (considering 80ns clock inccuracy).
I will check internally and update more info on this.