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 CCS Technical Support

Configuration bits problem

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



Joined: 04 Dec 2006
Posts: 1

View user's profile Send private message MSN Messenger

Configuration bits problem
PostPosted: Tue Dec 05, 2006 11:54 am     Reply with quote

Hi,

I am using a PIC12F509 for a small project, and I encountered a problem during I/O testing with a simple program.

The compiler seems to overwrite my configuration bits (#fuses INTRC, NOMCLR, etc.) with the ones in MPLAB IDE Configure->Configuration bits. If I change the #fuses, nothing changes, unless I change it in MPLAB IDE.

Code:
#if defined(__PCB__)
#include <12F509.h>

#fuses INTRC
#fuses NOWDT
#fuses NOMCLR // NOMCLR -> No master clear, RE3 enabled as I/O
#use delay(clock=8000000)

void main (void)
{
   int toggle = 0;
   SET_TRIS_B(0x00);
   while(TRUE)
   {
      if (toggle == 0)
      {
         toggle = 1;
      }
      else
      {
         toggle = 0;
      }
      output_bit(PIN_B1,toggle);
      delay_ms(100);
   }   
}


I've worked with PIC18F4431 before and never seen something like that.

Your ideas will be really apreciated,

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 05, 2006 1:08 pm     Reply with quote

I tested your program with PCB vs. 3.249 and I saw the same problem.
This was with MPLAB vs. 7.20.

I was able to fix it by going into the Project/Build Options menu in
MPLAB, and changing the Debug File type to "Expanded COD format".

It was originally set for "COFF format" and that's the problem. MPLAB
apparently can't read the Config bit settings in that mode. It's probably
a bug. PCM and PCH don't have this problem in vs. 3.249.
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