1
00:00:00,720 --> 00:00:08,550
Using my python, it is possible to control the frequency of the C.P.U clock of your is 32 and that

2
00:00:08,550 --> 00:00:09,330
is very easy.

3
00:00:09,360 --> 00:00:10,880
Yes, you're about to see now.

4
00:00:10,890 --> 00:00:12,870
Why would you want to do something like that?

5
00:00:13,440 --> 00:00:20,640
The best example I can come up with is to reduce the power consumption of your AHP 32, which is particularly

6
00:00:20,640 --> 00:00:26,010
useful when you are running your E.S.P 32 powered gadget of battery.

7
00:00:26,280 --> 00:00:34,800
I'm going to demonstrate how much savings you can achieve by reducing the frequency of your sleep use

8
00:00:34,800 --> 00:00:37,930
clock by half or even by a quarter.

9
00:00:38,340 --> 00:00:46,470
So what I've got here is a simple example where I've got an infinite loop and I get my ability to move

10
00:00:46,470 --> 00:00:56,550
from it's full speed, which is 240 megahertz clock speed to 180 megahertz and even down to 40 megahertz

11
00:00:56,550 --> 00:00:57,450
of clock speed.

12
00:00:57,720 --> 00:01:06,450
And at each step, each operational sebu frequency, you'll see that the current rule from my power

13
00:01:06,450 --> 00:01:08,900
supply will be dropping accordingly.

14
00:01:09,390 --> 00:01:11,580
I'm going to do this experiment in two parts.

15
00:01:11,880 --> 00:01:12,810
First time I'm going to run.

16
00:01:12,810 --> 00:01:18,900
This experiment is going to be just by running a regular program onto my E.S.P 32, which is this program

17
00:01:18,900 --> 00:01:19,400
right here.

18
00:01:19,410 --> 00:01:26,220
I've got an infinite loop and inside the loop I'm first setting the CPU frequency to a particular frequency

19
00:01:26,490 --> 00:01:31,110
going to cycle between two hundred forty megahertz, eighty megahertz and forty megahertz.

20
00:01:31,530 --> 00:01:37,530
And then I'm going to use machine don't freak for frequency to read the current operation of frequency

21
00:01:37,530 --> 00:01:40,110
and printed onto the shell.

22
00:01:40,770 --> 00:01:47,940
And at each step I'm going to stay there for five seconds, give enough time for the current trial to

23
00:01:47,940 --> 00:01:50,280
stabilize so that I can read it once.

24
00:01:50,280 --> 00:01:53,010
I'm happy that this script works.

25
00:01:53,010 --> 00:02:06,000
I'm going to say that as boot dot p y and then I'm going to power my 32 externally from my benchtop

26
00:02:06,000 --> 00:02:06,780
power supply.

27
00:02:06,900 --> 00:02:13,540
And that is going to give me the ability to also read the current drill by looking at my power supplies

28
00:02:13,830 --> 00:02:15,280
current display.

29
00:02:16,170 --> 00:02:20,640
Now you can find more information about what I'm about to do here.

30
00:02:20,650 --> 00:02:27,240
I'm looking at the documentation of board control and under general board control here you'll see that

31
00:02:28,290 --> 00:02:32,280
there's an example of how you can use the two methods.

32
00:02:32,280 --> 00:02:39,420
Frequency of freq allows you to get the current frequency of the U.S. military to see Beauclerk.

33
00:02:39,420 --> 00:02:46,860
And this is how the strategist parameter of the frequency desired frequency in Heard's, and that will

34
00:02:46,860 --> 00:02:48,430
allow you to set the frequency.

35
00:02:49,320 --> 00:02:49,870
All right.

36
00:02:49,890 --> 00:02:51,690
So I want to be connected.

37
00:02:51,690 --> 00:02:54,600
I am going to first upload.

38
00:02:55,800 --> 00:03:02,470
The script just clicked on stop just to get the show and prepare the device for the upload.

