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

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








Brown Out
PostPosted: Mon Sep 28, 2009 8:34 am     Reply with quote

Hi
I am working on PIC for the first time. I am trying to Brown out reset in my code.

If I set the fuse BROWNOUT and set the brown-out threshhold voltage is it sufficient??

Please let me know what is the procedure to handle brown-out.

Thanks
Sach
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 28, 2009 12:23 pm     Reply with quote

Always post your PIC (and compiler version). Different PICs have different Brownout features available. We can give you a better answer
if we know your PIC.
Guest








Brown out
PostPosted: Mon Sep 28, 2009 12:26 pm     Reply with quote

Hi all,

I am using PIC18F2680 , and I am using CCS PCWH Ver. 4.092.

Thanks
Sach
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 28, 2009 12:41 pm     Reply with quote

When the PIC has settable brownout voltages, it's sufficient just to
put in the BORVxx fuse. You don't have to also put in the BROWNOUT
fuse (though it doesn't hurt anything if you do). Example:
This will set the Brownout voltage at 4.6 volts:
Quote:

#include <18F2680.h>
#fuses HS,NOWDT,BORV46,PUT,NOLVP
#use delay(clock=20000000)

//=================================
void main()
{


while(1);
}

This PIC also has a software enable/disable feature for Brownout, but
that's an advanced feature that you probably don't need. It's not used
in the program above.
Ttelmah
Guest







PostPosted: Mon Sep 28, 2009 12:58 pm     Reply with quote

You can also get more 'complex', in brownout handling.
Your code can test the restart_cause, and (for example), restart without initialising some hardware, or particular variables, in the event of a brownout restart. This is up to _you_, and dependant on your hardware.
The PIC's brownout restart, is there to reset the CPU, if the incoming voltage drops to a voltage where the chip (or some other peripherals), may not otherwise reset, but _might_ enter a unknown behaviour state.
So long as your code is written to restart in a safe way, restarting, is the simplest, and safest way to proceed, and requires nothing further, than setting up the chip.

Best Wishes
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