Using my python, it is possible to control the frequency of the C.P.U clock of your is 32 and that
is very easy.
Yes, you're about to see now.
Why would you want to do something like that?
The best example I can come up with is to reduce the power consumption of your AHP 32, which is particularly
useful when you are running your E.S.P 32 powered gadget of battery.
I'm going to demonstrate how much savings you can achieve by reducing the frequency of your sleep use
clock by half or even by a quarter.
So what I've got here is a simple example where I've got an infinite loop and I get my ability to move
from it's full speed, which is 240 megahertz clock speed to 180 megahertz and even down to 40 megahertz
of clock speed.
And at each step, each operational sebu frequency, you'll see that the current rule from my power
supply will be dropping accordingly.
I'm going to do this experiment in two parts.
First time I'm going to run.
This experiment is going to be just by running a regular program onto my E.S.P 32, which is this program
right here.
I've got an infinite loop and inside the loop I'm first setting the CPU frequency to a particular frequency
going to cycle between two hundred forty megahertz, eighty megahertz and forty megahertz.
And then I'm going to use machine don't freak for frequency to read the current operation of frequency
and printed onto the shell.
And at each step I'm going to stay there for five seconds, give enough time for the current trial to
stabilize so that I can read it once.
I'm happy that this script works.
I'm going to say that as boot dot p y and then I'm going to power my 32 externally from my benchtop
power supply.
And that is going to give me the ability to also read the current drill by looking at my power supplies
current display.
Now you can find more information about what I'm about to do here.
I'm looking at the documentation of board control and under general board control here you'll see that
there's an example of how you can use the two methods.
Frequency of freq allows you to get the current frequency of the U.S. military to see Beauclerk.
And this is how the strategist parameter of the frequency desired frequency in Heard's, and that will
allow you to set the frequency.
All right.
So I want to be connected.
I am going to first upload.
The script just clicked on stop just to get the show and prepare the device for the upload.
So now I'm going to run it and you can see 240 forty.
So this 240 megahertz, 80 megahertz for another five seconds.
And 40 megahertz is going to go back to.
Two hundred and forty megahertz.
All right, just stop it and.
Bring up the files menu and I'm going to create a new file here.
I'm going to copy this code just a bit here.
Taste it in here.
And I'm going to call that.
butI y.
And I think that he will be all right now when I restart the program.
It will automatically run whatever code I have in.
But don't he?
Why?
All right.
So then I'm like the USB cable.
And that's important because you don't want to be powering the PS3 32 using USB plus an external power
supply.
So the USB is now disconnected content on my power supply.
So I've said it to three point three volts.
Some power supply is stable, so it is safe to use.
I'm going to plug the black cable coming from the power supply onto the ground power rail and then the
red one will go to three point three volts pin right there.
Just remember that the three point three volts pin does not provide voltage regulation.
There's no voltage regulator on the three point three pin.
If you don't have a three point three volt stable power supply, then you can also try out at the five
volt pen.
So of course you will need to change your power supply to five volts or a little bit more.
And this pin does regulate power or voltage does regulate voltage and therefore it's a safer pin to
use.
But you do have a little bit of wasted energy on the voltage regulator.
And that is why in my test, I prefer to go for the three point three volts and that would give me a
good indication of what is the power consumption, I should say actually to be more exact current draw
at each frequency setting.
So I'm going to turn on the power supply now and just look at this number here at the amperage to see
how much current draw we get at each frequency setting.
We're not going to be able to see the output, of course, because we are not connected to the shell.
But you'll be able to see how the temperature drops from two hundred and forty megahertz operation down
to 40 megahertz.
Let's have a look.
So we now own.
So that's two hundred and forty megahertz.
That's 80 megahertz.
And 40 megahertz.
So the one who cycle.
Two hundred and forty megahertz.
80.
And 40.
She can see the difference in amperage and the current draw is quite noticeable between the three levels
or the three steps in the clock's frequency.
So this is one easy way to.
Reduce the power consumption of your ISP 32, especially if it's doing something that doesn't really
require a high clock rate.
Another thing that you can do to reduce power consumption considerably is to put the 32 into deep sleep.
That's a capability that is available to us through micro python.
But, of course, a different lecture where I demonstrate how to do that.
All right, now remember that you've got the wi fi or with code in it running, if you don't do anything
at this point, then every time that you start your ISP 32 or you power it up, the Wi-Fi and the code
in it will execute.
And of course, we probably don't want that to happen.
So there's a couple of things that you can do here.
First of all, I'm going to switch off my power supply and connect my ears to back to my.
Computer fire, USP.
All right, so we're back.
Let's get Michelle working, so as soon as I powered up my opportunity to buy a USB be, the script
would would normally start running.
So I'm going to click on this top restart back and button.
A couple of times to get.
My is Peter to back onto the show.
And I'm also hearing controversy.
So I've got my boot IPY there, the script has stopped running.
I just typed control see to make that happen.
And I'm now going to either totally delete the script, which would be better, or alternatively, if
you want to delete it, just undo.
You can just use the tactics.
Three tactics on top and three back takes in the bottom in order to comment out this whole block of
content.
More of the script in case you want to use it a bit later.
So in either case, you want to make sure that there's nothing left that is executable inside the boot
dot p y script they saved on the device.
Now, if I I'm going to press on this pattern here to reset, you'll see that I'm going straight into
the prompt of the show, which means that nothing is executing.
So at this point, I can go on.
And work on my next experiment.