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

PIC24F Clock frequency multiply problem

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



Joined: 20 Dec 2023
Posts: 15

View user's profile Send private message Send e-mail AIM Address

PIC24F Clock frequency multiply problem
PostPosted: Fri Sep 20, 2024 1:40 am     Reply with quote

Hi Everyone,

I am using PIC24FJ512GL406 mcu in one of my project and using 32MHz external oscillator and want to double the clock frequency by using PLL.

Code:


//********* CPU Settings *******************************************

#device ICSP = 1
#pragma use delay(osc=32000000,clock=64000000,restart_wdt,clock_out)
#pragma fuses NOPROTECT,WDT,NOBROWNOUT,DEBUG,CKSNOFSM



This is my system setup code but not working.
If I change my line like -

Code:


#pragma use delay(clock=64MHz,osc,restart_wdt,clock_out)



Then the code will run but timer is not matching with 64MHz calculation and also clock out PIN shows 16MHz.

Any help will be highly appreciated.
Thanks in advance Very Happy [/code]
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Fri Sep 20, 2024 3:59 am     Reply with quote

The 16MHz, is right. Data sheet. CLKO = FOSC/2.

Are you sure what frequency you are running the timer off?. The timers by
default are run off the 'peripheral clock'. This is also FOSC/2. Look at
figure 9-1.
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Fri Sep 20, 2024 5:53 am     Reply with quote

With that processor, the CPU can only run at up to 32MHz. The PLL can be used to get 48MHz for the USB.
You cannot run the processor at 64MHz.
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Sat Sep 21, 2024 12:21 am     Reply with quote

Spot on. Maximum CPU instruction speed is 16MHz. Max clock 32MHz.
Mrinmoy



Joined: 20 Dec 2023
Posts: 15

View user's profile Send private message Send e-mail AIM Address

PostPosted: Sat Sep 21, 2024 1:19 am     Reply with quote

Yes! I just check it.
CPU of that particular controller can run maximum at 16MHz.

Thanks guys. Very Happy
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