View previous topic :: View next topic |
Author |
Message |
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
Internal oscillator accuracy 16LF1825... |
Posted: Fri Dec 13, 2019 3:46 am |
|
|
Chip: 16LF1825
Running at 20 degree C.
Powered with 3V
Internal clock 8Mhz.
---
I have the same code in 15 chip all work nice but...
The timing is spot on in some chip, and in other off with 8%.
In the datasheet there are not so many information about the accuracy in the internal oscillator.
I see the problem in a sleep function where i wake the chip every 4 sec with the setup_wdt(WDT_4S);
It is not a random error, the chip there are spot on, are spot on all the time, and the other off all the time!
Is normal to have up to 8% internal oscillator accuracy? |
|
|
alan
Joined: 12 Nov 2012 Posts: 357 Location: South Africa
|
|
Posted: Fri Dec 13, 2019 4:54 am |
|
|
The watchdog timer can vary considerably.
On the 1825 it runs from the internal LFINTOSC which have a tolerance of +-25% if I read the datasheet correctly. |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Fri Dec 13, 2019 5:39 am |
|
|
I think you are right.
10.1
WDT is driven from LFINTOSC
30.2
LFosc +-25% typical 31Khz
30.5 from the datasheet, TwDTLP Low-Power wd timer:
Min=12ms Typ_16ms Max=20ms with 1:16 prescaler
That is the same as: 0,75/1/1,25 ms. And as you wrote +-25%.
This can be what i see at my hardware.
Thanks pointing me that way:-) |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9269 Location: Greensville,Ontario
|
|
Posted: Fri Dec 13, 2019 6:02 am |
|
|
I don't have the current datasheet, but the WDT spec is 10-27ms in mine, using the 1:16 prescaler.
Yes, it's a wide range
If my very early morning math is correct at the '4 second' setting, it can range from about 2.5 to 6.9 seconds.
You need to remember that the WDT is designed to reset the PIC when the program fails NOT to be used as an accurate Realtime clock.
The WDT gets it's signal from the internal UNCALIBRATED ! 31kHz oscillator , which is where the variation or range starts from. Different runs or batches of PICs will have different characteristic. If you connect a scope or freq counter to the CLKOUT pin, it should be Fosc/4 ( 31kHz/4) +-7750 Hz.
late edit... There's another 'math' problem that can creep in. The 31kHz can be +-2% from the datasheet I have. If you have 10 PICs, 9 can be running at -2% speed and one running at +2% speed. They ALL are within the spec limt BUT there's a 4% difference between them !!
Jay |
|
|
|