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

PIC12F509 Oscal Init Issue

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



Joined: 12 Mar 2005
Posts: 7

View user's profile Send private message

PIC12F509 Oscal Init Issue
PostPosted: Sat Mar 12, 2005 5:45 pm     Reply with quote

Re: PIC12F509

I discovered that at power up, the OSCAL value is not correctly loaded. It gets random data. I have confirmed that the PCB C Compiler, Version 3.221, is correctly generating the "MOVWF 05" at address 0000h. My OSCAL value is valid (factory data is intact and has not been altered).

But, here is the kicker. Upon wakeup-from-sleep, the OSCAL is correctly loaded with the factory constant. So, my workaround fix is to boot upon battery installation, go to sleep, then wakeup as soon as the user presses the start button. This is fine, but I would like to understand why I experienced the problem so that I can avoid it in the future.

Because of what I observed, I suspected my power source was involved, which is 2 fresh AA cells (3.0VDC). But moving the project to a very well regulated 5.0VDC bench supply did not correct the issue.

Anyone else run into this oddity?

-Thomas
Ttelmah
Guest







PostPosted: Sun Mar 13, 2005 5:00 am     Reply with quote

Simlar problems exist with a number of chips, if the supply rises enough to 'start', but is not high enough to give proper operation, when the oscillator begins. Without seeing the supply circuit, and how it is attached, it is hard to be sure what is going on, but (for example), if there is significant supply line capacitance, the rate of rise of the supply rail through this critial voltage range, may be significantly slower with the battery supply, than with the bench PSU. There are some critical questions. What is your oscillator?. Are you drinving MCLR?. Basically the biggest problem is usually that the oscillators take some time to start, and can cause problems if the chip starts before they have stabilised. The reset delay timer, is designed to make this less of a problem, but it can still occur. You could also be starting, then reading the OSCCAL value OK, but losing the value with a form of brownout, if instructions early in the boot, suddenly increase the battery load, before the rail has fully risen. What clock rate are you running?. How is the supply connected?. These will both affect how much margin there is...
There is a specification for the rise 'rate' of the supply rail in V/mSec, and if your battery supply does not achieve this, it would cause this type of problem.

Best Wishes
thomasb



Joined: 12 Mar 2005
Posts: 7

View user's profile Send private message

PostPosted: Sun Mar 13, 2005 3:12 pm     Reply with quote

MCLR is disabled (used as an input). The power supply is not burdened with slow rise times -- the only cap is a single .1uF mono ceramic across the PIC (short leads). The leads to the power supply are short too (under 1.5 inches).

This is a simple circuit. A PIC12F509 (not PIC12C509), one decoupling cap, a push switch, and piezo alerting device. The problem occurs with the 3V battery (two AAA cells) as well as with a precision 5.0V bench supply.

I have created several dozen commercial PIC12C508/509 designs and have never experienced an OSCAL problem before. However, this is the first time I have used a PIC12F509, so perhaps it is related to this newly released flash part.
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