|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
Brown Out |
Posted: Mon Sep 28, 2009 8:34 am |
|
|
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
|
|
Posted: Mon Sep 28, 2009 12:23 pm |
|
|
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 |
Posted: Mon Sep 28, 2009 12:26 pm |
|
|
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
|
|
Posted: Mon Sep 28, 2009 12:41 pm |
|
|
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
|
|
Posted: Mon Sep 28, 2009 12:58 pm |
|
|
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 |
|
|
|
|
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
|