View previous topic :: View next topic |
Author |
Message |
gammla
Joined: 08 Jun 2007 Posts: 3
|
SOLVED: Problems with setting #FUSES FCMEN (PIC18F4620) |
Posted: Fri Jun 08, 2007 10:07 am |
|
|
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
|
|
Posted: Fri Jun 08, 2007 2:29 pm |
|
|
Quote: | #FUSES RESERVED //Used to set the reserved FUSE bits |
I got it work when I commented out the line above. Example:
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
|
|
Posted: Fri Jun 08, 2007 5:44 pm |
|
|
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! |
|
|
|