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

Internal oscillator with PLL

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



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

Internal oscillator with PLL
PostPosted: Tue Aug 18, 2015 12:09 am     Reply with quote

I am using 18LF2520 controller and internal oscillator 1Mhz. compiler version: V4.114

I want to use PLL and increase the frequency. Which command should i use?

please help
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Tue Aug 18, 2015 2:38 am     Reply with quote

You can't at 1MHz....

You can at 4MHz, or 8MHz only. Read the data sheet.

How fast do you want to go?. What is your battery voltage?. (the 32MHz mode requires at least 3.71v).

You can go to 8MHz on the internal oscillator without PLL, or select 4/8MHz, and enable the PLL after boot (setup_oscillator command), to give 16/32MHz.

On later compilers simply using (internal=16MHz) for example in the clock statement, automatically wakes up at 4MHz and switches the PLL on immediately after boot. Not sure if yours is late enough for this. If not, then use the setup_oscillator command to implement the change.

Remember also, that on the LF chip, 32Mhz requires 3.71v minimum supply.
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Tue Aug 18, 2015 2:57 am     Reply with quote

My supply voltage is maximum of 3.3V.
If i use 4Mhz, current consumption will be higher in my case.
Since my circuit is battery operated, I prefer to use 1Mhz internal oscillator to reduce the current consumption.

I have connected a graphic lcd and displaying some contents on it. It displays slowly when i use 1Mhz. So that i thought to increase the internal oscillator frequency using PLL.

I have one doubt, If i increase the frequency using PLL, will it increase the current consumption???

Please suggest any method which you have noticed before. I have to make the current as low as possible with better frequency.
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Tue Aug 18, 2015 3:23 am     Reply with quote

If you increase the frequency, the consumption will go up.
It's the processor that is drawing 99% of the power, not the oscillator.

The internal oscillator is running at 8MHz, and you are dividing this by eight to get the 1MHz. This division uses a tiny fraction of a pA. If you just select 4MHz, two division stages are not used, the CPU goes up to 4Mhz, and this is what draws the extra power. You can't have speed without a cost in power. If you could use the PLL at this speed, it'd actually draw a tiny amount more power to run this....

Remember though, there is nothing to stop you 'dynamically' switching.
You can use setup_oscillator to change to (say) 4MHz to do a job that needs more processor performance, and then switch down (possibly even slower like 32KHz), when you do not need the performance.

You can't get 4Mhz without using 4MHz CPU consumption. The PLL doesn't reduce the CPU consumption.
hemnath



Joined: 03 Oct 2012
Posts: 241
Location: chennai

View user's profile Send private message

PostPosted: Tue Aug 18, 2015 3:55 am     Reply with quote

Thanks Ttelmah.

how to make the controller to go into sleep mode?

I frequently want to wake up for every minutes.

Please help. thanks in advance.
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