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

SOLVED: Problems with setting #FUSES FCMEN (PIC18F4620)

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



Joined: 08 Jun 2007
Posts: 3

View user's profile Send private message

SOLVED: Problems with setting #FUSES FCMEN (PIC18F4620)
PostPosted: Fri Jun 08, 2007 10:07 am     Reply with quote

Hello!
I am using the CCS compiler version 4.023 and MPLAB 7.6!
I have problems with setting the fuses for the fail-safe clock monitor!
if i set the fuse to #FUSES FCMEN the configuration bit report of MPLAB tells me, that this function is disabled.
by testing it in the hardware and disturbing the external oscillator, the program hangs, restarts or makes some strange things. However this function isnt activateted like it is shown in MPLAB.

what could be my mistake?

this is my fuse setting code:

Code:

#include <18F4620.h>
//#device PIC18F4620 adc=10


#FUSES NOWDT                    //No Watch Dog Timer
#FUSES WDT128                   //Watch Dog Timer uses 1:128 Postscale
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES NOPROTECT                //Code not protected from reading
#FUSES IESO                     //Internal External Switch Over mode enabled
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BORV46                   //Brownout reset at 4.6V
#FUSES PUT                      //Power Up Timer
#FUSES NOCPD                    //No EE protection
#FUSES STVREN                   //Stack full/underflow will cause reset
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT                    //Program memory not write protected
#FUSES NOWRTD                   //Data EEPROM not write protected
#FUSES NOEBTR                   //Memory not protected from table reads
#FUSES NOCPB                    //No Boot Block code protection
#FUSES NOEBTRB                  //Boot block not protected from table reads
#FUSES NOWRTC                   //configuration not registers write protected
#FUSES NOWRTB                   //Boot block not write protected
#FUSES FCMEN                    //Fail-safe clock monitor enabled
#FUSES NOXINST                    //Extended set extension and Indexed Addressing mode enabled
#FUSES NOPBADEN                 //PORTB pins are configured as digital I/O on RESET
#FUSES RESERVED                 //Used to set the reserved FUSE bits
//   Reserved
#FUSES NOMCLR                   //Master Clear pin used for I/O


#use delay(clock=10000000)
//#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)


Last edited by gammla on Sat Jun 09, 2007 7:51 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jun 08, 2007 2:29 pm     Reply with quote

Quote:
#FUSES RESERVED //Used to set the reserved FUSE bits

I got it work when I commented out the line above. Example:
Code:
// #FUSES RESERVED

Then it works OK:
Code:
Word  1: C200   HS IESO FCMEN


What is the "RESERVED" fuse ? I've never seen it before.
Did you put it in, or did the CCS Wizard do it ?
gammla



Joined: 08 Jun 2007
Posts: 3

View user's profile Send private message

PostPosted: Fri Jun 08, 2007 5:44 pm     Reply with quote

Hello!
Thanks for solving the problem!
The code

Code:
#FUSES RESERVED                 //Used to set the reserved FUSE bits


is generated by the ccs wizzard.
On the bottom of the wizzards fuse configuration you are able to choose between
"Timer1 configured for low-power operation"
"Timer1 configured for higher power operation"
and
"Used to set the reserved FUSE bits"

I chose the last option because the two first options weren't relevant for my project.
So this code was gernerated.

thanks again

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