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

PIC24FJ64GA306 oscillator is not working correctly

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



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PIC24FJ64GA306 oscillator is not working correctly
PostPosted: Thu May 30, 2013 6:52 am     Reply with quote

Hi, everyone! I have a problem with 1 PIC24FJ64GA306. I`m testing the controller with simple program:

Code:

#include <24FJ64GA306.h>
#FUSES HS,NOWDT
#use delay(clock=20M)

void main()
{
      while(1)
      {
             delay_ms(10000);
      }
}


So when I turn on my debugger (pic kit 3) and set a break point next to delay_ms() the expected delay is 10s but when I run the program the delay is atleast 4 times bigger. I exchange the quartz and it`s almost the same.
What am I doing wrong or where could be the error?
Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19363

View user's profile Send private message

PostPosted: Thu May 30, 2013 7:53 am     Reply with quote

Almost certainly means your oscillator is not starting. You need to add 'PR' to your fuses to turn on the primary oscillator, or the chip will wake using the FRC oscillator, and you can then switch it later. The 'default' is for the primary to be off....

On these later chips several of the 'defaults', are perhaps not what you may expect.

Best Wishes
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

PostPosted: Thu May 30, 2013 10:44 pm     Reply with quote

Thanks! I think now it`s OK!
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