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

Distinguishing a brown out reset (BOR/) on PIC16f627

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



Joined: 07 Jun 2004
Posts: 1

View user's profile Send private message

Distinguishing a brown out reset (BOR/) on PIC16f627
PostPosted: Mon Jun 07, 2004 12:08 pm     Reply with quote

I have not been able to distinguish a brown out reset (BOR/) from a normal power on reset (POR/) on the PIC16F627.

I do realise that when a POR/ power on reset happens you must
set the BOR bit to be ready to tell if a brown out occurs latter,
(Then it will clear the BOR/ BIT) but when ever I attempt to simulate a Brown out by lowering the voltage VCC down from 5 to 4 volts the PIC does do a brown out reset, but then when I raise the voltage back up to 5 volts via turning the adjust knob on my variable power supply, I immediatly see a power on reset occur so therefore my code can not distinguish this from a BOR.

I thought you could generate a BOR/ reset without also generating a POR/
but it appears not to be so.

Joe
joe_kuss
Guest







The BrownOut Reset Answer for PIC16F627
PostPosted: Thu Jun 17, 2004 10:21 am     Reply with quote

My previous comments were correct. Very Happy
My problem was as follows.

#BYTE PCON_REG=0x8E
#BIT BOD_BAR=PCON_REG.0
#BIT POR_BAR=PCON_REG.1

This is the CCS compiler way to access these SFRs and bits in C.

The PIC "DS40300C" DATA SHEET FOR the 16F62X has a typo on page
24 where it says the address of the PCON register is 0x0C, it really is
0x8E as stated in a number of other places on this data sheet.

The above code snippet has been corrrected and now BOR acts like
I expected.

Joe
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