wp100
Advanced Member level 6
- Joined
- May 15, 2009
- Messages
- 3,051
- Helped
- 884
- Reputation
- 1,783
- Reaction score
- 733
- Trophy points
- 113
- Location
- Prime Meridian
- Activity points
- 0
Hi,
They are as close to the pcb as you can get which is good, though smd for early development work can make things difficult.
Cannot see any signs of your 20mhz crystal which should also be close to the pic ..? -any reason you are not using the 8mhz internal oscillator ?
Crystals are said to be delicate things, though I have not have any problems soldering them.
Always use the Count to Three seconds as you are soldering, if the joint is not complete by then, stop and let the component cool before reworking.
Being as that bit of code I posted works fine on my 16F, running in front of me now, you really should try it on yours as it should prove where the problem is.
initial tolerance (df/f0) -500 to 500 ppb @Vc = 2.5 V; 25 °C
vs. supply voltage change (df/f) -20 to 20 ppb static; 5 V ±5 %
vs. load change (df/f) -20 to 20 ppb static; Load ± 10 %
vs. aging / daily (df/f) <± 10 ppb after 30 days ; @ 25 °C
vs. aging / month (df/f) <± 200 ppb after 30 days ; @ 25 °C
vs. aging / year (df/f) <± 500 ppb after 30 days ; @ 25 °C
vs. aging / 10 years (df/f) <± 3 ppm after 30 days ; @ 25 °C
The 16f88 datasheet suggest using an external temperature sensor and a lookup table of temperature-to-oscTune values to get "an accurate RTC" from the 16f88...Frequency calibrated at 25°C. OSCTUNE register can be used to compensate for temperature drift.
Hi,
I have 2 devices running 24/7 with a 32k Timer1 ISR RTC so will check their times /accuracy overnight and let you know the results
Hi,
Ok, so checking the Timer1 Flag has improved things, but is the timer one second fast or one second slow in the 3 hours ?
I run on 22pf, if I remember correctly 33pf will make it run slower....
You could try 27, 22, or 15 pf and see how that affects things.
What accuracy are you aiming for ? 1 second a day, 1 second a week ?
Don't forget that if you establish a sound design but its still slightly out, you can always make a software adjuster to compensate for the error rate.
Seem devices like the DS1307 RTC use a 32k crystal with 12.5pf internal caps, but they just say accuaracy is down to the crystal used and pcb layout - see their datasheet.
I have 2 devices running 24/7 with a 32k Timer1 ISR RTC so will check their times /accuracy overnight and let you know the results
You need a counter to measure instantaneous error or a phase detector and some reference clock that is much more stable. !!
Best test some called a Schmoo plot back in the 80's for some reason.. Vary Temperature vs voltage +/- and measure error.
Also what P/N are you using. Is it crystal or Tuning fork type? Do you have adequate filter on Vdd supply and shielding to prevent errors? I suggest you find a stable reference freq to compare. Many sources are broadcast if you can tune a cheap stable 1ppm TCXO. then using counters or PLL compare phase error drift within 1 second
They all have supply sensitivity and temp sensitivity to some degree but it is possible to correct.
Answers pls?
hello,
As wp100 said, the best way, is to use interrupt with timer1, to
be sure to catch the timer overflow at the front edge of timer overflow not at the level of bit 7.
because bit 7 of TMR1H is set beetween F0 value and FF value !
so error can be very big ! => big aleas of detection
You need to test TMR1 interupt flag , not TMR1H ...
even you don't use interrupt
in your 16F88 program
what does
movf TMR1H,W ;?????
in the pool check ?
Advanced bresenham timing techniques
Clock xtal super-fine calibration.
The int period and 1second period value can both be multiplied by the same number, giving an increase in the timer resolution much greater than the original resolution of the xtal value in Hz.
This next example uses a PIC with 1Mhz xtal, and testing against a GPS receiver over a month shows the PIC clock is 9 seconds fast. So the 1second correction value is calculated as;
(1month+9secs) / 1month which in seconds is; 2678409 / 2678400
Which is 1.0000033602
Multiply by 1Mhz to give the correct 1 second period; = 1000003.3602 ticks
I have not tried the ISR version of RB.
I am getting better results, now I have 1 second in 8 and half hours.
hello
so, what changes did you apply in your code to get this quiet normal result.
Thank you for your suggestions, but at the moment I am on low budget and I cannot spend any dollar more on this, although $4 is not a lot.Sorry, I was trying to save you time and explore all the options. If you want to save development time, tools are critical and a time and frequency reference for short term accurate results has always been useful for me to isolate problems.
In post 24 I offered many solutions depending on stability, but again in post 32 I reminded you the lowest cost solution is a few dollars. Digikey has stock and can ship same day. If you don't have a breadboard or a counter or any other tools, I would suggest getting one. https://www.digikey.com/product-detail/en/532L25DT19M2000/CTX808CT-ND/1939234 $3.48 2.5 ppm is a crystal Temperature Compensate Crystal(X) Oscillator or TCXO. If I you need more advise on how to use it let me know. Do you have a scope?
Waiting an hour or a day to measure error is too late.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?