View previous topic :: View next topic |
Author |
Message |
hemnath
Joined: 03 Oct 2012 Posts: 242 Location: chennai
|
Internal oscillator with PLL |
Posted: Tue Aug 18, 2015 12:09 am |
|
|
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: 19543
|
|
Posted: Tue Aug 18, 2015 2:38 am |
|
|
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: 242 Location: chennai
|
|
Posted: Tue Aug 18, 2015 2:57 am |
|
|
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: 19543
|
|
Posted: Tue Aug 18, 2015 3:23 am |
|
|
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: 242 Location: chennai
|
|
Posted: Tue Aug 18, 2015 3:55 am |
|
|
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. |
|
|
|