 Hello and welcome to the video about the STM32 cube PCC tool which is embedded power consumption calculator within our STM32 cube MX or cube IDE. It is usually quite hidden so let's go ahead and explain what it can be used for. Usually you have a low-power application or you just want to find out how much power your application will consume and basically you have three options how to obtain the rough value of your application profile. First of all and the hardest one is the real board measurement which will take a lot of time to obtain the final value but it is quite precise measurement but the biggest downside is if you just want to compare two microcontrollers to select the most suitable one it would take a lot of time. The second one is the data sheet usually you will just dig into the data sheet to find the value of the low power modes of the run modes so it's relatively fast but still for a complex project and lots of modes changing within the application it may be quite difficult to evaluate the final profile. And finally with PCC it's a graphical interface so just in a couple of clicks you will find out the estimation of the expected current consumption and the profile of your application but in some cases it may be only a rough estimation of the application profile. For this video I have selected the L476 nucleo and I will simulate a real application which spends most of the time in the stop tube mode the low power mode and that will be for the 990 milliseconds and it will spend 10 milliseconds in run mode to simulate some kind of data processing or data acquisition. This video is not a tutorial on how to use the cube mix that is already covered by some other videos or the available so to create the model application I will just show the crucial steps so at the beginning either in cube IDE or in cube mix I need to start a project give it a name find the L476RG just the microcontroller because I don't need the board in its default state I just need the plain microcontroller project I name the project and finish the creation of the file. When the cube mix project is created I need to configure my application so to periodically wake up from the stop mode I will use the RTC peripheral real-time clock so first of all I need the RCC to activate the low speed clock that will fit the RTC with this clock source on the nucleo board the LSE crystal must be in the high drive mode and then I can switch to the timer find the real-time clock peripheral and activate the clock source and I will be using the most simple feature of the RTC and that is the wake up timer the wake up clock will be set to the RTC clock which is the LSE at 32 kHz divided by 16 so effectively 2 kHz clock signal will be fed into the wake up timer I need also the interrupts being enabled for the RTC and finally with this configuration done I need to set the correct clock for the RTC that means in the clock configuration tab to switch it from the LSI to the LSE and also I want the multi-speed internal to be at 48 megahertz so I will just change the clock for the 48 megahertz the final step of the configuration is to set the unused IOS to analog to reduce the power consumption with the project created in the cubemix or cubite I can switch to the coding view and define my application so I will be using the wake up timer that is prepared by the cubemix I just need to activate it by using the HAL RTC function as you can see one of the parameters is the 2047 which is exactly for the 2 kHz to make the period of one second I will enable the flash sleep power down to save some power during the low power state and then in the simple while loop I will simulate the execution of some data processing by using the simple HAL delay for 10 milliseconds that is just a while loop waiting for 10 milliseconds so the core stays in the run mode after this 10 millisecond period I will go to the stop tune mode and when the CPU will wake up the cycle will repeat again the point of this video is to show the use cases of the power consumption calculator versus the other methods so for the real board measurement I was using the power shield in combination with cube monitor power application and I obtained the value of the 89.44 microamps of my application you can see also the graph that we are periodically waking up with the 10 millisecond duration and for the rest we are in the low power mode the second method is the datasheet method so I need to open the datasheet of the L476RG microcontroller and find at least the two crucial values that is the power consumption in the stop tune mode which can be found in the table 45 and I need to find the power consumption of the run mode and that will be found in the table 29 I obtained my values so to calculate the power consumption of the whole application I just need for this particular application quite simple equation basically it's the percentage of time I'm spending in run mode which is the 10 millisecond and the percentage of the time in the stop tune mode which is the 990 milliseconds or 99 percent of the time and I can calculate these two values together and that will give me the result of 78.17 microamps this is just a quick calculation but if I would combine it with some other peripherals it could grow very large and very complex at equation coming back to the presentation to give a quick comparison of the three methods I used in this video the real board evaluation versus datasheet calculation versus the PCC as you can see they are not so far from the real measurement as for the datasheet or PCC so it can be a good estimation at the beginning of the development or as a tool to choose the most suitable microcontroller for your application so thank you for your attention and hope to see you by the next video