39
00:03:02,510 --> 00:03:06,690
So now I'm going to run it and you can see 240 forty.

40
00:03:08,400 --> 00:03:12,540
So this 240 megahertz, 80 megahertz for another five seconds.

41
00:03:14,360 --> 00:03:17,390
And 40 megahertz is going to go back to.

42
00:03:19,130 --> 00:03:20,390
Two hundred and forty megahertz.

43
00:03:20,990 --> 00:03:23,750
All right, just stop it and.

44
00:03:24,950 --> 00:03:29,680
Bring up the files menu and I'm going to create a new file here.

45
00:03:32,330 --> 00:03:35,190
I'm going to copy this code just a bit here.

46
00:03:38,010 --> 00:03:38,930
Taste it in here.

47
00:03:40,960 --> 00:03:43,000
And I'm going to call that.

48
00:03:45,320 --> 00:03:46,430
butI y.

49
00:03:47,800 --> 00:03:53,630
And I think that he will be all right now when I restart the program.

50
00:03:53,650 --> 00:03:58,000
It will automatically run whatever code I have in.

51
00:03:58,000 --> 00:03:58,860
But don't he?

52
00:03:58,870 --> 00:03:59,200
Why?

53
00:03:59,830 --> 00:04:00,210
All right.

54
00:04:00,220 --> 00:04:04,200
So then I'm like the USB cable.

55
00:04:04,360 --> 00:04:10,900
And that's important because you don't want to be powering the PS3 32 using USB plus an external power

56
00:04:10,900 --> 00:04:11,340
supply.

57
00:04:11,740 --> 00:04:15,730
So the USB is now disconnected content on my power supply.

58
00:04:16,810 --> 00:04:19,630
So I've said it to three point three volts.

59
00:04:20,350 --> 00:04:24,620
Some power supply is stable, so it is safe to use.

60
00:04:24,640 --> 00:04:33,280
I'm going to plug the black cable coming from the power supply onto the ground power rail and then the

61
00:04:33,280 --> 00:04:37,980
red one will go to three point three volts pin right there.

62
00:04:38,560 --> 00:04:48,280
Just remember that the three point three volts pin does not provide voltage regulation.

63
00:04:48,280 --> 00:04:52,030
There's no voltage regulator on the three point three pin.

64
00:04:52,420 --> 00:04:59,770
If you don't have a three point three volt stable power supply, then you can also try out at the five

65
00:04:59,770 --> 00:05:00,850
volt pen.

66
00:05:01,330 --> 00:05:08,210
So of course you will need to change your power supply to five volts or a little bit more.

67
00:05:08,500 --> 00:05:16,720
And this pin does regulate power or voltage does regulate voltage and therefore it's a safer pin to

68
00:05:16,720 --> 00:05:17,110
use.

69
00:05:17,110 --> 00:05:22,930
But you do have a little bit of wasted energy on the voltage regulator.

70
00:05:23,110 --> 00:05:31,180
And that is why in my test, I prefer to go for the three point three volts and that would give me a

71
00:05:31,180 --> 00:05:38,290
good indication of what is the power consumption, I should say actually to be more exact current draw

72
00:05:38,710 --> 00:05:41,130
at each frequency setting.

73
00:05:42,460 --> 00:05:51,820
So I'm going to turn on the power supply now and just look at this number here at the amperage to see

74
00:05:52,060 --> 00:05:57,520
how much current draw we get at each frequency setting.

75
00:05:57,520 --> 00:06:01,570
We're not going to be able to see the output, of course, because we are not connected to the shell.

76
00:06:02,020 --> 00:06:10,330
But you'll be able to see how the temperature drops from two hundred and forty megahertz operation down

77
00:06:10,330 --> 00:06:11,440
to 40 megahertz.

78
00:06:11,680 --> 00:06:12,490
Let's have a look.

79
00:06:12,520 --> 00:06:14,940
So we now own.

80
00:06:15,370 --> 00:06:17,500
So that's two hundred and forty megahertz.

81
00:06:20,430 --> 00:06:22,020
That's 80 megahertz.

