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

#fuses Statement Failed in Mplab 8.15a with CCS compiler

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



Joined: 21 Jul 2008
Posts: 15
Location: Shanghai, China

View user's profile Send private message

#fuses Statement Failed in Mplab 8.15a with CCS compiler
PostPosted: Tue Dec 16, 2008 5:15 am     Reply with quote

hello, guys,

I meet another problem in code building in Mplab 8.15a with calling CCS Rev 4.080.

Currently , I use an external 20M crystal as the clock source for PIC24FJ128GA106. And I build a test code for it.

Code:

#include "24FJ128GA106.h"

#fuses HS
#fuses NOWDT, DEBUG, NOPROTECT, NOJTAG, IOL1WAY


void main()
{
    do
   {
    #asm
    BCLR   0x02C8, #3
    BSET   0x02CA, #3
    #endasm
   }while(1);
}


Firstly I set the configuration bits in Mplab IDE manually, Oscillator Select as the Primary Oscillator (XT,HS,EC) and then I got the value for #OSCCON is 0x2200.

Then I click on the Configuration Bits set in code, I got the value for #OSCCON is 0x7700.

Seems the code could not configure it correctly. But it is compiled successfully.

I guess, if the #fuses HS is not recongnized & configured correctly, other #fuses could not be recongnized too.


Of course I could re-configure the SFRs in my code without #fuses statements, but I am wondering whether there are some erroring in it.

Appreciate for anyone's comments.

Regards,
_________________
Don Quixote
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Dec 16, 2008 6:24 am     Reply with quote

No #fuses statement fails. You didn't specify the correct setting.
You have to set also fuse PR to select the primary oscillator.
donquixote



Joined: 21 Jul 2008
Posts: 15
Location: Shanghai, China

View user's profile Send private message

PostPosted: Tue Dec 16, 2008 7:12 am     Reply with quote

FvM wrote:
No #fuses statement fails. You didn't specify the correct setting.
You have to set also fuse PR to select the primary oscillator.


Hello, Frank,

Heartfelt thanks.

I have checked the settings for couples of times. Unfortunately I could not find it. ^_^

BTW, I am wondering how to get the complete & detailed specification for #fuses or other pre-processor statement since I could not get the enough information from the user manual. Some statements other developers used in their code are not listed in the manual.

Thanks & Regards,


Update:
P.S.: I have find the valid #fuses, I would try it later.
_________________
Don Quixote
Heath



Joined: 21 Dec 2007
Posts: 41

View user's profile Send private message

PostPosted: Tue Dec 16, 2008 9:02 am     Reply with quote

And what about the
Code:
#use delay(clock=20000000, RESTART_WDT)
statement?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Dec 16, 2008 12:39 pm     Reply with quote

Quote:
RESTART_WDT will restart the watchdog timer on every delay_us() and delay_ms() use

It's recommended, when using a watchdog and long delays, I think.
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