View previous topic :: View next topic |
Author |
Message |
Guitarplayer Guest
|
Brown out reset |
Posted: Mon Oct 01, 2007 12:08 pm |
|
|
Hi All,
I am using a PIC16F688 and from what I understand, by reading the datasheet, is that the brown-out reset can be enabled or disabled by software. Does this mean I can enable/disable it in the "main program"?
If so what would be the command for this? I looked at the CCS help but can't find it.
Thanks for the help. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Oct 01, 2007 12:28 pm |
|
|
There's a fuse setting for it. It's in the 16F688.H file.
That enables the feature. I don't think there's a CCS function to turn it
on/off in software. You have to write directly to the register bit.
You can use a #bit statement to declare the address of the PCON register
and the bit position of the SBODEN bit within it. Then you can write
a line of code in main(), and set the SBODEN bit to 0 or 1, as required.
Look in this section of the data sheet to find the address of the PCON
register and the bit position of the SBODEN bit.
Quote: | PIC16F688 SPECIAL FUNCTION REGISTERS SUMMARY BANK 1 |
|
|
|
Guitarplayer Guest
|
|
Posted: Mon Oct 01, 2007 1:03 pm |
|
|
Ok, the datasheets says the address of PCON register is 8Eh and the SBOREN is Bit5 of the PCON register.
So the code would look like this:?
declaration:
#bit BOR=0x8E.5
enabling the brownout-reset:
BOR=1;
Thanks for the input! |
|
|
Guitarplayer Guest
|
|
Posted: Mon Oct 01, 2007 1:07 pm |
|
|
Forgot to mention that the fuse for the software controlled brown out reset for my CCS compiler is:
#FUSES BROWNOUT_SW |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guitarplayer Guest
|
|
Posted: Mon Oct 01, 2007 1:30 pm |
|
|
Thanks for the remark. I realized that as I was trying to test that feature and went back to the datasheet only to find out that it was bit 4 and not bit5.
Thanks again! It works now! Greatly appreciate the help! |
|
|
libor
Joined: 14 Dec 2004 Posts: 288 Location: Hungary
|
|
Posted: Tue Oct 02, 2007 4:06 am |
|
|
I have a related question.
If I got it right, brownout is a power voltage level condition, under this voltage level the PIC's operation becomes unstable/unpredictable, isn't it ?
I just keep thinking what might be the reasons for not enabling the brownout reset function in my applications... |
|
|
grasspuddle
Joined: 15 Jun 2006 Posts: 66
|
|
Posted: Wed Oct 03, 2007 7:41 am |
|
|
The low voltage versions of pic chips can still operate down to 2v. So if someone wants their program to still function they need to disable the reset. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Oct 03, 2007 9:42 am |
|
|
libor wrote: | I have a related question.
If I got it right, brownout is a power voltage level condition, under this voltage level the PIC's operation becomes unstable/unpredictable, isn't it ?
I just keep thinking what might be the reasons for not enabling the brownout reset function in my applications... | The only reason I can think of for disabling the BOR is for power saving reasons (about 50uA on the PIC18F458 (old model) and PIC18F8722 (nanowatt)). Note that the BOR is sharing large portions of circuitry with the LVD module which has to be disabled as well for this power saving to be achieved.
I rather have a stable processor than saving a tiny bit of power so have BOR always enabled. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Oct 03, 2007 11:30 am |
|
|
If you handle the brown out situation yourself, then you may want the extra time to say,
save some settings to eprom.
This is a time you wouldn't want the pic to reset.
you want the max run time possible.
just a thought |
|
|
|