82
00:06:25,330 --> 00:06:26,920
And 40 megahertz.

83
00:06:28,080 --> 00:06:29,250
So the one who cycle.

84
00:06:31,700 --> 00:06:33,020
Two hundred and forty megahertz.

85
00:06:35,710 --> 00:06:36,280
80.

86
00:06:40,000 --> 00:06:40,660
And 40.

87
00:06:42,960 --> 00:06:52,370
She can see the difference in amperage and the current draw is quite noticeable between the three levels

88
00:06:52,380 --> 00:06:56,220
or the three steps in the clock's frequency.

89
00:06:57,570 --> 00:07:00,270
So this is one easy way to.

90
00:07:01,230 --> 00:07:06,360
Reduce the power consumption of your ISP 32, especially if it's doing something that doesn't really

91
00:07:06,360 --> 00:07:09,030
require a high clock rate.

92
00:07:09,570 --> 00:07:15,840
Another thing that you can do to reduce power consumption considerably is to put the 32 into deep sleep.

93
00:07:16,170 --> 00:07:19,800
That's a capability that is available to us through micro python.

94
00:07:19,990 --> 00:07:24,480
But, of course, a different lecture where I demonstrate how to do that.

95
00:07:26,440 --> 00:07:36,130
All right, now remember that you've got the wi fi or with code in it running, if you don't do anything

96
00:07:36,130 --> 00:07:43,780
at this point, then every time that you start your ISP 32 or you power it up, the Wi-Fi and the code

97
00:07:43,780 --> 00:07:45,110
in it will execute.

98
00:07:45,130 --> 00:07:48,420
And of course, we probably don't want that to happen.

99
00:07:48,700 --> 00:07:51,280
So there's a couple of things that you can do here.

100
00:07:51,640 --> 00:07:59,680
First of all, I'm going to switch off my power supply and connect my ears to back to my.

101
00:08:01,440 --> 00:08:03,370
Computer fire, USP.

102
00:08:03,840 --> 00:08:06,300
All right, so we're back.

103
00:08:08,790 --> 00:08:16,270
Let's get Michelle working, so as soon as I powered up my opportunity to buy a USB be, the script

104
00:08:16,290 --> 00:08:18,510
would would normally start running.

105
00:08:19,350 --> 00:08:23,760
So I'm going to click on this top restart back and button.

106
00:08:26,760 --> 00:08:28,680
A couple of times to get.

107
00:08:30,360 --> 00:08:33,810
My is Peter to back onto the show.

108
00:08:36,360 --> 00:08:37,850
And I'm also hearing controversy.

109
00:08:39,090 --> 00:08:43,560
So I've got my boot IPY there, the script has stopped running.

110
00:08:43,570 --> 00:08:46,890
I just typed control see to make that happen.

111
00:08:47,160 --> 00:08:54,030
And I'm now going to either totally delete the script, which would be better, or alternatively, if

112
00:08:54,030 --> 00:08:56,970
you want to delete it, just undo.

113
00:08:57,780 --> 00:09:00,240
You can just use the tactics.

114
00:09:02,010 --> 00:09:10,200
Three tactics on top and three back takes in the bottom in order to comment out this whole block of

115
00:09:10,200 --> 00:09:10,860
content.

116
00:09:11,340 --> 00:09:13,830
More of the script in case you want to use it a bit later.

117
00:09:14,310 --> 00:09:19,970
So in either case, you want to make sure that there's nothing left that is executable inside the boot

118
00:09:19,990 --> 00:09:23,250
dot p y script they saved on the device.

119
00:09:24,120 --> 00:09:32,430
Now, if I I'm going to press on this pattern here to reset, you'll see that I'm going straight into

120
00:09:32,430 --> 00:09:37,020
the prompt of the show, which means that nothing is executing.

121
00:09:38,130 --> 00:09:39,720
So at this point, I can go on.

122
00:09:40,310 --> 00:09:41,960
And work on my next experiment.
