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

Setting BOR Enabled

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



Joined: 07 Feb 2008
Posts: 164

View user's profile Send private message

Setting BOR Enabled
PostPosted: Sat Dec 10, 2011 4:20 pm     Reply with quote

I am having a problem enabling BOR at 4.5 volts on a PIC18F4525. Using CCS PCWH 4.121 with MPLab 8.70 IDE. IDE in Release mode and compiled code. Flags set as below:
Code:


#include <18F4525.h>

#DEVICE ICD=TRUE
#DEVICE ADC=10  *=16                   //set adc resolution

#fuses H4,NOWDT,NOPROTECT,NOLVP,PUT
#fuses BORV45
#use delay(clock=32000000)
#use rs232(baud=4800, xmit=PIN_C5, rcv=PIN_C4,ERRORS,stream=PC)
#use rs232(baud=57600, xmit=PIN_C6, rcv=PIN_C7,ERRORS,Enable= Pin_B0,stream=RS485)



After successful compile, MPLAB Configure/Configuration bits reports:
RWRT PWRT disabled
BOREN Brown-out reset disabled in hardware and software
BORV Maximum setting

Actual operation of target reveals BOR is indeed not enabled.

Routinely have enabled BOR using CCS IDE.

Any suggestions? I'm sure it's something pretty stupid!

Thanks for the help
edmundopt



Joined: 08 Dec 2011
Posts: 15
Location: Portugal

View user's profile Send private message

PostPosted: Sat Dec 10, 2011 7:11 pm     Reply with quote

maybe use

Code:
#fuses BORSEN
JerryR



Joined: 07 Feb 2008
Posts: 164

View user's profile Send private message

PostPosted: Sun Dec 11, 2011 8:42 am     Reply with quote

edmundopt: Thanks for your reply. BOREN is not a valid flag for the PIC18F4525, and indeed it does produce a compiler error.

Anyone else have a suggestion? Is there a document anywhere that explains the CCS fuses?

Thanks
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Sun Dec 11, 2011 8:52 am     Reply with quote

These are the brown out fuses for that device.

NOBROWNOUT, BROWNOUT_SW, BROWNOUT_NOSL
BROWNOUT, BORV45, BORV27, BORV20
_________________
David
JerryR



Joined: 07 Feb 2008
Posts: 164

View user's profile Send private message

PostPosted: Sun Dec 11, 2011 9:36 am     Reply with quote

Thanks for the reply David

Yes, I see these combinations in 18F4525.h. However, no combination of these bits enable brown-our reset at 4.5 volts. This is confirmed by viewing the configuration bits in MPLAB after compiling in RELEASE mode. MPLAB reports:

BOREN Brown-out reset disabled in hardware and software
BORV Maximum setting


I have been having problems with an old project where EEPROM is being corrupted on either power-up or power down. Brown out reset should fix the problem and I can't enable it.

I would like to enable BOR at 4.5 volts with flags. Shouldn't the following combination provide this?

Code:

#include <18F4525.h>

#DEVICE ICD=TRUE
#DEVICE ADC=10  *=16
#fuses H4,NOWDT,NOPROTECT,NOLVP,PUT
#fuses BROWNOUT
#FUSES BORV45

#use delay(clock=32000000)
#use rs232(baud=4800, xmit=PIN_C5, rcv=PIN_C4,ERRORS,stream=PC)
#use rs232(baud=57600, xmit=PIN_C6, rcv=PIN_C7,ERRORS,Enable= Pin_B0,stream=RS485)


Thanks again for the group's help.
Ttelmah



Joined: 11 Mar 2010
Posts: 19436

View user's profile Send private message

PostPosted: Sun Dec 11, 2011 10:02 am     Reply with quote

You need to get rid of the ICD=TRUE in your code, as well as changing to release mode.

#FUSES BROWNOUT,BORV45

is the correct combination, and does work.

Get rid of *=16. This only applies to PIC16 chips.

Best Wishes
JerryR



Joined: 07 Feb 2008
Posts: 164

View user's profile Send private message

PostPosted: Sun Dec 11, 2011 10:13 am     Reply with quote

Ttelmah:

Thanks for your reply. I'll give that a try.

All the best
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