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 CCS Technical Support

Brown out detect query

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



Joined: 06 Mar 2007
Posts: 92
Location: Pune,India

View user's profile Send private message AIM Address Yahoo Messenger

Brown out detect query
PostPosted: Mon Jul 21, 2008 8:10 am     Reply with quote

Dear sir,
I am using CCS PCM C Compiler, Version 4.073, 42663 & Pic 12f629 device.
I want to know is, if i enabled Brown Out Detect, then whenever brown out detect occurs this will clear the device RAM ? Also in my soft code if i add RESET_CPU(); that time start up code also executed ?
_________________
Thank You,
With Best Regards,
Deepak.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 21, 2008 12:15 pm     Reply with quote

Quote:
will this clear the device RAM ?

Download the 16F Reference manual for Reset:
http://ww1.microchip.com/downloads/en/DeviceDoc/31003a.pdf
Read section 3.1. It says what happens to non-SFR registers upon reset.
(i.e., they are not changed).
However, if you have #zero_ram in your program, or if you have static
global variables, then these ram locations will be zeroed upon reset.


Quote:
Also in my soft code if i add RESET_CPU(); that time start up code also executed ?

Download the 12D629 data sheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/41190E.pdf
Look at this section:
Quote:
TABLE 9-6: INITIALIZATION CONDITION FOR SPECIAL REGISTERS

It shows the Program Counter = 000h after a "Brownout Detect" reset.
This is the same as for "Power-on Reset". Therefore, all code that
executes at power-up will also execute at Brownout reset.

Read the CCS manual for the Reset_CPU() function. It says:
Quote:
reset_cpu( )
This is a general purpose device reset. It will jump to location 0 on PCB and PCM parts.


Then ask yourself why you want to put in program code to jump to 0,
after you just started at 0 because of a Brown-out reset.
vijay s



Joined: 20 Oct 2007
Posts: 17
Location: coimbatore,india

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Tue Jul 22, 2008 7:24 am     Reply with quote

i too have a doubt in brown-out.. actually the processor resets when the brownout occurs.if i have to store the current process state in EEPROM before processor resets(book keeping).. how to do it
_________________
with regards
vijay s
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Jul 22, 2008 8:27 am     Reply with quote

I think the common way is to use a ADC to monitor the main power feed.
Disable brown out. You want as much time to process as possible.
Then if it Vpp drops, start saving as much data as possible.
Use a large 1F cap to provide time to store data.
Then when done storing data, shutdown/reset. And then don't come back
out of reset until the main voltage is nice and stable.
http://www.maxim-ic.com/appnotes.cfm/appnote_number/3517/ln/en
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