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

Problem with fuses to matching #fuses command on PIC16F873A

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



Joined: 25 Jul 2005
Posts: 2
Location: Emsworth, UK

View user's profile Send private message

Problem with fuses to matching #fuses command on PIC16F873A
PostPosted: Mon Jul 25, 2005 3:28 am     Reply with quote

I have recently started using PCM on a PIC16F873A project and are having problems getting the fuses to be set to what we require.

The complier version is CCS PCM C Compiler, Version 3.228, 29617

Our header file has
Code:


#device ICD=TRUE                                       // set ICD

#fuses XT, WDT, PUT, DEBUG, BROWNOUT, LVP, NOCPD        // fuse settings

#use delay (clock = 4000000, RESTART_WDT)        // set clock speed and kick watchdog during delays



And this is included AFTER the standard 16F873A.h which has the #device Chip command.

However, the fuses come out as

Configuration Fuses:

Word 1: 3731 XT NOWDT PUT DEBUG NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT

I have tried commenting out the #device ICD=TRUE line and changing DEBUG to NODEBUG but still get the NOBROWNOUT and NOWDT results.


What is going on here? Am I being stupid and missing something obvious?
_________________
Many thanks,

Richard
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 25, 2005 3:55 am     Reply with quote

The code below worked fine if I commented out the ICD line.
I used PCM vs. 3.228. After you compile, MPLAB asks if you
want to update the .LST file window. Are you telling it "yes" ?
You should. Otherwise, you won't see the new fuse settings.
Code:
Configuration Fuses:
   Word  1: 3775   XT WDT PUT DEBUG NOPROTECT BROWNOUT NOLVP NOCPD NOWRT

Also, the ICD is not a low voltage programmer. You should be using
the "NOLVP" fuse, as shown below.
Code:
#include <16F873A.H>
//#device ICD=TRUE   
#fuses XT, WDT, PUT, DEBUG, BROWNOUT, NOLVP, NOCPD   
#use delay (clock = 4000000, RESTART_WDT) 


//====================================
void main()
{

while(1);
}
bengunn



Joined: 25 Jul 2005
Posts: 2
Location: Emsworth, UK

View user's profile Send private message

PostPosted: Mon Jul 25, 2005 7:44 am     Reply with quote

Ok, now I am really confused. I tried your code which worked fine, I then ported a simplified version of my code onto it and still Ok. In the end I renamed files and projects and it all worked Ok. The only thing that I can think of is that something got corrupted in one of the MPLAB or compiler generated files and that changing the project name and deleting all of the old project files got rid of it. My code is now exactly as before (apart from NOLVP istead of LVP) but it now works fine.

I had updated the LST file view BTW but it would be easily done to miss that one.

Oh well, many thanks for your help, as it certainly pointed me in the right direction and confirmed that I was not being totally stupid. Thanks for the LVP tip as well, as I had not noticed that one.
_________________
Many thanks,

Richard
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