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

How can I set internal oscillator for PIC24F16KA101

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



Joined: 05 Aug 2009
Posts: 37

View user's profile Send private message MSN Messenger

How can I set internal oscillator for PIC24F16KA101
PostPosted: Sun Mar 14, 2010 11:57 pm     Reply with quote

Hello everybody

I want to set internal oscillator for "PIC24F16KA101"
I'm try these set at wizard but still can't work

#FUSES FRC //Internal Fast RC Oscillator
#FUSES FRC_PLL //Internal Fast RC oscillator with PLL
#FUSES LPRC //Internal low power RC Oscillator

Code:

#include <24F16KA101.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOBSS                    //No boot segment
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES FRC                      //Internal Fast RC Oscillator
//#FUSES NOIESO                     //Internal External Switch Over mode enabled
#FUSES NOPR                     //Pimary oscillaotr disabled
#FUSES NOOSCIO                    //OSC2 is general purpose output
#FUSES POSCFREQ_H           
#FUSES SOSC_HIGH             
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPOSTS16                 //Watch Dog Timer PostScalar 1:32768
#FUSES WPRES128                 //Watch Dog Timer PreScalar 1:128
#FUSES WINDIS                   //Watch Dog Timer in non-Window mode
#FUSES NOBROWNOUT               //No brownout reset
#FUSES PUT                      //Power Up Timer
#FUSES BORV_LOW             
#FUSES MCLR                     //Master Clear pin enabled
#FUSES ICSP1                    //ICD uses PGC1/PGD1 pins
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES DSWDT2147483648       
#FUSES DSWDTCK_LPRC         
#FUSES RTCCK_SOSC           
#FUSES DSBOR                 
#FUSES DSWDT                 

#use delay(clock=8000000)
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Mar 15, 2010 12:24 am     Reply with quote

#fuses FRC is working with PIC24F24KA101 and (at least) recent compiler versions (V4.104, V4.105).
How do you determine, that it doesn't work? What's your compiler version?
sindyme



Joined: 05 Aug 2009
Posts: 37

View user's profile Send private message MSN Messenger

PostPosted: Mon Mar 15, 2010 12:38 am     Reply with quote

FvM wrote:
#fuses FRC is working with PIC24F24KA101 and (at least) recent compiler versions (V4.104, V4.105).
How do you determine, that it doesn't work? What's your compiler version?


My CCS version is 4.105 of PCDIDE.
There is my code for internal oscillator test.
Code:

void main()
{
   setup_spi( FALSE );
   setup_wdt(WDT_OFF);
   setup_timer1(TMR_DISABLED);
   enable_interrupts(INT_RDA);
   enable_interrupts(INT_RDA2);
   
   for(;;)
   {
      delay_ms(500);
      fprintf(comb,"MLis-Ln64 Start Initial\r\n");
      fprintf(coma,"Please wait....\r\n");
     
   }
}


.h file
Code:

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOWRTB                   //Boot block not write protected
#FUSES NOBSS                    //No boot segment
#FUSES NOPROTECT                //Code not protected from reading
#FUSES NOWRT                    //Program memory not write protected
#FUSES FRC                      //Internal Fast RC Oscillator
#FUSES NOIESO                     //Internal External Switch Over mode enabled
#FUSES NOPR                     //Pimary oscillaotr disabled
#FUSES NOOSCIO                    //OSC2 is general purpose output
#FUSES POSCFREQ_H           
#FUSES SOSC_HIGH             
#FUSES NOCKSFSM                 //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPOSTS16                 //Watch Dog Timer PostScalar 1:32768
#FUSES WPRES128                 //Watch Dog Timer PreScalar 1:128
#FUSES WINDIS                   //Watch Dog Timer in non-Window mode
#FUSES NOBROWNOUT               //No brownout reset
#FUSES PUT                      //Power Up Timer
#FUSES BORV_LOW             
#FUSES MCLR                     //Master Clear pin enabled
#FUSES ICSP1                    //ICD uses PGC1/PGD1 pins
#FUSES NODEBUG                  //No Debug mode for ICD
#FUSES DSWDT2147483648       
#FUSES DSWDTCK_LPRC         
#FUSES RTCCK_SOSC           
#FUSES DSBOR                 
#FUSES DSWDT                 

#use delay(clock=8000000)
#use rs232(UART1,baud=9600,parity=N,bits=8,stream=coma) //Pin_11,Pin_6
#use rs232(UART2,baud=9600,parity=N,bits=8,stream=comb) //Pin_4,Pin_5
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Mar 15, 2010 3:49 am     Reply with quote

I don't see a problem with the fuses settings, also no other problem in your code (as far as you posted it). I'm using
nearly identical fuses in my application. I don't know, if you have ISRs for your enabled RxD interrupts. Otherwise, there
would be a problem.
sindyme



Joined: 05 Aug 2009
Posts: 37

View user's profile Send private message MSN Messenger

PostPosted: Mon Mar 15, 2010 8:41 pm     Reply with quote

FvM wrote:
I don't see a problem with the fuses settings, also no other problem in your code (as far as you posted it). I'm using
nearly identical fuses in my application. I don't know, if you have ISRs for your enabled RxD interrupts. Otherwise, there
would be a problem.


Ok, I solve this question.
Because I have ISRs for enabled RxD interrupts.
Now my "PIC" work when I remove RxD interrupts.
Thank your suggestion, Fvm.
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