CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Internal oscillator accuracy 16LF1825...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hmmpic



Joined: 09 Mar 2010
Posts: 314
Location: Denmark

View user's profile Send private message

Internal oscillator accuracy 16LF1825...
PostPosted: Fri Dec 13, 2019 3:46 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 13, 2019 4:54 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Dec 13, 2019 5:39 am     Reply with quote

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: 9168
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Dec 13, 2019 6:02 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group