View previous topic :: View next topic |
Author |
Message |
donquixote
Joined: 21 Jul 2008 Posts: 15 Location: Shanghai, China
|
#fuses Statement Failed in Mplab 8.15a with CCS compiler |
Posted: Tue Dec 16, 2008 5:15 am |
|
|
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
|
|
Posted: Tue Dec 16, 2008 6:24 am |
|
|
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
|
|
Posted: Tue Dec 16, 2008 7:12 am |
|
|
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
|
|
Posted: Tue Dec 16, 2008 9:02 am |
|
|
And what about the Code: | #use delay(clock=20000000, RESTART_WDT) | statement? |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Dec 16, 2008 12:39 pm |
|
|
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. |
|
|
|